Skip to main content
Functions:

H

H(
target: QBit
) -> None
[Qmod core-library function] Performs the Hadamard gate on a qubit. This operation is represented by the following matrix: H=12[1111]H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} Parameters:

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: X=[0110]X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} Parameters:

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: Y=[0ii0]Y = \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix} Parameters:

Z

Z(
target: Const[QBit]
) -> None
[Qmod core-library function] Performs the Pauli-Z gate on a qubit. This operation is represented by the following matrix: Z=[1001]Z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} Parameters:

I

I(
target: Const[QBit]
) -> None
[Qmod core-library function] Performs the identity gate on a qubit. This operation is represented by the following matrix: I=[1001]I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} Parameters:

S

S(
target: Const[QBit]
) -> None
[Qmod core-library function] Performs the S gate on a qubit. This operation is represented by the following matrix: S=[100i]S = \begin{bmatrix} 1 & 0 \\ 0 & i \end{bmatrix} Parameters:

T

T(
target: Const[QBit]
) -> None
[Qmod core-library function] Performs the T gate on a qubit. This operation is represented by the following matrix: T=[100eiπ4]T = \begin{bmatrix} 1 & 0 \\ 0 & e^{i\frac{\pi}{4}} \end{bmatrix} Parameters:

SDG

SDG(
target: Const[QBit]
) -> None
[Qmod core-library function] Performs the S-dagger gate on a qubit. This operation is represented by the following matrix: S=[100i]S^\dagger = \begin{bmatrix} 1 & 0 \\ 0 & -i \end{bmatrix} Parameters:

TDG

TDG(
target: Const[QBit]
) -> None
[Qmod core-library function] Performs the T-dagger gate on a qubit. This operation is represented by the following matrix: T=[100eiπ4]T^\dagger = \begin{bmatrix} 1 & 0 \\ 0 & e^{-i\frac{\pi}{4}} \end{bmatrix} Parameters:

PHASE

PHASE(
theta: CReal,
target: Const[QBit]
) -> None
[Qmod core-library function] Performs the phase gate on a qubit. This operation is represented by the following matrix: PHASE(θ)=[100eiθ]PHASE(\theta) = \begin{bmatrix} 1 & 0 \\ 0 & e^{i\theta} \end{bmatrix} Parameters:

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: RX(θ)=eiθ2X=[cos(θ2)isin(θ2)isin(θ2)cos(θ2)]R_X(\theta) = e^{-i\frac{\theta}{2}X} = \begin{bmatrix} cos(\frac{\theta}{2}) & -i sin(\frac{\theta}{2}) \\ -i sin(\frac{\theta}{2}) & cos(\frac{\theta}{2}) \end{bmatrix} Parameters:

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: RY(θ)=eiθ2Y=[cos(θ2)sin(θ2)sin(θ2)cos(θ2)]R_Y(\theta) = e^{-i\frac{\theta}{2}Y} = \begin{bmatrix} cos(\frac{\theta}{2}) & -sin(\frac{\theta}{2}) \\ sin(\frac{\theta}{2}) & cos(\frac{\theta}{2}) \end{bmatrix} Parameters:

RZ

RZ(
theta: CReal,
target: Const[QBit]
) -> None
[Qmod core-library function] Performs the Pauli-Z rotation gate on a qubit. This operation is represented by the following matrix: RZ(θ)=eiθ2Z=[eiθ200eiθ2]R_Z(\theta) = e^{-i\frac{\theta}{2}Z} = \begin{bmatrix} e^{-i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \end{bmatrix} Parameters:

R

R(
theta: CReal,
phi: CReal,
target: QBit
) -> None
[Qmod core-library function] Performs a rotation of θ\theta around the cos(ϕ){^x}+sin(ϕ){^y}cos(\phi)\hat\{x\} + sin(\phi)\hat\{y\} axis on a qubit. This operation is represented by the following matrix: R(θ,ϕ)=eiθ2(cos(ϕ)X+sin(ϕ)Y)=[cos(θ2)ieiϕsin(θ2)ieiϕsin(θ2)cos(θ2)]R(\theta, \phi) = e^{-i \frac{\theta}{2} (cos(\phi)X + sin(\phi)Y)} = \begin{bmatrix} cos(\frac{\theta}{2}) & -i e^{-i\phi} sin(\frac{\theta}{2}) \\ -i e^{i\phi} sin(\frac{\theta}{2}) & cos(\frac{\theta}{2}) \end{bmatrix} Parameters:

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: RXX(θ)=eiθ2XX=[cos(θ2)00isin(θ2)0cos(θ2)isin(θ2)00isin(θ2)cos(θ2)0isin(θ2)00cos(θ2)]R_{XX}(\theta) = e^{-i\frac{\theta}{2}X \otimes X} = \begin{bmatrix} cos(\frac{\theta}{2}) & 0 & 0 & -i sin(\frac{\theta}{2}) \\ 0 & cos(\frac{\theta}{2}) & -i sin(\frac{\theta}{2}) & 0 \\ 0 & -i sin(\frac{\theta}{2}) & cos(\frac{\theta}{2}) & 0 \\ -i sin(\frac{\theta}{2}) & 0 & 0 & cos(\frac{\theta}{2}) \end{bmatrix} Parameters:

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: RYY(θ)=eiθ2YY=[cos(θ2)00sin(θ2)0cos(θ2)sin(θ2)00sin(θ2)cos(θ2)0sin(θ2)00cos(θ2)]R_{YY}(\theta) = e^{-i\frac{\theta}{2}Y \otimes Y} = \begin{bmatrix} cos(\frac{\theta}{2}) & 0 & 0 & -sin(\frac{\theta}{2}) \\ 0 & cos(\frac{\theta}{2}) & sin(\frac{\theta}{2}) & 0 \\ 0 & sin(\frac{\theta}{2}) & cos(\frac{\theta}{2}) & 0 \\ -sin(\frac{\theta}{2}) & 0 & 0 & cos(\frac{\theta}{2}) \end{bmatrix} Parameters:

RZZ

RZZ(
theta: CReal,
target: Const[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: RZZ(θ)=eiθ2ZZ=[eiθ20000eiθ20000eiθ20000eiθ2]R_{ZZ}(\theta) = e^{-i\frac{\theta}{2}Z \otimes Z} = \begin{bmatrix} e^{-i\frac{\theta}{2}} & 0 & 0 & 0 \\ 0 & e^{i\frac{\theta}{2}} & 0 & 0 \\ 0 & 0 & e^{i\frac{\theta}{2}} & 0 \\ 0 & 0 & 0 & e^{-i\frac{\theta}{2}} \end{bmatrix} Parameters:

CH

CH(
ctrl: Const[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: CH=12[1000010000110011]CH = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & -1 \end{bmatrix} Parameters:

CX

CX(
ctrl: Const[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: CX=[1000010000010010]CX = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix} Parameters:

CY

CY(
ctrl: Const[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: CY=[10000100000i00i0]CY = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & -i \\ 0 & 0 & i & 0 \end{bmatrix} Parameters:

CZ

CZ(
ctrl: Const[QBit],
target: Const[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: CZ=[1000010000100001]CZ = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{bmatrix} Parameters:

CRX

CRX(
theta: CReal,
ctrl: Const[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: CRX=[1000010000cos(θ2)isin(θ2)00isin(θ2)cos(θ2)]CRX = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & cos(\frac{\theta}{2}) & -i*sin(\frac{\theta}{2}) \\ 0 & 0 & -i*sin(\frac{\theta}{2}) & cos(\frac{\theta}{2}) \end{bmatrix} Parameters:

CRY

CRY(
theta: CReal,
ctrl: Const[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: CRY=[1000010000cos(θ2)sin(θ2)00sin(θ2)cos(θ2)]CRY = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & cos(\frac{\theta}{2}) & -sin(\frac{\theta}{2}) \\ 0 & 0 & sin(\frac{\theta}{2}) & cos(\frac{\theta}{2}) \end{bmatrix} Parameters:

CRZ

CRZ(
theta: CReal,
ctrl: Const[QBit],
target: Const[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: CRZ=[1000010000eiθ20000eiθ2]CRZ = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & e^{-i\frac{\theta}{2}} & 0 \\ 0 & 0 & 0 & e^{i\frac{\theta}{2}} \end{bmatrix} Parameters:

CPHASE

CPHASE(
theta: CReal,
ctrl: Const[QBit],
target: Const[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: CPHASE=[100001000010000eiθ]CPHASE = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i\theta} \end{bmatrix} Parameters:

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: SWAP=[1000001001000001]SWAP = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} Parameters:

IDENTITY

IDENTITY(
target: Const[QArray[QBit]]
) -> None
[Qmod core-library function] Does nothing. This operation is represented by the following matrix: IDENTITY=[1001]nIDENTITY = {\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}} ^{\otimes n} Parameters:

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: U(θ,ϕ,λ,γ)=eiγ[cos(θ/2)ei(λ)sin(θ/2)eiϕsin(θ/2)ei(ϕ+λ)cos(θ/2)]U(\theta, \phi, \lambda, \gamma) = e^{i \gamma} \begin{bmatrix} cos(\theta/2) & -e^{i(\lambda)} sin(\theta/2) \\ e^{i\phi} sin(\theta/2) & e^{i(\phi + \lambda)} cos(\theta/2) \end{bmatrix} Parameters:

CCX

CCX(
ctrl: Const[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: CCX=[1000000001000000001000000001000000001000000001000000000100000010]CCX = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \end{bmatrix} Parameters: