Standard gates
standard_gates
Functions:
Name | Description |
---|---|
H |
[Qmod core-library function] |
X |
[Qmod core-library function] |
Y |
[Qmod core-library function] |
Z |
[Qmod core-library function] |
I |
[Qmod core-library function] |
S |
[Qmod core-library function] |
T |
[Qmod core-library function] |
SDG |
[Qmod core-library function] |
TDG |
[Qmod core-library function] |
PHASE |
[Qmod core-library function] |
RX |
[Qmod core-library function] |
RY |
[Qmod core-library function] |
RZ |
[Qmod core-library function] |
R |
[Qmod core-library function] |
RXX |
[Qmod core-library function] |
RYY |
[Qmod core-library function] |
RZZ |
[Qmod core-library function] |
CH |
[Qmod core-library function] |
CX |
[Qmod core-library function] |
CY |
[Qmod core-library function] |
CZ |
[Qmod core-library function] |
CRX |
[Qmod core-library function] |
CRY |
[Qmod core-library function] |
CRZ |
[Qmod core-library function] |
CPHASE |
[Qmod core-library function] |
SWAP |
[Qmod core-library function] |
IDENTITY |
[Qmod core-library function] |
U |
[Qmod core-library function] |
CCX |
[Qmod core-library function] |
H
H(target: QBit) -> None
[Qmod core-library function]
Performs the Hadamard gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the Hadamard gate to. |
required |
X
X(target: QBit) -> None
[Qmod core-library function]
Performs the Pauli-X gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the Pauli-X gate to. |
required |
Y
Y(target: QBit) -> None
[Qmod core-library function]
Performs the Pauli-Y gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the Pauli-Y gate to. |
required |
Z
Z(target: QBit) -> None
[Qmod core-library function]
Performs the Pauli-Z gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the Pauli-Z gate to. |
required |
I
I(target: QBit) -> None
[Qmod core-library function]
Performs the identity gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the identity gate to. |
required |
S
S(target: QBit) -> None
[Qmod core-library function]
Performs the S gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the S gate to. |
required |
T
T(target: QBit) -> None
[Qmod core-library function]
Performs the T gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the T gate to. |
required |
SDG
SDG(target: QBit) -> None
[Qmod core-library function]
Performs the S-dagger gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the S-dagger gate to. |
required |
TDG
TDG(target: QBit) -> None
[Qmod core-library function]
Performs the T-dagger gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QBit
|
The qubit to apply the T-dagger gate to. |
required |
PHASE
PHASE(theta: CReal, target: QBit) -> None
[Qmod core-library function]
Performs the phase gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The phase angle in radians. |
required |
target
|
QBit
|
The qubit to apply the phase gate to. |
required |
RX
RX(theta: CReal, target: QBit) -> None
[Qmod core-library function]
Performs the Pauli-X rotation gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
target
|
QBit
|
The qubit to apply the Pauli-X rotation gate to. |
required |
RY
RY(theta: CReal, target: QBit) -> None
[Qmod core-library function]
Performs the Pauli-Y rotation gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
target
|
QBit
|
The qubit to apply the Pauli-Y rotation gate to. |
required |
RZ
RZ(theta: CReal, target: QBit) -> None
[Qmod core-library function]
Performs the Pauli-Z rotation gate on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
target
|
QBit
|
The qubit to apply the Pauli-Z rotation gate to. |
required |
R
R(theta: CReal, phi: CReal, target: QBit) -> None
[Qmod core-library function]
Performs a rotation of \(\theta\) around the \(cos(\phi)\hat{x} + sin(\phi)\hat{y}\) axis on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
phi
|
CReal
|
The phase angle in radians. |
required |
target
|
QBit
|
The qubit to apply the general single-qubit rotation gate to. |
required |
RXX
RXX(theta: CReal, target: QArray[QBit, Literal[2]]) -> None
[Qmod core-library function]
Performs the XX rotation gate on a pair of qubits.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
target
|
QArray[QBit, Literal[2]]
|
The pair of qubits to apply the XX rotation gate to. |
required |
RYY
RYY(theta: CReal, target: QArray[QBit, Literal[2]]) -> None
[Qmod core-library function]
Performs the YY rotation gate on a pair of qubits.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
target
|
QArray[QBit, Literal[2]]
|
The pair of qubits to apply the YY rotation gate to. |
required |
RZZ
RZZ(theta: CReal, target: QArray[QBit, Literal[2]]) -> None
[Qmod core-library function]
Performs the ZZ rotation gate on a pair of qubits.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
target
|
QArray[QBit, Literal[2]]
|
The pair of qubits to apply the ZZ rotation gate to. |
required |
CH
CH(ctrl: QBit, target: QBit) -> None
[Qmod core-library function]
Applies the Hadamard gate to the target qubit, conditioned on the control qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctrl
|
QBit
|
The control qubit. |
required |
target
|
QBit
|
The qubit to apply the Hadamard gate on. |
required |
CX
CX(ctrl: QBit, target: QBit) -> None
[Qmod core-library function]
Applies the Pauli-X gate to the target qubit, conditioned on the control qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctrl
|
QBit
|
The control qubit. |
required |
target
|
QBit
|
The qubit to apply the Pauli-X gate on. |
required |
CY
CY(ctrl: QBit, target: QBit) -> None
[Qmod core-library function]
Applies the Pauli-Y gate to the target qubit, conditioned on the control qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctrl
|
QBit
|
The control qubit. |
required |
target
|
QBit
|
The qubit to apply the Pauli-Y gate on. |
required |
CZ
CZ(ctrl: QBit, target: QBit) -> None
[Qmod core-library function]
Applies the Pauli-Z gate to the target qubit, conditioned on the control qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctrl
|
QBit
|
The control qubit. |
required |
target
|
QBit
|
The qubit to apply the Pauli-Z gate on. |
required |
CRX
CRX(theta: CReal, ctrl: QBit, target: QBit) -> None
[Qmod core-library function]
Applies the RX gate to the target qubit, conditioned on the control qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
ctrl
|
QBit
|
The control qubit. |
required |
target
|
QBit
|
The qubit to apply the RX gate on. |
required |
CRY
CRY(theta: CReal, ctrl: QBit, target: QBit) -> None
[Qmod core-library function]
Applies the RY gate to the target qubit, conditioned on the control qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
ctrl
|
QBit
|
The control qubit. |
required |
target
|
QBit
|
The qubit to apply the RY gate on. |
required |
CRZ
CRZ(theta: CReal, ctrl: QBit, target: QBit) -> None
[Qmod core-library function]
Applies the RZ gate to the target qubit, conditioned on the control qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
ctrl
|
QBit
|
The control qubit. |
required |
target
|
QBit
|
The qubit to apply the RZ gate on. |
required |
CPHASE
CPHASE(theta: CReal, ctrl: QBit, target: QBit) -> None
[Qmod core-library function]
Applies the PHASE gate to the target qubit, conditioned on the control qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The rotation angle in radians. |
required |
ctrl
|
QBit
|
The control qubit. |
required |
target
|
QBit
|
The qubit to apply the PHASE gate on. |
required |
SWAP
SWAP(qbit0: QBit, qbit1: QBit) -> None
[Qmod core-library function]
Swaps the states of two qubits.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qbit0
|
QBit
|
The first qubit. |
required |
qbit1
|
QBit
|
The second qubit. |
required |
IDENTITY
IDENTITY(target: QArray[QBit]) -> None
[Qmod core-library function]
Does nothing.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
QArray[QBit]
|
The qubits to apply the IDENTITY gate on. |
required |
U
U(
theta: CReal,
phi: CReal,
lam: CReal,
gam: CReal,
target: QBit,
) -> None
[Qmod core-library function]
Performs a general single-qubit unitary gate that applies phase and rotation with three Euler angles on a qubit.
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta
|
CReal
|
The first Euler angle in radians. |
required |
phi
|
CReal
|
The second Euler angle in radians. |
required |
lam
|
CReal
|
The third Euler angle in radians. |
required |
gam
|
CReal
|
The global phase angle in radians. |
required |
target
|
QBit
|
The qubit to apply the general single-qubit unitary gate to. |
required |
CCX
CCX(ctrl: QArray[QBit, Literal[2]], target: QBit) -> None
[Qmod core-library function]
Applies the Pauli-X gate to the target qubit, conditioned on the two control qubits (Toffoli).
This operation is represented by the following matrix:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctrl
|
QArray[QBit, Literal[2]]
|
The control qubits. |
required |
target
|
QBit
|
The qubit to apply the conditioned Pauli-X gate on. |
required |