pub struct IdentityChannel { /* private fields */ }Expand description
A channel that maps every input Pauli to itself with the same coefficient.
support() is empty, so the engine’s bucket layout collapses to a single
bucket and the only effect is to copy the input through. max_fanout()
is 1.
Implementations§
Trait Implementations§
Source§impl<const W: usize> Channel<W> for IdentityChannel
impl<const W: usize> Channel<W> for IdentityChannel
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 IdentityChannel
impl Clone for IdentityChannel
Source§fn clone(&self) -> IdentityChannel
fn clone(&self) -> IdentityChannel
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 IdentityChannel
impl Debug for IdentityChannel
Source§impl Default for IdentityChannel
impl Default for IdentityChannel
Source§fn default() -> IdentityChannel
fn default() -> IdentityChannel
Returns the “default value” for a type. Read more
impl Copy for IdentityChannel
Auto Trait Implementations§
impl Freeze for IdentityChannel
impl RefUnwindSafe for IdentityChannel
impl Send for IdentityChannel
impl Sync for IdentityChannel
impl Unpin for IdentityChannel
impl UnwindSafe for IdentityChannel
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