pub struct DetectorErrorModel { /* private fields */ }Expand description
Detector error model: independent error mechanisms over a program’s detectors and observables.
Derived by QecProgram::detector_error_model. Mechanisms are ordered by
the program position of the noise annotation that first produced each
symptom. Detector coordinates are carried verbatim from the program’s
detector ops, one entry per detector, empty when the op carried none.
Implementations§
Source§impl DetectorErrorModel
impl DetectorErrorModel
pub fn mechanisms(&self) -> &[ErrorMechanism]
pub fn num_mechanisms(&self) -> usize
pub fn num_detectors(&self) -> usize
pub fn num_observables(&self) -> usize
Sourcepub fn detector_coords(&self) -> &[Vec<f64>]
pub fn detector_coords(&self) -> &[Vec<f64>]
Coordinates per detector, in detector order. Empty for detectors whose op carried no coordinates.
Sourcepub fn decompose_graphlike(&self) -> Result<DetectorErrorModel>
pub fn decompose_graphlike(&self) -> Result<DetectorErrorModel>
Decompose hypergraph mechanisms into graphlike components.
Returns a model in which every mechanism flips at most two detectors.
A mechanism with more is replaced by existing graphlike mechanisms
whose non-empty detector sets partition its detectors and whose
observable XOR matches; its probability composes into every component
as p = p1(1-p2) + p2(1-p1). Cross-component correlations are lost;
single-detector marginals are unchanged. Deterministic: retained
mechanisms keep their order, the first cover in mechanism order wins.
§Errors
A hypergraph mechanism with no cover; the error names its symptom.
Sourcepub fn to_text(&self) -> String
pub fn to_text(&self) -> String
Render the model in the common detector error model text format.
One error(p) D.. L.. line per mechanism in mechanism order, then one
detector line per detector (with its coordinates when present), then
one logical_observable line per observable slot. The grammar is
documented in docs/architecture/qec-programs.md.
Trait Implementations§
Source§impl Clone for DetectorErrorModel
impl Clone for DetectorErrorModel
Source§fn clone(&self) -> DetectorErrorModel
fn clone(&self) -> DetectorErrorModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DetectorErrorModel
impl Debug for DetectorErrorModel
Source§impl PartialEq for DetectorErrorModel
impl PartialEq for DetectorErrorModel
impl StructuralPartialEq for DetectorErrorModel
Auto Trait Implementations§
impl Freeze for DetectorErrorModel
impl RefUnwindSafe for DetectorErrorModel
impl Send for DetectorErrorModel
impl Sync for DetectorErrorModel
impl Unpin for DetectorErrorModel
impl UnsafeUnpin for DetectorErrorModel
impl UnwindSafe for DetectorErrorModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more