[−][src]Enum dqcsim::common::types::GateType
Represents a type of quantum or mixed quantum-classical gate.
Variants
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(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:
- 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 GateType
[src]
impl Debug for GateType
[src]
impl<'de> Deserialize<'de> for GateType
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for GateType
[src]
impl<'_> From<&'_ GateType> for dqcs_gate_type_t
[src]
fn from(gate_type: &GateType) -> dqcs_gate_type_t
[src]
impl Hash for GateType
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<GateType> for GateType
[src]
impl Serialize for GateType
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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>,