[][src]Enum dqcsim::common::types::GateType

pub enum GateType {
    Unitary,
    Measurement,
    Prep,
    Custom(String),
}

Represents a type of quantum or mixed quantum-classical gate.

Variants

Unitary

Unitary gates have one or more target qubits, zero or more control qubits, and a unitary matrix, sized for the number of target qubits.

The semantics are that the unitary matrix expanded by the number of control qubits is applied to the qubits.

The data field may add pragma-like hints to the gate, for instance to represent the line number in the source file that generated the gate, error modelling information, and so on. This data may be silently ignored.

Measurement

Measurement gates have one or more measured qubits and a 2x2 unitary matrix representing the basis.

The semantics are:

This allows any measurement basis to be used.

The data field may add pragma-like hints to the gate, for instance to represent the line number in the source file that generated the gate, error modelling information, and so on. This data may be silently ignored.

Prep

Prep gates have one or more target qubits and a 2x2 unitary matrix representing the basis.

The semantics are:

This allows any initial state to be used.

The data field may add pragma-like hints to the gate, for instance to represent the line number in the source file that generated the gate, error modelling information, and so on. This data may be silently ignored.

Custom(String)

Custom gates perform a user-defined mixed quantum-classical operation, identified by a name. They can have zero or more target, control, and measured qubits, of which only the target and control sets must be mutually exclusive. They also have an optional matrix of arbitrary size.

The semantics are:

Trait Implementations

impl Clone for GateType[src]

impl Debug for GateType[src]

impl<'de> Deserialize<'de> for GateType[src]

impl Eq for GateType[src]

impl<'_> From<&'_ GateType> for dqcs_gate_type_t[src]

impl Hash for GateType[src]

impl PartialEq<GateType> for GateType[src]

impl Serialize for GateType[src]

impl StructuralEq for GateType[src]

impl StructuralPartialEq for GateType[src]

Auto Trait Implementations

impl RefUnwindSafe for GateType

impl Send for GateType

impl Sync for GateType

impl Unpin for GateType

impl UnwindSafe for GateType

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,