pub enum GateType {
Show 42 variants
RX,
RY,
RZ,
XCX,
XCY,
XCZ,
YCX,
YCY,
YCZ,
CX,
CY,
CZ,
H,
H_XY,
H_YZ,
H_NXY,
H_NXZ,
H_NYZ,
I,
X,
Y,
Z,
SQRT_X,
SQRT_X_DAG,
SQRT_Y,
SQRT_Y_DAG,
S,
S_DAG,
C_XYZ,
C_ZYX,
C_NXYZ,
C_XNYZ,
C_XYNZ,
C_NZYX,
C_ZNYX,
C_ZYNX,
T_YZ,
T_YZ_DAG,
T_XZ,
T_XZ_DAG,
T,
T_DAG,
}Expand description
A quantum gate, named after its Stim mnemonic.
Variant names follow Stim’s gate set. strum aliases map the common
synonyms (e.g. CNOT and ZCX both parse to GateType::CX, and R
renders/parses GateType::RZ).
Variants§
RX
X-basis reset.
RY
Y-basis reset.
RZ
Z-basis reset (R in Stim text).
XCX
X-controlled X.
XCY
X-controlled Y.
XCZ
X-controlled Z.
YCX
Y-controlled X.
YCY
Y-controlled Y.
YCZ
Y-controlled Z.
CX
Z-controlled X.
CY
Z-controlled Y.
CZ
Z-controlled Z.
H
Exchanges X and Z axes.
H_XY
Exchanges X and Y axes.
H_YZ
Exchanges Y and Z axes.
H_NXY
Negated X/Y-axis exchange.
H_NXZ
Negated X/Z-axis exchange.
H_NYZ
Negated Y/Z-axis exchange.
I
Identity.
X
Pauli X.
Y
Pauli Y.
Z
Pauli Z.
SQRT_X
Positive square root of X.
SQRT_X_DAG
Inverse square root of X.
SQRT_Y
Positive square root of Y.
SQRT_Y_DAG
Inverse square root of Y.
S
Positive square root of Z.
S_DAG
Inverse square root of Z.
C_XYZ
Cycles X to Y to Z.
C_ZYX
Cycles Z to Y to X.
C_NXYZ
Negated X/Y/Z cycle.
C_XNYZ
X/negated-Y/Z cycle.
C_XYNZ
X/Y/negated-Z cycle.
C_NZYX
Negated-X/Z/Y cycle.
C_ZNYX
Z/negated-Y/X cycle.
C_ZYNX
Z/Y/negated-X cycle.
T_YZ
Positive pi/4 rotation about X.
T_YZ_DAG
Negative pi/4 rotation about X.
T_XZ
Positive pi/4 rotation about Y.
T_XZ_DAG
Negative pi/4 rotation about Y.
T
Positive pi/4 rotation about Z.
T_DAG
Negative pi/4 rotation about Z.
Implementations§
Source§impl GateType
impl GateType
Sourcepub fn iter() -> impl Iterator<Item = GateType>
pub fn iter() -> impl Iterator<Item = GateType>
Iterates over every gate. Lets a caller sweep the whole gate set —
filtered by Self::is_reset, Self::is_non_clifford, and
Self::is_two_qubit_gate — without depending on strum itself.
Sourcepub const fn is_non_clifford(&self) -> bool
pub const fn is_non_clifford(&self) -> bool
Returns true for the non-Clifford T-family gates.
Sourcepub const fn is_two_qubit_gate(&self) -> bool
pub const fn is_two_qubit_gate(&self) -> bool
Returns true for the two-qubit unitary (controlled) gates.
Sourcepub const fn clifford_proxy(&self) -> GateType
pub const fn clifford_proxy(&self) -> GateType
Sourcepub const fn two_qubit_bases(&self) -> Option<(PauliBasis, PauliBasis)>
pub const fn two_qubit_bases(&self) -> Option<(PauliBasis, PauliBasis)>
For two-qubit gates in the ACB naming convention, returns the (control,
target) Pauli bases — CX (= ZCX) is Z-control, X-target. None for
non-two-qubit gates.
Trait Implementations§
impl Copy for GateType
Source§impl<'de> Deserialize<'de> for GateType
impl<'de> Deserialize<'de> for GateType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GateType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GateType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for GateType
Source§impl Ord for GateType
impl Ord for GateType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for GateType
impl PartialOrd for GateType
Source§impl Serialize for GateType
impl Serialize for GateType
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for GateType
Auto Trait Implementations§
impl Freeze for GateType
impl RefUnwindSafe for GateType
impl Send for GateType
impl Sync for GateType
impl Unpin for GateType
impl UnsafeUnpin for GateType
impl UnwindSafe for GateType
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.