Skip to main content

OpsVec

Struct OpsVec 

Source
pub struct OpsVec<L: Layer + ?Sized> { /* private fields */ }

Implementations§

Source§

impl<L> OpsVec<L>
where L: Layer + ?Sized,

Source

pub fn new() -> Self

Source

pub fn from_vec(v: Vec<L::Operation>) -> Self

Source

pub fn into_vec(self) -> Vec<L::Operation>

Source

pub fn as_slice(&self) -> &[L::Operation]

Source

pub fn as_mut_slice(&mut self) -> &mut [L::Operation]

Source

pub fn as_vec(&self) -> &Vec<L::Operation>

Source

pub fn as_mut_vec(&mut self) -> &mut Vec<L::Operation>

Source

pub fn len(&self) -> usize

Source

pub fn iter(&self) -> impl Iterator<Item = &L::Operation>

Source

pub fn clear(&mut self)

Source§

impl<L> OpsVec<L>
where L: Layer + ?Sized, L::Operation: Operation<L>,

Source

pub fn initialize(&mut self)

Source

pub fn measure(&mut self, q: L::Qubit, s: L::Slot)

Source§

impl<L> OpsVec<L>

Source

pub fn x(&mut self, q: <L as Layer>::Qubit)

Source

pub fn y(&mut self, q: <L as Layer>::Qubit)

Source

pub fn z(&mut self, q: <L as Layer>::Qubit)

Source§

impl<L> OpsVec<L>
where L: Layer + HGate + ?Sized, L::Operation: HOperation<L>,

Source

pub fn h(&mut self, q: <L as Layer>::Qubit)

Source§

impl<L> OpsVec<L>
where L: Layer + SGate + ?Sized, L::Operation: SOperation<L>,

Source

pub fn s(&mut self, q: <L as Layer>::Qubit)
where L: SGate,

Source

pub fn sdg(&mut self, q: <L as Layer>::Qubit)
where L: SGate,

Source§

impl<L> OpsVec<L>
where L: Layer + TGate + ?Sized, L::Operation: TOperation<L>,

Source

pub fn t(&mut self, q: <L as Layer>::Qubit)
where L: TGate,

Source

pub fn tdg(&mut self, q: <L as Layer>::Qubit)
where L: TGate,

Source§

impl<L> OpsVec<L>
where L: Layer + CXGate + ?Sized, L::Operation: CXOperation<L>,

Source

pub fn cx(&mut self, c: <L as Layer>::Qubit, t: <L as Layer>::Qubit)
where L: CXGate,

Trait Implementations§

Source§

impl<L: Layer + ?Sized> AsMut<[<L as Layer>::Operation]> for OpsVec<L>

Source§

fn as_mut(&mut self) -> &mut [L::Operation]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<L: Layer + ?Sized> AsRef<[<L as Layer>::Operation]> for OpsVec<L>

Source§

fn as_ref(&self) -> &[L::Operation]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<L: Debug + Layer + ?Sized> Debug for OpsVec<L>
where L::Operation: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<L> Freeze for OpsVec<L>
where Vec<<L as Layer>::Operation>: Freeze, L: ?Sized,

§

impl<L> RefUnwindSafe for OpsVec<L>
where Vec<<L as Layer>::Operation>: RefUnwindSafe, L: ?Sized,

§

impl<L> Send for OpsVec<L>
where Vec<<L as Layer>::Operation>: Send, L: ?Sized,

§

impl<L> Sync for OpsVec<L>
where Vec<<L as Layer>::Operation>: Sync, L: ?Sized,

§

impl<L> Unpin for OpsVec<L>
where Vec<<L as Layer>::Operation>: Unpin, L: ?Sized,

§

impl<L> UnsafeUnpin for OpsVec<L>
where Vec<<L as Layer>::Operation>: UnsafeUnpin, L: ?Sized,

§

impl<L> UnwindSafe for OpsVec<L>
where Vec<<L as Layer>::Operation>: UnwindSafe, L: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.