[−][src]Struct qip::builders::ConditionalContextBuilder
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 with_condition(&mut self, r: Register) -> ConditionalContextBuilder
[src]
fn mat(
&mut self,
name: &str,
r: Register,
mat: Vec<Complex<f64>>
) -> Result<Register, CircuitError>
[src]
&mut self,
name: &str,
r: Register,
mat: Vec<Complex<f64>>
) -> Result<Register, CircuitError>
fn sparse_mat(
&mut self,
name: &str,
r: Register,
mat: Vec<Vec<(u64, Complex<f64>)>>,
natural_order: bool
) -> Result<Register, CircuitError>
[src]
&mut self,
name: &str,
r: Register,
mat: Vec<Vec<(u64, Complex<f64>)>>,
natural_order: bool
) -> Result<Register, CircuitError>
fn swap(
&mut self,
ra: Register,
rb: Register
) -> Result<(Register, Register), CircuitError>
[src]
&mut self,
ra: Register,
rb: Register
) -> Result<(Register, Register), CircuitError>
fn apply_function(
&mut self,
r_in: Register,
r_out: Register,
f: Box<dyn Fn(u64) -> (u64, f64) + Send + Sync>
) -> Result<(Register, Register), CircuitError>
[src]
&mut self,
r_in: Register,
r_out: Register,
f: Box<dyn Fn(u64) -> (u64, f64) + Send + Sync>
) -> Result<(Register, Register), CircuitError>
fn cx(&mut self, cr: Register, rb: Register) -> (Register, Register)
[src]
fn cy(&mut self, cr: Register, rb: Register) -> (Register, Register)
[src]
fn cz(&mut self, cr: Register, rb: Register) -> (Register, Register)
[src]
fn cnot(&mut self, cr: Register, rb: Register) -> (Register, Register)
[src]
fn cswap(
&mut self,
cr: Register,
ra: Register,
rb: Register
) -> Result<(Register, Register, Register), CircuitError>
[src]
&mut self,
cr: Register,
ra: Register,
rb: Register
) -> Result<(Register, Register, Register), CircuitError>
fn cmat(
&mut self,
name: &str,
cr: Register,
r: Register,
mat: Vec<Complex<f64>>
) -> Result<(Register, Register), CircuitError>
[src]
&mut self,
name: &str,
cr: Register,
r: Register,
mat: Vec<Complex<f64>>
) -> Result<(Register, Register), CircuitError>
fn crealmat(
&mut self,
name: &str,
cr: Register,
r: Register,
mat: &[f64]
) -> Result<(Register, Register), CircuitError>
[src]
&mut self,
name: &str,
cr: Register,
r: Register,
mat: &[f64]
) -> Result<(Register, Register), CircuitError>
fn split_absolute(
&mut self,
r: Register,
selected_indices: &[u64]
) -> Result<(Register, Register), CircuitError>
[src]
&mut self,
r: Register,
selected_indices: &[u64]
) -> Result<(Register, Register), CircuitError>
fn make_mat_op(
&self,
r: &Register,
data: Vec<Complex<f64>>
) -> Result<UnitaryOp, CircuitError>
[src]
&self,
r: &Register,
data: Vec<Complex<f64>>
) -> Result<UnitaryOp, CircuitError>
fn make_sparse_mat_op(
&self,
r: &Register,
data: Vec<Vec<(u64, Complex<f64>)>>,
natural_order: bool
) -> Result<UnitaryOp, CircuitError>
[src]
&self,
r: &Register,
data: Vec<Vec<(u64, Complex<f64>)>>,
natural_order: bool
) -> Result<UnitaryOp, CircuitError>
fn make_swap_op(
&self,
ra: &Register,
rb: &Register
) -> Result<UnitaryOp, CircuitError>
[src]
&self,
ra: &Register,
rb: &Register
) -> Result<UnitaryOp, CircuitError>
fn make_function_op(
&self,
r_in: &Register,
r_out: &Register,
f: Box<dyn Fn(u64) -> (u64, f64) + Send + Sync>
) -> Result<UnitaryOp, CircuitError>
[src]
&self,
r_in: &Register,
r_out: &Register,
f: Box<dyn Fn(u64) -> (u64, f64) + Send + Sync>
) -> Result<UnitaryOp, CircuitError>
fn merge_with_op(
&mut self,
rs: Vec<Register>,
named_operator: Option<(String, UnitaryOp)>
) -> Result<Register, CircuitError>
[src]
&mut self,
rs: Vec<Register>,
named_operator: Option<(String, UnitaryOp)>
) -> Result<Register, CircuitError>
fn stochastic_measure(&mut self, r: Register) -> (Register, u64)
[src]
fn sidechannel_helper(
&mut self,
rs: Vec<Register>,
handles: &[MeasurementHandle],
f: Box<dyn Fn(&mut dyn UnitaryBuilder, Register, &[u64]) -> Result<Vec<Register>, CircuitError>>
) -> Vec<Register>
[src]
&mut self,
rs: Vec<Register>,
handles: &[MeasurementHandle],
f: Box<dyn Fn(&mut dyn UnitaryBuilder, Register, &[u64]) -> Result<Vec<Register>, CircuitError>>
) -> Vec<Register>
fn real_mat(
&mut self,
name: &str,
r: Register,
mat: &[f64]
) -> Result<Register, CircuitError>
[src]
&mut self,
name: &str,
r: Register,
mat: &[f64]
) -> Result<Register, CircuitError>
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]
&mut self,
name: &str,
r: Register,
f: Box<dyn Fn(u64) -> Vec<(u64, Complex<f64>)>>,
natural_order: bool
) -> Result<Register, CircuitError>
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]
&mut self,
name: &str,
r: Register,
mat: &[Vec<(u64, f64)>],
natural_order: bool
) -> Result<Register, CircuitError>
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]
&mut self,
r: Register,
indices: &[u64]
) -> Result<(Register, Register), CircuitError>
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]
&mut self,
r: Register,
index_groups: &[Vec<u64>]
) -> Result<(Vec<Register>, Option<Register>), CircuitError>
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]
&mut self,
into: Register,
qubits: Vec<Register>,
at_indices: &[u64]
) -> Result<Register, CircuitError>
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]
&mut self,
into: Register,
qubit_and_index: Vec<(Register, u64)>
) -> Result<Register, CircuitError>
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]
&mut self,
r: Register,
handles: &[MeasurementHandle],
f: Box<dyn Fn(&mut dyn UnitaryBuilder, Register, &[u64]) -> Result<Register, CircuitError>>
) -> Register
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]
&mut self,
rs: Vec<Register>,
handles: &[MeasurementHandle],
f: Box<dyn Fn(&mut dyn UnitaryBuilder, Vec<Register>, &[u64]) -> Result<Vec<Register>, CircuitError>>
) -> Vec<Register>
Create a circuit portion which depends on the classical results of measuring some Registers.
impl<'a> Debug for ConditionalContextBuilder<'a>
[src]
Auto Trait Implementations
impl<'a> !Sync for ConditionalContextBuilder<'a>
impl<'a> !Send for ConditionalContextBuilder<'a>
impl<'a> Unpin for ConditionalContextBuilder<'a>
impl<'a> !UnwindSafe for ConditionalContextBuilder<'a>
impl<'a> !RefUnwindSafe for ConditionalContextBuilder<'a>
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,