[−][src]Enum dqcsim::bindings::dqcs_gate_type_t
Types of DQCsim gates.
Variants
Invalid gate type. Used as an error return value.
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 gates have one or more measured qubits and a 2x2 unitary matrix representing the basis.
The semantics are:
- the hermetian of the matrix is applied to each individual qubit;
- each individual qubit is measured in the Z basis;
- the matrix is applied to each individual qubit;
- the results of the measurement are propagated upstream.
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 gates have one or more target qubits and a 2x2 unitary matrix representing the basis.
The semantics are:
- each qubit is initialized to |0>;
- the matrix is applied to each individual qubit.
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 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:
- if the name is not recognized, an error is reported;
- a user-defined operation is performed based on the name, qubits, matrix, and data arguments;
- exactly one measurement result is reported upstream for exactly the qubits in the measures set.
Trait Implementations
impl Clone for dqcs_gate_type_t
[src]
fn clone(&self) -> dqcs_gate_type_t
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for dqcs_gate_type_t
[src]
impl Debug for dqcs_gate_type_t
[src]
impl<'_> From<&'_ GateType> for dqcs_gate_type_t
[src]
fn from(gate_type: &GateType) -> dqcs_gate_type_t
[src]
impl PartialEq<dqcs_gate_type_t> for dqcs_gate_type_t
[src]
fn eq(&self, other: &dqcs_gate_type_t) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralPartialEq for dqcs_gate_type_t
[src]
Auto Trait Implementations
impl RefUnwindSafe for dqcs_gate_type_t
impl Send for dqcs_gate_type_t
impl Sync for dqcs_gate_type_t
impl Unpin for dqcs_gate_type_t
impl UnwindSafe for dqcs_gate_type_t
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,