[][src]Struct q1tsim::gates::U3

pub struct U3 { /* fields omitted */ }

U3 gate.

The U3(θ, ϕ, λ) gate is the univeral single-qubit transformation, all unary gates can be written in terms of U3. It transforms a qubit by the matrix

┌                                     ┐
│       cos(θ/2)      -exp(iλ)sin(θ/2)│
│                                     │
│exp(iϕ)sin(θ/2)   exp(i(λ+ϕ))cos(θ/2)│
└                                     ┘

Methods

impl U3[src]

pub fn new(theta: f64, phi: f64, lambda: f64) -> Self[src]

Create a new U3 gate.

pub fn cost() -> f64[src]

Trait Implementations

impl Gate for U3[src]

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

Apply a gate. Read more

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

fn apply_slice(&self, state: &mut CVecSliceMut)[src]

Apply a gate. Read more

fn apply_mat_slice(&self, state: &mut CMatSliceMut)[src]

impl CQasm for U3[src]

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

cQasm representation of conditional gate. Read more

impl Latex for U3[src]

fn latex_checked(&self, bits: &[usize], state: &mut LatexExportState)[src]

Checked add to the export state. Read more

impl OpenQasm for U3[src]

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

OpenQasm representation of conditional gate. Read more

Auto Trait Implementations

impl Send for U3

impl Sync for U3

Blanket Implementations

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

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.