DEMSampler#

class cuquantum.stabilizer.DEMSampler(
dem: Any,
max_shots: int,
options: Options | None = None,
stream: int | Stream | None = None,
*,
package: Literal['numpy', 'cupy'] = 'cupy',
seed: int | None = None,
)[source]#

High-level sampler that takes a stim.DetectorErrorModel directly.

Parses the DEM into a binary matrix and probability array, then delegates to BitMatrixSparseSampler.

Methods

__init__(
dem: Any,
max_shots: int,
options: Options | None = None,
stream: int | Stream | None = None,
*,
package: Literal['numpy', 'cupy'] = 'cupy',
seed: int | None = None,
)[source]#
get_detector_samples(
bit_packed: bool = True,
) ndarray | ndarray[source]#
get_errors(**kwargs)[source]#
get_outcomes(
bit_packed: bool = True,
) ndarray | ndarray[source]#
sample(
num_shots: int,
*,
seed: int | None = None,
stream: int | Stream | None = None,
) None[source]#

Sample; delegates to the underlying matrix sampler.