[][src]Struct qip::qubit_chainer::DoubleRegisterChain

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

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

Methods

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

pub fn new(builder: &'a mut B, ra: Register, rb: Register) -> Self[src]

Make a new DoubleRegisterChain, prefer to use chain_tuple.

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

Release the contained Register tuple

pub fn rab(self) -> (Register, Register)[src]

Release the contained Register tuple

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

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

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

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

pub fn swap(self) -> Result<Self, CircuitError>[src]

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

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

Swap the positions of the contained Registers. 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, CircuitError>
[src]

Apply a function operation to the contained Registers, 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, CircuitError>
[src]

Apply a function op which has been already boxed.

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

Apply a function which outputs a single Register.

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

Apply a function which outputs a tuple of Registers.

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

Apply a function which outputs a vector of Registers.

Trait Implementations

impl<'a, B: Debug + UnitaryBuilder> Debug for DoubleRegisterChain<'a, B>[src]

Auto Trait Implementations

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

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

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

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

impl<'a, B> !UnwindSafe for DoubleRegisterChain<'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]