pub struct DetectorErrorModelGenerator {
pub circuit: Arc<Circuit>,
pub detectors: Vec<Detector>,
pub observables: Vec<LogicalObservable>,
/* private fields */
}Expand description
Detector error model generator based on single-error propagation.
The generator is pure Rust core logic. It can infer detector and observable declarations from circuit operations or use declarations supplied by the caller.
Fields§
§circuit: Arc<Circuit>§detectors: Vec<Detector>§observables: Vec<LogicalObservable>Implementations§
Source§impl DetectorErrorModelGenerator
impl DetectorErrorModelGenerator
Sourcepub fn new(
circuit: Circuit,
detectors: Option<Vec<Detector>>,
observables: Option<Vec<LogicalObservable>>,
) -> NpResult<Self>
pub fn new( circuit: Circuit, detectors: Option<Vec<Detector>>, observables: Option<Vec<LogicalObservable>>, ) -> NpResult<Self>
Create a generator for circuit.
If detectors or observables are None, declarations are inferred
from Operation::Detector and Operation::ObservableInclude entries in
the circuit.
Sourcepub fn new_with_options(
circuit: Circuit,
detectors: Option<Vec<Detector>>,
observables: Option<Vec<LogicalObservable>>,
options: DemGenerationOptions,
) -> NpResult<Self>
pub fn new_with_options( circuit: Circuit, detectors: Option<Vec<Detector>>, observables: Option<Vec<LogicalObservable>>, options: DemGenerationOptions, ) -> NpResult<Self>
Create a generator with explicit disjoint-channel handling options.
Sourcepub fn new_with_event_plan(
circuit: Circuit,
detectors: Vec<Detector>,
observables: Vec<LogicalObservable>,
event_plan: DemEventPlan,
) -> NpResult<Self>
pub fn new_with_event_plan( circuit: Circuit, detectors: Vec<Detector>, observables: Vec<LogicalObservable>, event_plan: DemEventPlan, ) -> NpResult<Self>
Create a generator using a precompiled event plan for this circuit.
Create a generator using shared circuit and event-plan ownership.
Sourcepub fn generate(&self) -> NpResult<DetectorErrorModel>
pub fn generate(&self) -> NpResult<DetectorErrorModel>
Generate a typed detector error model.
Sourcepub fn generate_lazy(&self) -> NpResult<LazyDetectorErrorModel>
pub fn generate_lazy(&self) -> NpResult<LazyDetectorErrorModel>
Generate detector/observable edge structure while deferring metadata clones.
Trait Implementations§
Source§impl Clone for DetectorErrorModelGenerator
impl Clone for DetectorErrorModelGenerator
Source§impl Debug for DetectorErrorModelGenerator
impl Debug for DetectorErrorModelGenerator
impl StructuralPartialEq for DetectorErrorModelGenerator
Auto Trait Implementations§
impl Freeze for DetectorErrorModelGenerator
impl RefUnwindSafe for DetectorErrorModelGenerator
impl Send for DetectorErrorModelGenerator
impl Sync for DetectorErrorModelGenerator
impl Unpin for DetectorErrorModelGenerator
impl UnsafeUnpin for DetectorErrorModelGenerator
impl UnwindSafe for DetectorErrorModelGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more