[][src]Struct q1tsim::gates::C

pub struct C<G> where
    G: Gate
{ /* fields omitted */ }

Controlled gates.

A controlled gate is a gate which acts upon a control bit: when the control bit is zero, it leaves the target unchanged; when the control bit is one, the gate is applied.

Methods

impl<G> C<G> where
    G: Gate
[src]

pub fn new(gate: G) -> Self[src]

Create a new controlled gate for gate.

Trait Implementations

impl<G> Gate for C<G> where
    G: Gate
[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, bits: &[usize]) -> Result<()>[src]

Check the number of bits Read more

impl<G> Latex for C<G> where
    G: Gate + Latex
[src]

Auto Trait Implementations

impl<G> Send for C<G> where
    G: Send

impl<G> Sync for C<G> where
    G: Sync

Blanket Implementations

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 = Infallible

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

The type returned in the event of a conversion error.