pub struct IntermediateMatching {
pub peer_matchings: Vec<((DualNodePtr, DualNodeWeak), (DualNodePtr, DualNodeWeak))>,
pub virtual_matchings: Vec<((DualNodePtr, DualNodeWeak), VertexIndex)>,
}Fields§
§peer_matchings: Vec<((DualNodePtr, DualNodeWeak), (DualNodePtr, DualNodeWeak))>matched pairs; note that each pair will only appear once. (node_1, touching_1), (node_2, touching_2)
virtual_matchings: Vec<((DualNodePtr, DualNodeWeak), VertexIndex)>those nodes matched to the boundary. ((node, touching), virtual_vertex)
Implementations§
Source§impl IntermediateMatching
impl IntermediateMatching
pub fn new() -> Self
pub fn append(&mut self, other: &mut Self)
Sourcepub fn get_perfect_matching(&self) -> PerfectMatching
pub fn get_perfect_matching(&self) -> PerfectMatching
expand the intermediate matching into a perfect matching with only syndrome nodes
Source§impl IntermediateMatching
impl IntermediateMatching
Sourcepub fn expand_peer_matching(
dual_node_ptr_1: &DualNodePtr,
touching_ptr_1: &DualNodePtr,
dual_node_ptr_2: &DualNodePtr,
touching_ptr_2: &DualNodePtr,
) -> Vec<(DualNodePtr, DualNodePtr)>
pub fn expand_peer_matching( dual_node_ptr_1: &DualNodePtr, touching_ptr_1: &DualNodePtr, dual_node_ptr_2: &DualNodePtr, touching_ptr_2: &DualNodePtr, ) -> Vec<(DualNodePtr, DualNodePtr)>
break down a single matched pair to find the perfect matching
Sourcepub fn expand_blossom(
blossom_ptr: &DualNodePtr,
touching_ptr: &DualNodePtr,
) -> Vec<(DualNodePtr, DualNodePtr)>
pub fn expand_blossom( blossom_ptr: &DualNodePtr, touching_ptr: &DualNodePtr, ) -> Vec<(DualNodePtr, DualNodePtr)>
expand blossom iteratively into matched pairs, note that this will NOT change the structure of the primal module;
Trait Implementations§
Source§impl Debug for IntermediateMatching
impl Debug for IntermediateMatching
Auto Trait Implementations§
impl Freeze for IntermediateMatching
impl !RefUnwindSafe for IntermediateMatching
impl Send for IntermediateMatching
impl Sync for IntermediateMatching
impl Unpin for IntermediateMatching
impl !UnwindSafe for IntermediateMatching
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
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