pub struct UnionFindDecoder { /* private fields */ }Expand description
Union-find decoder compiled from a graphlike detector error model.
Detectors are vertices. A two-detector mechanism becomes an internal edge
and a one-detector mechanism a boundary edge, each weighted ln((1-p)/p)
clamped at zero. Mechanisms flipping no detector cannot enter the graph;
their probability mass bounds the logical error rate any decoder over the
model can reach. Mechanisms sharing one detector set collapse to the most
probable of them. Decoding uses no randomness: growth, fusion, and peeling
break every tie by ascending edge index in mechanism order, so equal
inputs give equal outputs on any thread count.
Implementations§
Source§impl UnionFindDecoder
impl UnionFindDecoder
Sourcepub fn from_model(model: &DetectorErrorModel) -> Result<Self>
pub fn from_model(model: &DetectorErrorModel) -> Result<Self>
Compile a decoder from a graphlike detector error model.
§Errors
A mechanism flipping more than two detectors is rejected with a
pointer to DetectorErrorModel::decompose_graphlike. Mechanism
probabilities must lie in [0, 1); a zero-probability mechanism is
skipped rather than rejected.
pub fn num_detectors(&self) -> usize
pub fn num_observables(&self) -> usize
Sourcepub fn decode_packed(&self, detectors: &PackedShots) -> Result<PackedShots>
pub fn decode_packed(&self, detectors: &PackedShots) -> Result<PackedShots>
Decode packed detector samples into predicted observable flips.
Accepts either layout with one bit per detector per shot, detector d
at bit index d. Returns shot-major records with one bit per
observable per shot, observable o at bit index o.
§Errors
The input measurement count must equal the model’s detector count, and every shot must be explainable: a detector component with odd defect parity and no boundary edge rejects the batch, naming the first such shot.
Trait Implementations§
Source§impl Clone for UnionFindDecoder
impl Clone for UnionFindDecoder
Source§fn clone(&self) -> UnionFindDecoder
fn clone(&self) -> UnionFindDecoder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for UnionFindDecoder
impl RefUnwindSafe for UnionFindDecoder
impl Send for UnionFindDecoder
impl Sync for UnionFindDecoder
impl Unpin for UnionFindDecoder
impl UnsafeUnpin for UnionFindDecoder
impl UnwindSafe for UnionFindDecoder
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