[][src]Struct qip::qubit_chainer::DoubleQubitChain

pub struct DoubleQubitChain<'a, B: UnitaryBuilder> { /* fields omitted */ }

Chaining struct for a pair of qubits (each may have multiple indices)

Methods

impl<'a, B: UnitaryBuilder> DoubleQubitChain<'a, B>[src]

pub fn new(builder: &'a mut B, qa: Qubit, qb: Qubit) -> Self[src]

Make a new DoubleQubitChain, prefer to use chain_tuple.

pub fn release(self) -> (Qubit, Qubit)[src]

Release the contained qubit tuple

pub fn qab(self) -> (Qubit, Qubit)[src]

Release the contained qubit tuple

pub fn merge(self) -> SingleQubitChain<'a, B>[src]

Merge the contained qubit tuple into a single qubit, wrap in a chaining struct.

pub fn split_all(self) -> VecQubitChain<'a, B>[src]

Split all the indices for each qubit into their own qubits, returned the chained struct for the vec of qubits.

pub fn swap(self) -> Result<Self, &'static str>[src]

Apply a swap op to the contained qubits, will only succeed of the qubits are of equal size.

pub fn physical_swap(self) -> Self[src]

Swap the positions of the contained qubits. This is not a quantum operation, rather a a bookkeeping one.

pub fn apply_function_op(
    self,
    f: impl Fn(u64) -> (u64, f64) + Send + Sync + 'static
) -> Result<Self, &'static str>
[src]

Apply a function operation to the contained qubits, the first will act as the readin register and the second as the output.

pub fn apply_boxed_function_op(
    self,
    f: Box<dyn Fn(u64) -> (u64, f64) + Send + Sync>
) -> Result<Self, &'static str>
[src]

Apply a function op which has been already boxed.

pub fn apply_merge(
    self,
    f: impl FnOnce(&mut B, Qubit, Qubit) -> Qubit
) -> SingleQubitChain<'a, B>
[src]

Apply a function which outputs a single qubit.

pub fn apply(
    self,
    f: impl FnOnce(&mut B, Qubit, Qubit) -> (Qubit, Qubit)
) -> Self
[src]

Apply a function which outputs a tuple of qubits.

pub fn apply_split(
    self,
    f: impl FnOnce(&mut B, Qubit, Qubit) -> Vec<Qubit>
) -> VecQubitChain<'a, B>
[src]

Apply a function which outputs a vector of qubits.

Auto Trait Implementations

impl<'a, B> Unpin for DoubleQubitChain<'a, B>

impl<'a, B> !Sync for DoubleQubitChain<'a, B>

impl<'a, B> !Send for DoubleQubitChain<'a, B>

impl<'a, B> !RefUnwindSafe for DoubleQubitChain<'a, B>

impl<'a, B> !UnwindSafe for DoubleQubitChain<'a, B>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]