BitMatrixSparseSampler#
-
class cuquantum.
stabilizer. BitMatrixSparseSampler( - matrix: Array | BitMatrixCSR | SparseCSR,
- probs: Array,
- max_shots: int,
- *,
- num_outcomes: int | None = None,
- bit_packed: bool = False,
- package: Literal['numpy', 'cupy'] = 'numpy',
- seed: int | None = None,
- options: Options | None = None,
- stream: Stream = None,
Sparse Bernoulli sampler with GF(2) matrix multiply.
Samples independent Bernoulli errors into a sparse intermediate representation, then multiplies by a binary outcome matrix to produce detector outcomes.
Best when error probabilities are low and
n_errorsis large.Methods
- __init__(
- matrix: Array | BitMatrixCSR | SparseCSR,
- probs: Array,
- max_shots: int,
- *,
- num_outcomes: int | None = None,
- bit_packed: bool = False,
- package: Literal['numpy', 'cupy'] = 'numpy',
- seed: int | None = None,
- options: Options | None = None,
- stream: Stream = None,
- get_errors() BitMatrixCSR[source]#
Retrieve errors as
BitMatrixCSRfrom the lastsample()call.
- get_outcomes(
- bit_packed: bool = True,
Retrieve outcomes from the last
sample()call.
- sample( ) None[source]#
Sample errors and outcomes.
Results are stored internally; retrieve via
get_outcomes()andget_errors().
Attributes
- n_errors#
- n_outcomes#
- operands_package#