[−][src]Struct qip::qubit_chainer::VecRegisterChain
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]
self,
f: impl Fn(u64) -> bool
) -> Result<DoubleRegisterChain<'a, B>, CircuitError>
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]
self,
f: impl FnOnce(&mut B, Vec<Register>) -> Register
) -> SingleRegisterChain<'a, B>
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]
self,
f: impl FnOnce(&mut B, Vec<Register>) -> (Register, Register)
) -> DoubleRegisterChain<'a, B>
Apply a function which outputs a tuple of Registers.
pub fn apply(
self,
f: impl FnOnce(&mut B, Vec<Register>) -> Vec<Register>
) -> Self
[src]
self,
f: impl FnOnce(&mut B, Vec<Register>) -> Vec<Register>
) -> Self
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> !Sync for VecRegisterChain<'a, B>
impl<'a, B> !Send for VecRegisterChain<'a, B>
impl<'a, B> Unpin for VecRegisterChain<'a, B>
impl<'a, B> !UnwindSafe for VecRegisterChain<'a, B>
impl<'a, B> !RefUnwindSafe 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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,