pub enum StimInstruction {
Show 21 variants
SingleQubitGate {
gate_type: SingleQubitGateType,
qubit: usize,
},
TwoQubitGate {
gate_type: TwoQubitGateType,
control: usize,
target: usize,
},
Measure {
basis: MeasurementBasis,
qubits: Vec<usize>,
},
Reset {
qubits: Vec<usize>,
},
Comment(String),
Tick,
Detector {
coordinates: Vec<f64>,
record_targets: Vec<i32>,
},
ObservableInclude {
observable_index: usize,
record_targets: Vec<i32>,
},
MeasureReset {
basis: MeasurementBasis,
qubits: Vec<usize>,
},
Depolarize1 {
probability: f64,
qubits: Vec<usize>,
},
Depolarize2 {
probability: f64,
qubit_pairs: Vec<(usize, usize)>,
},
XError {
probability: f64,
qubits: Vec<usize>,
},
YError {
probability: f64,
qubits: Vec<usize>,
},
ZError {
probability: f64,
qubits: Vec<usize>,
},
PauliChannel1 {
px: f64,
py: f64,
pz: f64,
qubits: Vec<usize>,
},
PauliChannel2 {
probabilities: Vec<f64>,
qubit_pairs: Vec<(usize, usize)>,
},
CorrelatedError {
probability: f64,
targets: Vec<PauliTarget>,
},
ElseCorrelatedError {
probability: f64,
targets: Vec<PauliTarget>,
},
ShiftCoords {
shifts: Vec<f64>,
},
QubitCoords {
qubit: usize,
coordinates: Vec<f64>,
},
Repeat {
count: usize,
instructions: Vec<StimInstruction>,
},
}Expand description
Stim instruction type
Variants§
SingleQubitGate
Single-qubit gate
TwoQubitGate
Two-qubit gate
Measure
Measurement
Reset
Reset operation
Comment(String)
Comment (ignored during execution)
Tick
Barrier/tick (for timing information)
Detector
Detector annotation for error correction DETECTOR [coords…] rec[-1] rec[-2] …
ObservableInclude
Observable annotation for logical observables OBSERVABLE_INCLUDE(k) rec[-1] rec[-2] …
MeasureReset
Measure and reset to |0⟩ MR q1 q2 …
Depolarize1
Single-qubit depolarizing noise DEPOLARIZE1(p) q1 q2 …
Depolarize2
Two-qubit depolarizing noise DEPOLARIZE2(p) q1 q2 q3 q4 …
XError
X error (bit flip) X_ERROR(p) q1 q2 …
YError
Y error (bit-phase flip) Y_ERROR(p) q1 q2 …
ZError
Z error (phase flip) Z_ERROR(p) q1 q2 …
PauliChannel1
Pauli channel (single qubit) PAULI_CHANNEL_1(px, py, pz) q1 q2 …
PauliChannel2
Pauli channel (two qubits) PAULI_CHANNEL_2(p_IX, p_IY, …, p_ZZ) q1 q2
Correlated error CORRELATED_ERROR(p) X1 Y2 Z3 … or shorthand: E(p) X1 Y2 Z3 …
Else correlated error (conditional on previous E not triggering) ELSE_CORRELATED_ERROR(p) X1 Y2 Z3 …
ShiftCoords
Shift coordinate system SHIFT_COORDS [dx, dy, dz, …]
QubitCoords
Qubit coordinates QUBIT_COORDS(q) x y z …
Repeat
Repeat block REPEAT N { … }
Trait Implementations§
Source§impl Clone for StimInstruction
impl Clone for StimInstruction
Source§fn clone(&self) -> StimInstruction
fn clone(&self) -> StimInstruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StimInstruction
impl Debug for StimInstruction
Source§impl PartialEq for StimInstruction
impl PartialEq for StimInstruction
impl StructuralPartialEq for StimInstruction
Auto Trait Implementations§
impl Freeze for StimInstruction
impl RefUnwindSafe for StimInstruction
impl Send for StimInstruction
impl Sync for StimInstruction
impl Unpin for StimInstruction
impl UnwindSafe for StimInstruction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.