CX

Struct CX 

Source
pub struct CX { /* private fields */ }
Expand description

Controlled X gate.

Implementations§

Source§

impl CX

Source

pub fn new() -> Self

Source

pub fn cost() -> f64

Trait Implementations§

Source§

impl CQasm for CX

Source§

fn c_qasm(&self, bit_names: &[String], bits: &[usize]) -> Result<String>

cQasm representation Read more
Source§

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

cQasm representation of conditional gate. Read more
Source§

impl Gate for CX

Source§

fn cost(&self) -> f64

Cost of this gate. Read more
Source§

fn description(&self) -> &str

Return a short description of the gate. This may be the name of the gate (e.g. "H", "CX"), or the way the gate was constructed (like "I⊗Z")
Source§

fn nr_affected_bits(&self) -> usize

The number of qubits affected by this gate.
Source§

fn matrix(&self) -> CMatrix

Return a matrix describing the unitary transformation that the gate provides
Source§

fn apply_slice(&self, state: CVecSliceMut<'_>)

Apply a gate. Read more
Source§

fn apply_mat_slice(&self, state: CMatSliceMut<'_>)

Apply a gate. Read more
Source§

fn is_stabilizer(&self) -> bool

Whether this gate is a stabilizer gate Read more
Source§

fn conjugate(&self, ops: &mut [PauliOp]) -> Result<bool>

Conjugate Pauli operators Read more
Source§

fn apply(&self, state: &mut CVector)

Apply a gate. Read more
Source§

fn apply_mat(&self, state: &mut CMatrix)

Apply a gate. Read more
Source§

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

Check the number of bits Read more
Source§

impl Latex for CX

Source§

fn latex(&self, bits: &[usize], state: &mut LatexExportState) -> Result<()>

Add this gate to the export state. Read more
Source§

impl OpenQasm for CX

Source§

fn open_qasm(&self, bit_names: &[String], bits: &[usize]) -> Result<String>

OpenQasm representation Read more
Source§

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

OpenQasm representation of conditional gate. Read more

Auto Trait Implementations§

§

impl Freeze for CX

§

impl RefUnwindSafe for CX

§

impl Send for CX

§

impl Sync for CX

§

impl Unpin for CX

§

impl UnwindSafe for CX

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<G> CircuitGate for G
where G: Gate + OpenQasm + CQasm + Latex,

Source§

fn as_gate(&self) -> &dyn Gate

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V