[−][src]Struct qip::qubit_chainer::VecQubitChain
Chaining struct for a vector of qubits (each may have multiple indices)
Methods
impl<'a, B: UnitaryBuilder> VecQubitChain<'a, B>
[src]
pub fn new(builder: &'a mut B, qs: Vec<Qubit>) -> Self
[src]
Make a new VecQubitChain
, prefer to use chain_vec
.
pub fn release(self) -> Vec<Qubit>
[src]
Release the contained vec of qubits.
pub fn qs(self) -> Vec<Qubit>
[src]
Release the contained vec of qubits.
pub fn merge(self) -> SingleQubitChain<'a, B>
[src]
Merge the contained vec of qubits into a single qubit.
pub fn partition_by_relative(
self,
f: impl Fn(u64) -> bool
) -> Result<DoubleQubitChain<'a, B>, &'static str>
[src]
self,
f: impl Fn(u64) -> bool
) -> Result<DoubleQubitChain<'a, B>, &'static str>
Partition the contained qubits into two groups by their index in the underlying vector. Merge each group into a qubit and produce a chained struct for the tuple.
pub fn flatten(self) -> Self
[src]
Flatten the qubits: make a chain struct representing the vec of all single-index qubits 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<Qubit>) -> Qubit
) -> SingleQubitChain<'a, B>
[src]
self,
f: impl FnOnce(&mut B, Vec<Qubit>) -> Qubit
) -> SingleQubitChain<'a, B>
Apply a function which outputs a single qubit.
pub fn apply_partition(
self,
f: impl FnOnce(&mut B, Vec<Qubit>) -> (Qubit, Qubit)
) -> DoubleQubitChain<'a, B>
[src]
self,
f: impl FnOnce(&mut B, Vec<Qubit>) -> (Qubit, Qubit)
) -> DoubleQubitChain<'a, B>
Apply a function which outputs a tuple of qubits.
pub fn apply(self, f: impl FnOnce(&mut B, Vec<Qubit>) -> Vec<Qubit>) -> Self
[src]
Apply a function which outputs a vector of qubits.
Trait Implementations
impl<'a, B: Debug + UnitaryBuilder> Debug for VecQubitChain<'a, B>
[src]
Auto Trait Implementations
impl<'a, B> !Sync for VecQubitChain<'a, B>
impl<'a, B> !Send for VecQubitChain<'a, B>
impl<'a, B> Unpin for VecQubitChain<'a, B>
impl<'a, B> !RefUnwindSafe for VecQubitChain<'a, B>
impl<'a, B> !UnwindSafe for VecQubitChain<'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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,