[][src]Struct q1tsim::gates::H

pub struct H {}

The Hadamard gate.

The Hadamard gate maps the zero state |0⟩ to the symmetric combination of |0⟩ and |1⟩, and the |1⟩ state to the anti-symmetric combination.

Methods

impl H[src]

pub fn new() -> Self[src]

Create a new Hadamard gate.

pub fn transform(state: CVecSliceMut)[src]

pub fn transform_mat(state: CMatSliceMut)[src]

pub fn cost() -> f64[src]

Trait Implementations

impl Gate for H[src]

fn apply(&self, state: &mut CVector)[src]

Apply a gate. Read more

fn apply_mat(&self, state: &mut CMatrix)[src]

Apply a gate. Read more

fn check_nr_bits(&self, n: usize) -> Result<()>[src]

Check the number of bits Read more

impl CQasm for H[src]

fn conditional_c_qasm(
    &self,
    condition: &str,
    bit_names: &[String],
    bits: &[usize]
) -> Result<String>
[src]

cQasm representation of conditional gate. Read more

impl Latex for H[src]

impl OpenQasm for H[src]

fn conditional_open_qasm(
    &self,
    condition: &str,
    bit_names: &[String],
    bits: &[usize]
) -> Result<String>
[src]

OpenQasm representation of conditional gate. Read more

Auto Trait Implementations

impl Send for H

impl Sync for H

Blanket Implementations

impl<G> CircuitGate for G where
    G: Gate + CQasm + Latex + OpenQasm
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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]