[][src]Struct q1tsim::vectorstate::VectorState

pub struct VectorState { /* fields omitted */ }

Quantum state.

Struct Vectorstate represents the quantum experiment. It consists of a series of quantum states, combined with the number of times this state occurs in the experiment. Each quantum state is a (normalized) superposition of basis states, ∑iai|i⟩, where each basis function |i⟩ is a Kronecker product of quantum bits, and is represented by the coefficient vector a.

Methods

impl VectorState[src]

pub fn new(nr_bits: usize, nr_shots: usize) -> Self[src]

Create a new quantum state of nr_bits qubits, all initialized to |0⟩, which will be measured nr_shots times.

pub fn from_qubit_coefs(bit_coefs: &[Complex64], nr_shots: usize) -> Self[src]

Create a new quantum state from qubit coefficients.

Create a new quantum state as a direct product of qubits, where the coefficients of the |0⟩ and |1⟩ states in the qubits are given in bit_coefs. This array must be of size 2*n, where n is the number of qubits in the system. The state will be evaluated in nr_shots separate runs.

pub fn nr_bits(&self) -> usize[src]

Return the number of qubits in this state

Trait Implementations

impl QuState for VectorState[src]

fn apply_conditional_gate<G: ?Sized>(
    &mut self,
    control: &[bool],
    gate: &G,
    bits: &[usize]
) -> Result<()> where
    G: Gate
[src]

Apply a conditional n-ary quantum gate gate, controlled by classical bit control, on the qubits from bits in this state.

impl Debug for VectorState[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]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,