pub struct GeneralUnitary1Q {
pub support: [u32; 1],
pub table: [[Complex64; 4]; 4],
}Expand description
Generic 1-qubit unitary, stored as the Pauli expansion of its
Heisenberg-picture action on {I, X, Y, Z} at the support qubit.
MAX_FANOUT = 4 since each input Pauli on the support can map to a sum
over all four basis Paulis.
Fields§
§support: [u32; 1]The single qubit this gate acts on.
table: [[Complex64; 4]; 4]4x4 table: rows indexed by input Pauli (I, X, Z, Y in symplectic
order), columns by output Pauli, entries are complex coefficients.
Trait Implementations§
Source§impl Channel<1> for GeneralUnitary1Q
impl Channel<1> for GeneralUnitary1Q
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; 1],
_input_z: &[u64; 1],
_coeff: Complex64,
_out: &mut OutputBuffer<'_, 1>,
)
fn apply( &self, _input_x: &[u64; 1], _input_z: &[u64; 1], _coeff: Complex64, _out: &mut OutputBuffer<'_, 1>, )
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 moreAuto Trait Implementations§
impl Freeze for GeneralUnitary1Q
impl RefUnwindSafe for GeneralUnitary1Q
impl Send for GeneralUnitary1Q
impl Sync for GeneralUnitary1Q
impl Unpin for GeneralUnitary1Q
impl UnwindSafe for GeneralUnitary1Q
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> 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