pub struct MWPMDecoder {
pub model_graph: Arc<ModelGraph>,
pub erasure_graph: Arc<ErasureGraph>,
pub complete_model_graph: CompleteModelGraph,
pub config: MWPMDecoderConfig,
pub simulator: Arc<Simulator>,
}Expand description
MWPM decoder, initialized and cloned for multiple threads
Fields§
§model_graph: Arc<ModelGraph>model graph is immutably shared
erasure_graph: Arc<ErasureGraph>erasure graph is immutably shared
complete_model_graph: CompleteModelGraphcomplete model graph each thread maintain its own precomputed data; the internal model_graph might be copied and modified if erasure error exists
config: MWPMDecoderConfigsave configuration for later usage
simulator: Arc<Simulator>an immutably shared simulator that is used to change model graph on the fly for correcting erasure errors
Implementations§
Source§impl MWPMDecoder
impl MWPMDecoder
Sourcepub fn new(
simulator: &Simulator,
noise_model: Arc<NoiseModel>,
decoder_configuration: &Value,
parallel: usize,
use_brief_edge: bool,
) -> Self
pub fn new( simulator: &Simulator, noise_model: Arc<NoiseModel>, decoder_configuration: &Value, parallel: usize, use_brief_edge: bool, ) -> Self
create a new MWPM decoder with decoder configuration
Sourcepub fn decode(
&mut self,
sparse_measurement: &SparseMeasurement,
) -> (SparseCorrection, Value)
pub fn decode( &mut self, sparse_measurement: &SparseMeasurement, ) -> (SparseCorrection, Value)
decode given measurement results
Sourcepub fn decode_with_erasure(
&mut self,
sparse_measurement: &SparseMeasurement,
sparse_detected_erasures: &SparseErasures,
) -> (SparseCorrection, Value)
pub fn decode_with_erasure( &mut self, sparse_measurement: &SparseMeasurement, sparse_detected_erasures: &SparseErasures, ) -> (SparseCorrection, Value)
decode given measurement results and detected erasures
Trait Implementations§
Source§impl Clone for MWPMDecoder
impl Clone for MWPMDecoder
Source§fn clone(&self) -> MWPMDecoder
fn clone(&self) -> MWPMDecoder
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MWPMDecoder
impl Debug for MWPMDecoder
Auto Trait Implementations§
impl Freeze for MWPMDecoder
impl RefUnwindSafe for MWPMDecoder
impl Send for MWPMDecoder
impl Sync for MWPMDecoder
impl Unpin for MWPMDecoder
impl UnwindSafe for MWPMDecoder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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