[][src]Struct qip::builders::ConditionalContextBuilder

pub struct ConditionalContextBuilder<'a> { /* fields omitted */ }

An op builder which depends on the value of a given Register (COPs)

Methods

impl<'a> ConditionalContextBuilder<'a>[src]

pub fn release_register(self) -> Register[src]

Release the Register used to build this builder

Trait Implementations

impl<'a> UnitaryBuilder for ConditionalContextBuilder<'a>[src]

fn real_mat(
    &mut self,
    name: &str,
    r: Register,
    mat: &[f64]
) -> Result<Register, CircuitError>
[src]

Build a matrix op from real numbers, apply to r, if r is multiple indices and mat is 2x2, apply to each index, otherwise returns an error if the matrix is not the correct size for the number of indices in r (mat.len() == 2^(2n)). Read more

fn sparse_mat_from_fn(
    &mut self,
    name: &str,
    r: Register,
    f: Box<dyn Fn(u64) -> Vec<(u64, Complex<f64>)>>,
    natural_order: bool
) -> Result<Register, CircuitError>
[src]

Build a sparse matrix op from f, apply to r, if r is multiple indices and mat is 2x2, apply to each index, otherwise returns an error if the matrix is not the correct size for the number of indices in r (mat.len() == 2^n). Read more

fn real_sparse_mat(
    &mut self,
    name: &str,
    r: Register,
    mat: &[Vec<(u64, f64)>],
    natural_order: bool
) -> Result<Register, CircuitError>
[src]

Build a sparse matrix op from real numbers, apply to r, if r is multiple indices and mat is 2x2, apply to each index, otherwise returns an error if the matrix is not the correct size for the number of indices in r (mat.len() == 2^n). Read more

fn not(&mut self, r: Register) -> Register[src]

Apply NOT to r, if r is multiple indices, apply to each

fn x(&mut self, r: Register) -> Register[src]

Apply X to r, if r is multiple indices, apply to each

fn y(&mut self, r: Register) -> Register[src]

Apply Y to r, if r is multiple indices, apply to each

fn z(&mut self, r: Register) -> Register[src]

Apply Z to r, if r is multiple indices, apply to each

fn hadamard(&mut self, r: Register) -> Register[src]

Apply H to r, if r is multiple indices, apply to each

fn phase(&mut self, r: Register, theta: f64) -> Register[src]

Transforms |psi> to e^{i*theta}|psi>

fn merge(&mut self, rs: Vec<Register>) -> Result<Register, CircuitError>[src]

Merge the Registers in rs into a single Register.

fn split(
    &mut self,
    r: Register,
    indices: &[u64]
) -> Result<(Register, Register), CircuitError>
[src]

Split the Register r into two Registers, one with relative indices and one with the remaining.

fn split_absolute_many(
    &mut self,
    r: Register,
    index_groups: &[Vec<u64>]
) -> Result<(Vec<Register>, Option<Register>), CircuitError>
[src]

Split the Register into many Registers, each with the given set of indices.

fn split_all(&mut self, r: Register) -> Vec<Register>[src]

Split r into a single Register for each index.

fn merge_with_indices(
    &mut self,
    into: Register,
    qubits: Vec<Register>,
    at_indices: &[u64]
) -> Result<Register, CircuitError>
[src]

Merge a set of qubits into a given qubit at a set of indices

fn merge_with(
    &mut self,
    into: Register,
    qubit_and_index: Vec<(Register, u64)>
) -> Result<Register, CircuitError>
[src]

Merge a set of qubits into a given qubit at a set of indices

fn single_register_classical_sidechannel(
    &mut self,
    r: Register,
    handles: &[MeasurementHandle],
    f: Box<dyn Fn(&mut dyn UnitaryBuilder, Register, &[u64]) -> Result<Register, CircuitError>>
) -> Register
[src]

Create a circuit portion which depends on the classical results of measuring some Registers.

fn classical_sidechannel(
    &mut self,
    rs: Vec<Register>,
    handles: &[MeasurementHandle],
    f: Box<dyn Fn(&mut dyn UnitaryBuilder, Vec<Register>, &[u64]) -> Result<Vec<Register>, CircuitError>>
) -> Vec<Register>
[src]

Create a circuit portion which depends on the classical results of measuring some Registers.

impl<'a> Debug for ConditionalContextBuilder<'a>[src]

Auto Trait Implementations

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]