[][src]Struct qip::qubit_chainer::VecRegisterChain

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

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

Methods

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

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

Make a new VecRegisterChain, prefer to use chain_vec.

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

Release the contained vec of Registers.

pub fn rs(self) -> Vec<Register>[src]

Release the contained vec of Registers.

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

Merge the contained vec of Registers into a single Register.

pub fn partition_by_relative(
    self,
    f: impl Fn(u64) -> bool
) -> Result<DoubleRegisterChain<'a, B>, CircuitError>
[src]

Partition the contained Registers into two groups by their index in the underlying vector. Merge each group into a Register and produce a chained struct for the tuple.

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

Flatten the Registers: make a chain struct representing the vec of all single-index Registers which can be made from the current set of owned indices. Acts as flatten would on a vec of vec of indices.

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

Apply a function which outputs a single Register.

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

Apply a function which outputs a tuple of Registers.

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

Apply a function which outputs a vector of Registers.

Trait Implementations

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

Auto Trait Implementations

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

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

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

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

impl<'a, B> !UnwindSafe for VecRegisterChain<'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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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