pub struct PrimalModuleParallelUnit {
pub unit_index: usize,
pub interface_ptr: DualModuleInterfacePtr,
pub partition_info: Arc<PartitionInfo>,
pub is_active: bool,
pub serial_module: PrimalModuleSerialPtr,
pub children: Option<(PrimalModuleParallelUnitWeak, PrimalModuleParallelUnitWeak)>,
pub parent: Option<PrimalModuleParallelUnitWeak>,
pub event_time: Option<PrimalModuleParallelUnitEventTime>,
pub streaming_decode_mocker: Option<StreamingDecodeMocker>,
}Fields§
§unit_index: usizethe index
interface_ptr: DualModuleInterfacePtrthe dual module interface, for constant-time clear
partition_info: Arc<PartitionInfo>partition information generated by the config
is_active: boolwhether it’s active or not; some units are “placeholder” units that are not active until they actually fuse their children
serial_module: PrimalModuleSerialPtrthe owned serial primal module
children: Option<(PrimalModuleParallelUnitWeak, PrimalModuleParallelUnitWeak)>left and right children dual modules
parent: Option<PrimalModuleParallelUnitWeak>parent dual module
event_time: Option<PrimalModuleParallelUnitEventTime>record the time of events
streaming_decode_mocker: Option<StreamingDecodeMocker>streaming decode mocker, if exists, base partition will wait until specified time and then start decoding
Implementations§
Source§impl PrimalModuleParallelUnit
impl PrimalModuleParallelUnit
Sourcepub fn fuse<DualSerialModule: DualModuleImpl + Send + Sync>(
&mut self,
dual_unit: &mut DualModuleParallelUnit<DualSerialModule>,
)
pub fn fuse<DualSerialModule: DualModuleImpl + Send + Sync>( &mut self, dual_unit: &mut DualModuleParallelUnit<DualSerialModule>, )
fuse two units together, by copying the right child’s content into the left child’s content and resolve index;
note that this operation doesn’t update on the dual module, call Self::break_matching_with_mirror if needed
Sourcepub fn break_matching_with_mirror(
&mut self,
dual_module: &mut impl DualModuleImpl,
)
pub fn break_matching_with_mirror( &mut self, dual_module: &mut impl DualModuleImpl, )
break the matched pairs of interface vertices
Trait Implementations§
Source§impl PrimalModuleImpl for PrimalModuleParallelUnit
impl PrimalModuleImpl for PrimalModuleParallelUnit
Source§fn new_empty(_initializer: &SolverInitializer) -> Self
fn new_empty(_initializer: &SolverInitializer) -> Self
create a primal module given the dual module
Source§fn clear(&mut self)
fn clear(&mut self)
clear all states; however this method is not necessarily called when load a new decoding problem, so you need to call it yourself
Source§fn load(&mut self, interface_ptr: &DualModuleInterfacePtr)
fn load(&mut self, interface_ptr: &DualModuleInterfacePtr)
load a new decoding problem given dual interface: note that all nodes MUST be syndrome node
fn load_defect_dual_node(&mut self, dual_node_ptr: &DualNodePtr)
Source§fn resolve<D: DualModuleImpl>(
&mut self,
group_max_update_length: GroupMaxUpdateLength,
interface: &DualModuleInterfacePtr,
dual_module: &mut D,
)
fn resolve<D: DualModuleImpl>( &mut self, group_max_update_length: GroupMaxUpdateLength, interface: &DualModuleInterfacePtr, dual_module: &mut D, )
analyze the reason why dual module cannot further grow, update primal data structure (alternating tree, temporary matches, etc)
and then tell dual module what to do to resolve these conflicts;
note that this function doesn’t necessarily resolve all the conflicts, but can return early if some major change is made.
when implementing this function, it’s recommended that you resolve as many conflicts as possible.
Source§fn intermediate_matching<D: DualModuleImpl>(
&mut self,
interface: &DualModuleInterfacePtr,
dual_module: &mut D,
) -> IntermediateMatching
fn intermediate_matching<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, ) -> IntermediateMatching
return a matching that can possibly include blossom nodes: this does not affect dual module
Source§fn load_defect<D: DualModuleImpl>(
&mut self,
defect_vertex: VertexIndex,
interface_ptr: &DualModuleInterfacePtr,
dual_module: &mut D,
)
fn load_defect<D: DualModuleImpl>( &mut self, defect_vertex: VertexIndex, interface_ptr: &DualModuleInterfacePtr, dual_module: &mut D, )
load a single syndrome and update the dual module and the interface
Source§fn perfect_matching<D: DualModuleImpl>(
&mut self,
interface: &DualModuleInterfacePtr,
dual_module: &mut D,
) -> PerfectMatching
fn perfect_matching<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, ) -> PerfectMatching
break down the blossoms to find the final matching; this function will take more time on the dual module
fn solve<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, )
fn solve_visualizer<D: DualModuleImpl + FusionVisualizer>(
&mut self,
interface: &DualModuleInterfacePtr,
syndrome_pattern: &SyndromePattern,
dual_module: &mut D,
visualizer: Option<&mut Visualizer>,
)where
Self: FusionVisualizer + Sized,
fn solve_step_callback<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, callback: F, )
fn solve_step_callback_interface_loaded<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, callback: F, )
Source§fn generate_profiler_report(&self) -> Value
fn generate_profiler_report(&self) -> Value
performance profiler report
Auto Trait Implementations§
impl Freeze for PrimalModuleParallelUnit
impl !RefUnwindSafe for PrimalModuleParallelUnit
impl Send for PrimalModuleParallelUnit
impl Sync for PrimalModuleParallelUnit
impl Unpin for PrimalModuleParallelUnit
impl !UnwindSafe for PrimalModuleParallelUnit
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