pub struct Flow {
pub start: PauliMap,
pub end: PauliMap,
pub measurements: FlowMeasurements,
pub sign: bool,
pub center: Option<IVec2>,
pub marker: FlowMarker,
}Expand description
A stabilizer flow: a Pauli boundary condition start propagated through a
chunk to end, together with the measurements it accumulates.
An empty start marks a flow created inside the chunk (nothing enters);
an empty end marks one that terminates in the chunk (nothing leaves).
FlowEngine fuses flows whose boundaries match across
chunks into detector chains.
Fields§
§start: PauliMapThe Pauli boundary entering the chunk; empty if the flow originates fully from here.
end: PauliMapThe Pauli boundary leaving the chunk; empty if the flow terminates here.
measurements: FlowMeasurementsMeasurement ids the flow accumulates as it crosses the chunk.
sign: boolWhether the stabilizer relation has negative sign. Equivalently, this
is the expected XOR of measurements when both boundaries have positive
eigenvalue.
center: Option<IVec2>Coordinate for the flow center, if any.
marker: FlowMarkerHow the completed chain’s parity is consumed. See FlowMarker.
Implementations§
Source§impl Flow
impl Flow
Sourcepub fn new(start: PauliMap, end: PauliMap) -> Self
pub fn new(start: PauliMap, end: PauliMap) -> Self
A flow from start to end with no measurements, no center, and a
FlowMarker::Detector marker. Chain the with_* methods to set the
rest, so adding a new field does not churn every construction site.
Sourcepub fn with_measurements(
self,
measurements: impl IntoIterator<Item = u32>,
) -> Self
pub fn with_measurements( self, measurements: impl IntoIterator<Item = u32>, ) -> Self
Replaces the carried measurement parity.
Sourcepub fn with_center(self, center: impl Into<Option<IVec2>>) -> Self
pub fn with_center(self, center: impl Into<Option<IVec2>>) -> Self
Sets the optional flow center.
Sourcepub fn with_marker(self, marker: FlowMarker) -> Self
pub fn with_marker(self, marker: FlowMarker) -> Self
Sets how downstream compilation consumes this flow.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Flow
impl<'de> Deserialize<'de> for Flow
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Flow
impl StructuralPartialEq for Flow
Auto Trait Implementations§
impl Freeze for Flow
impl RefUnwindSafe for Flow
impl Send for Flow
impl Sync for Flow
impl Unpin for Flow
impl UnsafeUnpin for Flow
impl UnwindSafe for Flow
Blanket Implementations§
§impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
fn assign_index(&mut self, index: usize, to: bool)
fn negate_index(&mut self, index: usize)
fn clear_bits(&mut self)
fn assign_random(
&mut self,
bit_count: usize,
random_number_generator: &mut impl RngExt,
)where
BorrowedSelf: BitLength,
§impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
fn assign(&mut self, other: &Other)
fn bitxor_assign(&mut self, other: &Other)
fn bitand_assign(&mut self, other: &Other)
fn bitor_assign(&mut self, other: &Other)
§impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
§impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
fn index(&self, index: usize) -> bool
fn weight(&self) -> usize
fn parity(&self) -> bool
fn is_zero(&self) -> bool
fn is_unit(&self, index: usize) -> bool
fn support<'a>(&'a self) -> impl SortedIteratorwhere
BorrowedSelf: 'a,
fn max_support(&self) -> Option<usize>
fn min_support(&self) -> Option<usize>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.