Skip to content

ppvm_traits::char

char

ppvm_traits::char

classPaulisource

ppvm_traits::char::Pauli

Bases: Debug, Clone, Copy, StructuralPartialEq, PartialEq, Eq, Display

Rust enum. A single-qubit Pauli symbol.

pub enum Pauli

Variants

NameTypeDescription
I—Identity `I`.
X—Pauli `X`.
Z—Pauli `Z`.
Y—Pauli `Y`.
L—Loss marker — the qubit has been lost and no longer participates.

The four standard Paulis are encoded so that the low two bits identify the operator (`I = 0b00`, `X = 0b01`, `Z = 0b10`, `Y = 0b11`), which is the same encoding stabilizer-formalism tools commonly use. The extra variant Pauli::L marks a qubit as lost, used by the loss-aware portions of the runtime.

``` use ppvm_traits::char::Pauli;

assert_eq!(Pauli::I.to_string(), “I”); assert_eq!(Pauli::X.to_string(), “X”); assert_eq!(Pauli::Y.to_string(), “Y”); assert_eq!(Pauli::Z.to_string(), “Z”); assert_eq!(Pauli::L.to_string(), “L”); ```

source