pub struct Clifford1Q {
pub support: [u32; 1],
pub out_pauli: [u8; 4],
pub phase: [Phase; 4],
}Expand description
Single-qubit Clifford gate stored as a 4-entry conjugation table.
out_pauli[i] and phase[i] give the result of G · P_i · G† for the
four input Paulis (indexed as above): the new packed Pauli on the
support qubit and the i^k phase to fold into the coefficient.
Generic over W so the same gate value can act on any Pauli width.
Fields§
§support: [u32; 1]Single qubit this gate acts on. Held as [u32; 1] so support()
returns a slice without allocation.
out_pauli: [u8; 4]Output Pauli bits per input Pauli. Same packing as the index:
(out_x | (out_z << 1)). out_pauli[0] is always 0 (I → I).
phase: [Phase; 4]Phase factor (i^k) per input Pauli. phase[0] is always
Phase::ONE.
Implementations§
Trait Implementations§
Source§impl<const W: usize> Channel<W> for Clifford1Q
impl<const W: usize> Channel<W> for Clifford1Q
Source§fn max_fanout(&self) -> usize
fn max_fanout(&self) -> usize
Maximum number of output terms produced per input term. Used by the
engine to size the scratch buffer up-front.
Source§fn support(&self) -> &[u32]
fn support(&self) -> &[u32]
Qubits this channel acts on. Outputs differ from inputs only at these
bit positions; the engine uses this for bucket layout (§5).
Source§fn apply(
&self,
input_x: &[u64; W],
input_z: &[u64; W],
coeff: Complex64,
out: &mut OutputBuffer<'_, W>,
)
fn apply( &self, input_x: &[u64; W], input_z: &[u64; W], coeff: Complex64, out: &mut OutputBuffer<'_, W>, )
Apply the channel to a single input term, writing outputs to
out.Source§fn apply_adjoint(
&self,
input_x: &[u64; W],
input_z: &[u64; W],
coeff: Complex64,
out: &mut OutputBuffer<'_, W>,
)
fn apply_adjoint( &self, input_x: &[u64; W], input_z: &[u64; W], coeff: Complex64, out: &mut OutputBuffer<'_, W>, )
Apply the channel’s adjoint to a single input term, writing outputs
to
out. Used by the engine in Direction::Heisenberg mode for
backpropagating observables. Read moreSource§impl Clone for Clifford1Q
impl Clone for Clifford1Q
Source§fn clone(&self) -> Clifford1Q
fn clone(&self) -> Clifford1Q
Returns a duplicate of the value. Read more
1.0.0 · 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 Clifford1Q
impl Debug for Clifford1Q
impl Copy for Clifford1Q
Auto Trait Implementations§
impl Freeze for Clifford1Q
impl RefUnwindSafe for Clifford1Q
impl Send for Clifford1Q
impl Sync for Clifford1Q
impl Unpin for Clifford1Q
impl UnwindSafe for Clifford1Q
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
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>
Converts
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>
Converts
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 more