[−][src]Struct qip::qubit_chainer::DoubleQubitChain
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]
self,
f: impl Fn(u64) -> (u64, f64) + Send + Sync + 'static
) -> Result<Self, &'static str>
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]
self,
f: Box<dyn Fn(u64) -> (u64, f64) + Send + Sync>
) -> Result<Self, &'static str>
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]
self,
f: impl FnOnce(&mut B, Qubit, Qubit) -> Qubit
) -> SingleQubitChain<'a, B>
Apply a function which outputs a single qubit.
pub fn apply(
self,
f: impl FnOnce(&mut B, Qubit, Qubit) -> (Qubit, Qubit)
) -> Self
[src]
self,
f: impl FnOnce(&mut B, Qubit, Qubit) -> (Qubit, Qubit)
) -> Self
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]
self,
f: impl FnOnce(&mut B, Qubit, Qubit) -> Vec<Qubit>
) -> VecQubitChain<'a, B>
Apply a function which outputs a vector of qubits.
Trait Implementations
impl<'a, B: Debug + UnitaryBuilder> Debug for DoubleQubitChain<'a, B>
[src]
Auto Trait Implementations
impl<'a, B> !Sync for DoubleQubitChain<'a, B>
impl<'a, B> !Send for DoubleQubitChain<'a, B>
impl<'a, B> Unpin 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]
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,