pub trait Sampler: Send + Sync {
// Required methods
fn sample(&self, rng: &mut DeterministicRng) -> ErrorSet;
fn sample_single_error(&self, index: usize) -> ErrorSet;
fn count_single_error(&self) -> usize;
fn readouts_match(&self, actual: &BitVector, expected: &BitVector) -> bool;
fn error_tag(&self, marginal_index: usize, error_index: usize) -> &str;
// Provided method
fn filtered_count(&self) -> u64 { ... }
}Expand description
Trait for measurement samplers used by the simulation loop.
Required Methods§
Sourcefn sample(&self, rng: &mut DeterministicRng) -> ErrorSet
fn sample(&self, rng: &mut DeterministicRng) -> ErrorSet
Sample a set of errors.
Sourcefn sample_single_error(&self, index: usize) -> ErrorSet
fn sample_single_error(&self, index: usize) -> ErrorSet
Return the error set for a specific single error by index.
Sourcefn count_single_error(&self) -> usize
fn count_single_error(&self) -> usize
Total number of individual errors across all marginals.
Sourcefn readouts_match(&self, actual: &BitVector, expected: &BitVector) -> bool
fn readouts_match(&self, actual: &BitVector, expected: &BitVector) -> bool
Check if actual readouts match expected, respecting the readout mask.
Provided Methods§
Sourcefn filtered_count(&self) -> u64
fn filtered_count(&self) -> u64
Number of samples that were filtered out (e.g. due to preselect failures). Returns 0 by default.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".