[−][src]Struct qip::pipeline::LocalQuantumState
A basic representation of a quantum state, given by a vector of complex numbers stored locally on the machine (plus an arena of equal size to work in).
Fields
n: u64
state: Vec<Complex<P>>
Methods
impl<P: Precision> LocalQuantumState<P>
[src]
pub fn new_from_full_state(
n: u64,
state: Vec<Complex<P>>,
natural_order: bool,
multithread: bool
) -> Result<LocalQuantumState<P>, &'static str>
[src]
n: u64,
state: Vec<Complex<P>>,
natural_order: bool,
multithread: bool
) -> Result<LocalQuantumState<P>, &'static str>
pub fn clone_state(&mut self, natural_order: bool) -> Vec<Complex<P>>
[src]
Clone the state in either the natural_order
or the internal order.
pub fn rotate_basis(&mut self, indices: &[u64], angle: f64)
[src]
Rotate to a new computational basis:
|0'> = cos(angle)|0> + sin(angle)|1>
|1'> = -sin(angle)|0> + cos(angle)|1>
pub fn set_multithreading(&mut self, multithread: bool)
[src]
Trait Implementations
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)
fn state_magnitude(&self) -> P
[src]
fn stochastic_measure(&mut self, indices: &[u64], angle: f64) -> Vec<P>
[src]
fn get_state(self, natural_order: bool) -> Vec<Complex<P>>
[src]
fn apply_op(&mut self, op: &QubitOp)
[src]
Function to mutate self into the state with op applied.
impl<P: Precision> Clone for LocalQuantumState<P>
[src]
Auto Trait Implementations
impl<P> Sync for LocalQuantumState<P>
impl<P> Send for LocalQuantumState<P>
impl<P> Unpin for LocalQuantumState<P> where
P: Unpin,
P: Unpin,
impl<P> RefUnwindSafe for LocalQuantumState<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> UnwindSafe for LocalQuantumState<P> where
P: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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,