PrimalModuleParallelUnit

Struct PrimalModuleParallelUnit 

Source
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: usize

the index

§interface_ptr: DualModuleInterfacePtr

the dual module interface, for constant-time clear

§partition_info: Arc<PartitionInfo>

partition information generated by the config

§is_active: bool

whether it’s active or not; some units are “placeholder” units that are not active until they actually fuse their children

§serial_module: PrimalModuleSerialPtr

the 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

Source

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

Source

pub fn break_matching_with_mirror( &mut self, dual_module: &mut impl DualModuleImpl, )

break the matched pairs of interface vertices

Trait Implementations§

Source§

impl FusionVisualizer for PrimalModuleParallelUnit

Source§

fn snapshot(&self, abbrev: bool) -> Value

take a snapshot, set abbrev to true to save space
Source§

impl PrimalModuleImpl for PrimalModuleParallelUnit

Source§

fn new_empty(_initializer: &SolverInitializer) -> Self

create a primal module given the dual module
Source§

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)

load a new decoding problem given dual interface: note that all nodes MUST be syndrome node
Source§

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, )

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

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, )

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

break down the blossoms to find the final matching; this function will take more time on the dual module
Source§

fn solve<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, )

Source§

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,

Source§

fn solve_step_callback<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, callback: F, )

Source§

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

performance profiler report

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V