[][src]Enum dqcsim::bindings::dqcs_predefined_gate_t

#[repr(C)]pub enum dqcs_predefined_gate_t {
    DQCS_GATE_INVALID,
    DQCS_GATE_PAULI_I,
    DQCS_GATE_PAULI_X,
    DQCS_GATE_PAULI_Y,
    DQCS_GATE_PAULI_Z,
    DQCS_GATE_H,
    DQCS_GATE_S,
    DQCS_GATE_S_DAG,
    DQCS_GATE_T,
    DQCS_GATE_T_DAG,
    DQCS_GATE_RX_90,
    DQCS_GATE_RX_M90,
    DQCS_GATE_RX_180,
    DQCS_GATE_RY_90,
    DQCS_GATE_RY_M90,
    DQCS_GATE_RY_180,
    DQCS_GATE_RZ_90,
    DQCS_GATE_RZ_M90,
    DQCS_GATE_RZ_180,
    DQCS_GATE_RX,
    DQCS_GATE_RY,
    DQCS_GATE_RZ,
    DQCS_GATE_PHASE_K,
    DQCS_GATE_PHASE,
    DQCS_GATE_U1,
    DQCS_GATE_R,
    DQCS_GATE_SWAP,
    DQCS_GATE_SQRT_SWAP,
    DQCS_GATE_U2,
    DQCS_GATE_U3,
}

Enumeration of gates defined by DQCsim.

Variants

DQCS_GATE_INVALID

Invalid gate. Used as an error return value.

DQCS_GATE_PAULI_I

The identity gate for a single qubit.

\f[ I = \sigma_0 = \begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix} \f]

DQCS_GATE_PAULI_X

The Pauli X matrix.

\f[ X = \sigma_1 = \begin{bmatrix} 0 & 1 \ 1 & 0 \end{bmatrix} \f]

DQCS_GATE_PAULI_Y

The Pauli Y matrix.

\f[ Y = \sigma_2 = \begin{bmatrix} 0 & -i \ i & 0 \end{bmatrix} \f]

DQCS_GATE_PAULI_Z

The Pauli Z matrix.

\f[ Z = \sigma_3 = \begin{bmatrix} 1 & 0 \ 0 & -1 \end{bmatrix} \f]

DQCS_GATE_H

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]

DQCS_GATE_S

The S matrix, also known as a 90 degree Z rotation.

\f[ S = \begin{bmatrix} 1 & 0 \ 0 & i \end{bmatrix} \f]

DQCS_GATE_S_DAG

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]

DQCS_GATE_T

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]

DQCS_GATE_T_DAG

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]

DQCS_GATE_RX_90

Rx(90°) gate.

\f[ R_x\left(\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & -i \ -i & 1 \end{bmatrix} \f]

DQCS_GATE_RX_M90

Rx(-90°) gate.

\f[ R_x\left(-\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & i \ i & 1 \end{bmatrix} \f]

DQCS_GATE_RX_180

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.

DQCS_GATE_RY_90

Ry(90°) gate.

\f[ R_y\left(\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & -1 \ 1 & 1 \end{bmatrix} \f]

DQCS_GATE_RY_M90

Ry(-90°) gate.

\f[ R_y\left(\frac{\pi}{2}\right) = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \ -1 & 1 \end{bmatrix} \f]

DQCS_GATE_RY_180

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.

DQCS_GATE_RZ_90

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.

DQCS_GATE_RZ_M90

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.

DQCS_GATE_RZ_180

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.

DQCS_GATE_RX

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.

DQCS_GATE_RY

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.

DQCS_GATE_RZ

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.

DQCS_GATE_PHASE_K

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.

DQCS_GATE_PHASE

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.

DQCS_GATE_U1

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.

DQCS_GATE_R

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.

DQCS_GATE_SWAP

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]

DQCS_GATE_SQRT_SWAP

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]

DQCS_GATE_U2

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.

DQCS_GATE_U3

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]

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]

impl StructuralPartialEq for dqcs_predefined_gate_t[src]

impl TryFrom<dqcs_predefined_gate_t> for UnitaryGateType[src]

type Error = Error

The type returned in the event of a conversion error.

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]

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

impl<T> BorrowMut<T> for T where
    T: ?Sized
[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>,