Enum Gate1Q
pub enum Gate1Q {
Show 23 variants
X,
Y,
Z,
H,
S,
SDag,
SqrtX,
SqrtXDag,
SqrtY,
SqrtYDag,
Hxy,
Hyz,
Hnxy,
Hnxz,
Hnyz,
Cxyz,
Czyx,
Cnxyz,
Cxnyz,
Cxynz,
Cnzyx,
Cznyx,
Czynx,
}Expand description
A named single-qubit Clifford, identified by the signed Pauli images
(X → …, Z → …) of Gate1Q::images.
The names and the tableaux are stim’s. Variants that stim spells with
underscores and negation markers (H_XY, C_NZYX) are spelled here in
camel case with the same letters in the same order (Hxy, Cnzyx).
Variants§
X
X → +X, Z → −Z.
Y
X → −X, Z → −Z.
Z
X → −X, Z → +Z.
H
Hadamard: X → +Z, Z → +X.
S
Phase gate S = √Z: X → +Y, Z → +Z.
SDag
S† = √Z†: X → −Y, Z → +Z.
SqrtX
√X: X → +X, Z → −Y.
SqrtXDag
√X†: X → +X, Z → +Y.
SqrtY
√Y: X → −Z, Z → +X.
SqrtYDag
√Y†: X → +Z, Z → −X.
Hxy
H_XY: X → +Y, Z → −Z.
Hyz
H_YZ: X → −X, Z → +Y.
Hnxy
H_NXY: X → −Y, Z → −Z.
Hnxz
H_NXZ: X → −Z, Z → −X.
Hnyz
H_NYZ: X → −X, Z → −Y.
Cxyz
C_XYZ, the order-three cycle X → Y → Z → X.
Czyx
C_ZYX, the inverse cycle X → Z → Y → X.
Cnxyz
C_NXYZ: X → −Y, Z → −X.
Cxnyz
C_XNYZ: X → −Y, Z → +X.
Cxynz
C_XYNZ: X → +Y, Z → −X.
Cnzyx
C_NZYX: X → −Z, Z → −Y.
Cznyx
C_ZNYX: X → +Z, Z → −Y.
Czynx
C_ZYNX: X → −Z, Z → +Y.
Implementations§
§impl Gate1Q
impl Gate1Q
pub const fn images(self) -> ((PauliBasis, bool), (PauliBasis, bool))
pub const fn images(self) -> ((PauliBasis, bool), (PauliBasis, bool))
The gate’s signed Pauli tableau as (X → image, Z → image), each image
an axis and whether it is negated.
This is the gate’s definition: TableauSimulator::gate1 realizes each
variant as a composition of primitive frame updates, and the pairing of
composition to tableau is what the unit tests pin.
§Examples
use ticit::PauliBasis;
use ticit::Gate1Q;
// The Hadamard exchanges X and Z without a sign.
assert_eq!(
Gate1Q::H.images(),
((PauliBasis::Z, false), (PauliBasis::X, false))
);Trait Implementations§
impl Copy for Gate1Q
impl Eq for Gate1Q
impl StructuralPartialEq for Gate1Q
Auto Trait Implementations§
impl Freeze for Gate1Q
impl RefUnwindSafe for Gate1Q
impl Send for Gate1Q
impl Sync for Gate1Q
impl Unpin for Gate1Q
impl UnsafeUnpin for Gate1Q
impl UnwindSafe for Gate1Q
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> 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.