pub struct Clifford2Q {
pub support: [u32; 2],
pub out_pauli: [u8; 16],
pub phase: [Phase; 16],
}Expand description
Two-qubit Clifford gate stored as a 16-entry conjugation table.
Index encoding: low 2 bits select the input Pauli on support[0],
high 2 bits select it on support[1]. Each out_pauli[i] packs four
bits (ox0 | (oz0 << 1) | (ox1 << 2) | (oz1 << 3)).
Fields§
§support: [u32; 2]The two qubits this gate acts on. Convention: support[0] is the
“first” qubit (e.g. CNOT control), support[1] the second.
out_pauli: [u8; 16]Output Pauli bits per input. 16 entries indexed by
(x0 | (z0 << 1) | (x1 << 2) | (z1 << 3)); each entry packs the
output bits in the same layout. out_pauli[0] is always 0.
phase: [Phase; 16]Phase factor (i^k) per input. phase[0] is always Phase::ONE.
Implementations§
Source§impl Clifford2Q
impl Clifford2Q
Sourcepub fn cnot(control: u32, target: u32) -> Self
pub fn cnot(control: u32, target: u32) -> Self
CNOT with control and target. Conjugation generators:
X⊗I → X⊗X, I⊗X → I⊗X, Z⊗I → Z⊗I, I⊗Z → Z⊗Z (all phase +1).
The full 16-entry table follows by linearity over Pauli products.
Trait Implementations§
Source§impl<const W: usize> Channel<W> for Clifford2Q
impl<const W: usize> Channel<W> for Clifford2Q
Source§fn max_fanout(&self) -> usize
fn max_fanout(&self) -> usize
Source§fn support(&self) -> &[u32]
fn support(&self) -> &[u32]
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>, )
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>, )
out. Used by the engine in Direction::Heisenberg mode for
backpropagating observables. Read moreSource§impl Clone for Clifford2Q
impl Clone for Clifford2Q
Source§fn clone(&self) -> Clifford2Q
fn clone(&self) -> Clifford2Q
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Clifford2Q
impl Debug for Clifford2Q
impl Copy for Clifford2Q
Auto Trait Implementations§
impl Freeze for Clifford2Q
impl RefUnwindSafe for Clifford2Q
impl Send for Clifford2Q
impl Sync for Clifford2Q
impl Unpin for Clifford2Q
impl UnwindSafe for Clifford2Q
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 more