[−][src]Enum dqcsim::bindings::dqcs_predefined_gate_t
Enumeration of gates defined by DQCsim.
Variants
Invalid gate. Used as an error return value.
The identity gate for a single qubit.
\f[ I = \sigma_0 = \begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix} \f]
The Pauli X matrix.
\f[ X = \sigma_1 = \begin{bmatrix} 0 & 1 \ 1 & 0 \end{bmatrix} \f]
The Pauli Y matrix.
\f[ Y = \sigma_2 = \begin{bmatrix} 0 & -i \ i & 0 \end{bmatrix} \f]
The Pauli Z matrix.
\f[ Z = \sigma_3 = \begin{bmatrix} 1 & 0 \ 0 & -1 \end{bmatrix} \f]
The hadamard gate matrix. That is, a 180-degree Y rotation, followed by a 90-degree X rotation.
\f[ H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \ 1 & -1 \end{bmatrix} \f]
The S matrix, also known as a 90 degree Z rotation.
\f[ S = \begin{bmatrix} 1 & 0 \ 0 & i \end{bmatrix} \f]
The S-dagger matrix, also known as a negative 90 degree Z rotation.
\f[ S^\dagger = \begin{bmatrix} 1 & 0 \ 0 & -i \end{bmatrix} \f]
The T matrix, also known as a 45 degree Z rotation.
\f[ T = \begin{bmatrix} 1 & 0 \ 0 & e^{i\frac{\pi}{4}} \end{bmatrix} \f]
The T-dagger matrix, also known as a negative 45 degree Z rotation.
\f[ T^\dagger = \begin{bmatrix} 1 & 0 \ 0 & e^{-i\frac{\pi}{4}} \end{bmatrix} \f]
Rx(90°) gate.
\f[ R_x\left(\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & -i \ -i & 1 \end{bmatrix} \f]
Rx(-90°) gate.
\f[ R_x\left(-\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & i \ i & 1 \end{bmatrix} \f]
Rx(180°) gate.
\f[ R_x(\pi) = \begin{bmatrix} 0 & -i \ -i & 0 \end{bmatrix} \f]
This matrix is equivalent to the Pauli X gate, but differs in global phase. Note that this difference is significant when it is used as a submatrix for a controlled gate.
Ry(90°) gate.
\f[ R_y\left(\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & -1 \ 1 & 1 \end{bmatrix} \f]
Ry(-90°) gate.
\f[ R_y\left(\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \ -1 & 1 \end{bmatrix} \f]
Ry(180°) gate.
\f[ R_y(\pi) = \begin{bmatrix} 0 & -1 \ 1 & 0 \end{bmatrix} \f]
This matrix is equivalent to the Pauli Y gate, but differs in global phase. Note that this difference is significant when it is used as a submatrix for a controlled gate.
Rz(90°) gate.
\f[ R_z\left(\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1-i & 0 \ 0 & 1+i \end{bmatrix} \f]
This matrix is equivalent to the S gate, but differs in global phase. Note that this difference is significant when it is used as a submatrix for a controlled gate.
Rz(-90°) gate.
\f[ R_z\left(-\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1+i & 0 \ 0 & 1-i \end{bmatrix} \f]
This matrix is equivalent to the S-dagger gate, but differs in global phase. Note that this difference is significant when it is used as a submatrix for a controlled gate.
Rz(180°) gate.
\f[ R_z(\pi) = \begin{bmatrix} -i & 0 \ 0 & i \end{bmatrix} \f]
This matrix is equivalent to the Pauli Z gate, but differs in global phase. Note that this difference is significant when it is used as a submatrix for a controlled gate.
The matrix for an arbitrary X rotation.
\f[ R_x(\theta) = \begin{bmatrix} \cos{\frac{\theta}{2}} & -i\sin{\frac{\theta}{2}} \ -i\sin{\frac{\theta}{2}} & \cos{\frac{\theta}{2}} \end{bmatrix} \f]
θ is specified or returned through the first binary string argument of the parameterization ArbData object. It is represented as a little-endian double floating point value, specified in radians.
The matrix for an arbitrary Y rotation.
\f[ R_y(\theta) = \begin{bmatrix} \cos{\frac{\theta}{2}} & -\sin{\frac{\theta}{2}} \ \sin{\frac{\theta}{2}} & \cos{\frac{\theta}{2}} \end{bmatrix} \f]
θ is specified or returned through the first binary string argument of the parameterization ArbData object. It is represented as a little-endian double floating point value, specified in radians.
The matrix for an arbitrary Z rotation.
\f[ R_z(\theta) = \begin{bmatrix} e^{-i\frac{\theta}{2}} & 0 \ 0 & e^{i\frac{\theta}{2}} \end{bmatrix} \f]
θ is specified or returned through the first binary string argument of the parameterization ArbData object. It is represented as a little-endian double floating point value, specified in radians.
The matrix for a Z rotation with angle π/2^k.
\f[ \textit{PhaseK}(k) = \textit{Phase}\left(\frac{\pi}{2^k}\right) = \begin{bmatrix} 1 & 0 \ 0 & e^{i\pi / 2^k} \end{bmatrix} \f]
k is specified or returned through the first binary string argument of the parameterization ArbData object. It is represented as a little-endian unsigned 64-bit integer.
The matrix for an arbitrary Z rotation.
\f[ \textit{Phase}(\theta) = \begin{bmatrix} 1 & 0 \ 0 & e^{i\theta} \end{bmatrix} \f]
θ is specified or returned through the first binary string argument of the parameterization ArbData object. It is represented as a little-endian double floating point value, specified in radians.
This matrix is equivalent to the Rz gate, but differs in global phase. Note that this difference is significant when it is used as a submatrix for a controlled gate. Specifically, controlled phase gates use the phase as specified by this gate, whereas Rz follows the usual algebraic notation.
Any single-qubit unitary gate, parameterized as a full unitary matrix.
The full matrix is specified or returned through the first binary string argument of the parameterization ArbData object. It is represented as an array of little-endian double floating point values, structured as real/imag pairs, with the pairs in row-major order.
Arbitrary rotation matrix.
\f[ R(\theta, \phi, \lambda) = \begin{bmatrix} \cos{\frac{\theta}{2}} & -\sin{\frac{\theta}{2}} e^{i\lambda} \ \sin{\frac{\theta}{2}} e^{i\phi} & \cos{\frac{\theta}{2}} e^{i\phi + i\lambda} \end{bmatrix} \f]
This is equivalent to the following:
\f[ R(\theta, \phi, \lambda) = \textit{Phase}(\phi) \cdot R_y(\theta) \cdot \textit{Phase}(\lambda) \f]
The rotation order and phase is taken from Qiskit's U3 gate. Ignoring global phase, any unitary single-qubit gate can be represented with this notation.
θ, φ, and λ are specified or returned through the first three binary string arguments of the parameterization ArbData object. They are represented as little-endian double floating point values, specified in radians.
The swap gate matrix.
\f[ \textit{SWAP} = \begin{bmatrix} 1 & 0 & 0 & 0 \ 0 & 0 & 1 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & 0 & 1 \end{bmatrix} \f]
The square-root of a swap gate matrix.
\f[ \sqrt{\textit{SWAP}} = \begin{bmatrix} 1 & 0 & 0 & 0 \ 0 & \frac{i+1}{2} & \frac{i-1}{2} & 0 \ 0 & \frac{i-1}{2} & \frac{i+1}{2} & 0 \ 0 & 0 & 0 & 1 \end{bmatrix} \f]
Any two-qubit unitary gate, parameterized as a full unitary matrix.
The full matrix is specified or returned through the first binary string argument of the parameterization ArbData object. It is represented as an array of little-endian double floating point values, structured as real/imag pairs, with the pairs in row-major order.
Any three-qubit unitary gate, parameterized as a full unitary matrix.
The full matrix is specified or returned through the first binary string argument of the parameterization ArbData object. It is represented as an array of little-endian double floating point values, structured as real/imag pairs, with the pairs in row-major order.
Trait Implementations
impl Clone for dqcs_predefined_gate_t
[src]
fn clone(&self) -> dqcs_predefined_gate_t
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for dqcs_predefined_gate_t
[src]
impl Debug for dqcs_predefined_gate_t
[src]
impl PartialEq<dqcs_predefined_gate_t> for dqcs_predefined_gate_t
[src]
fn eq(&self, other: &dqcs_predefined_gate_t) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralPartialEq for dqcs_predefined_gate_t
[src]
impl TryFrom<dqcs_predefined_gate_t> for UnitaryGateType
[src]
Auto Trait Implementations
impl RefUnwindSafe for dqcs_predefined_gate_t
impl Send for dqcs_predefined_gate_t
impl Sync for dqcs_predefined_gate_t
impl Unpin for dqcs_predefined_gate_t
impl UnwindSafe for dqcs_predefined_gate_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>,