[−][src]Trait qip::pipeline::QuantumState
A trait which represents the state of the qubits
Required methods
fn new(n: u64) -> Self
Make new state with n qubits
fn new_from_initial_states(n: u64, states: &[QubitInitialState<P>]) -> Self
Initialize new state with initial states.
fn n(&self) -> u64
Get number of qubits represented by this state.
fn apply_op_with_name(&mut self, name: Option<&str>, op: &QubitOp)
Apply op with a given name. Mutate self using op.
fn measure(
&mut self,
indices: &[u64],
measured: Option<MeasuredCondition<P>>,
angle: f64
) -> (u64, P)
&mut self,
indices: &[u64],
measured: Option<MeasuredCondition<P>>,
angle: f64
) -> (u64, P)
Mutate self with measurement, return result as index and probability
fn soft_measure(
&mut self,
indices: &[u64],
measured: Option<u64>,
angle: f64
) -> (u64, P)
&mut self,
indices: &[u64],
measured: Option<u64>,
angle: f64
) -> (u64, P)
Perform calculations of measure
without mutating result. Returns a possible measured value
and associated probability.
fn state_magnitude(&self) -> P
Give the total magnitude represented by this state. Most often 1.0
fn stochastic_measure(&mut self, indices: &[u64], angle: f64) -> Vec<P>
Measure stochastically, do not alter internal state. Returns a vector of size 2^indices.len()
fn get_state(self, natural_order: bool) -> Vec<Complex<P>>
Consume the QuantumState object and return the state as a vector of complex numbers.
natural_order
means that qubit with index 0 is the least significant index bit, otherwise
it's the largest.
Provided methods
Loading content...Implementors
impl<P: Precision> QuantumState<P> for LocalQuantumState<P>
[src]
fn new(n: u64) -> LocalQuantumState<P>
[src]
Build a new LocalQuantumState
fn new_from_initial_states(
n: u64,
states: &[QubitInitialState<P>]
) -> LocalQuantumState<P>
[src]
n: u64,
states: &[QubitInitialState<P>]
) -> LocalQuantumState<P>
Build a local state using a set of initial states for subsets of the qubits. These initial states are made from the qubit handles.
fn n(&self) -> u64
[src]
fn apply_op_with_name(&mut self, _name: Option<&str>, op: &QubitOp)
[src]
fn measure(
&mut self,
indices: &[u64],
measured: Option<MeasuredCondition<P>>,
angle: f64
) -> (u64, P)
[src]
&mut self,
indices: &[u64],
measured: Option<MeasuredCondition<P>>,
angle: f64
) -> (u64, P)
fn soft_measure(
&mut self,
indices: &[u64],
measured: Option<u64>,
angle: f64
) -> (u64, P)
[src]
&mut self,
indices: &[u64],
measured: Option<u64>,
angle: f64
) -> (u64, P)