pub struct Fault { /* private fields */ }Expand description
One fault: a Pauli error on distinct wires, inserted after a node of the low-level circuit or, with no node named, before its first box.
Implementations§
Source§impl Fault
impl Fault
Sourcepub fn new(
after: Option<NodeId>,
errors: Vec<(WireId, PauliKind)>,
) -> Result<Self, QuantumError>
pub fn new( after: Option<NodeId>, errors: Vec<(WireId, PauliKind)>, ) -> Result<Self, QuantumError>
A fault from its errors, sorted by wire.
§Errors
QuantumError::DimensionMismatch if a wire is named twice or the fault is empty.
Sourcepub fn program(&self) -> Vec<GateOp>
pub fn program(&self) -> Vec<GateOp>
The gate program applying the errors on the fault’s wires in ascending order, with local qubit indices.
Sourcepub fn as_logical_pauli<W: NaturalNumber>(
&self,
n: usize,
) -> Result<LogicalPauli<W>, QuantumError>
pub fn as_logical_pauli<W: NaturalNumber>( &self, n: usize, ) -> Result<LogicalPauli<W>, QuantumError>
The fault as a Pauli over n qubits, wire w being qubit w.
§Errors
QuantumError::DimensionMismatch if a wire is not below n.
Trait Implementations§
impl Eq for Fault
Source§impl Ord for Fault
impl Ord for Fault
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Fault
impl PartialOrd for Fault
impl StructuralPartialEq for Fault
Auto Trait Implementations§
impl Freeze for Fault
impl RefUnwindSafe for Fault
impl Send for Fault
impl Sync for Fault
impl Unpin for Fault
impl UnsafeUnpin for Fault
impl UnwindSafe for Fault
Blanket Implementations§
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
Mutably borrows from an owned value. Read more