pub struct Circuit<const W: usize> { /* private fields */ }Expand description
An ordered list of channels on num_qubits qubits, user-defined crate::Channel impls included.
crate::Direction::Forward applies it in order, crate::Direction::Heisenberg in reverse with each channel’s adjoint.
Implementations§
Source§impl<const W: usize> Circuit<W>
impl<const W: usize> Circuit<W>
Sourcepub fn push<C: Channel<W> + 'static>(&mut self, channel: C)
pub fn push<C: Channel<W> + 'static>(&mut self, channel: C)
Append a channel to the circuit.
§Panics
If the channel’s support reaches a qubit at or above num_qubits.
Sourcepub fn push_boxed(&mut self, channel: Box<dyn Channel<W>>)
pub fn push_boxed(&mut self, channel: Box<dyn Channel<W>>)
Append an already boxed channel, as push does.
§Panics
If the channel’s support reaches a qubit at or above num_qubits.
Sourcepub fn num_qubits(&self) -> usize
pub fn num_qubits(&self) -> usize
Number of qubits this circuit acts on.
Auto Trait Implementations§
impl<const W: usize> Freeze for Circuit<W>
impl<const W: usize> !RefUnwindSafe for Circuit<W>
impl<const W: usize> Send for Circuit<W>
impl<const W: usize> Sync for Circuit<W>
impl<const W: usize> Unpin for Circuit<W>
impl<const W: usize> !UnwindSafe for Circuit<W>
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