pub struct PauliError {
pub x: Vec<bool>,
pub z: Vec<bool>,
}Expand description
A Pauli error over the data qubits: independent X (bit-flip) and Z
(phase-flip) components. y = x · z on a qubit is represented by both bits
being set.
Fields§
§x: Vec<bool>x[q] = true ⇔ an X acts on data qubit q.
z: Vec<bool>z[q] = true ⇔ a Z acts on data qubit q.
Implementations§
Source§impl PauliError
impl PauliError
Sourcepub fn identity(num_qubits: usize) -> Self
pub fn identity(num_qubits: usize) -> Self
The trivial (identity) error on num_qubits data qubits.
Sourcepub fn single_x(num_qubits: usize, q: usize) -> QuantumResult<Self>
pub fn single_x(num_qubits: usize, q: usize) -> QuantumResult<Self>
Sourcepub fn single_z(num_qubits: usize, q: usize) -> QuantumResult<Self>
pub fn single_z(num_qubits: usize, q: usize) -> QuantumResult<Self>
Sourcepub fn compose(&self, other: &Self) -> QuantumResult<Self>
pub fn compose(&self, other: &Self) -> QuantumResult<Self>
Compose two errors (qubit-wise XOR of X and Z parts).
§Errors
QuantumError::DimensionMismatch if the operands span different qubit
counts.
Trait Implementations§
Source§impl Clone for PauliError
impl Clone for PauliError
Source§fn clone(&self) -> PauliError
fn clone(&self) -> PauliError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PauliError
impl Debug for PauliError
impl Eq for PauliError
Source§impl PartialEq for PauliError
impl PartialEq for PauliError
impl StructuralPartialEq for PauliError
Auto Trait Implementations§
impl Freeze for PauliError
impl RefUnwindSafe for PauliError
impl Send for PauliError
impl Sync for PauliError
impl Unpin for PauliError
impl UnsafeUnpin for PauliError
impl UnwindSafe for PauliError
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