[Qmod core-library function]Performs the phase gate on a qubit.This operation is represented by the following matrix:PHASE(θ)=[100eiθ]Parameters:
Name
Type
Description
Default
theta
CReal
The phase angle in radians.
required
target
Const[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:RX(θ)=e−i2θX=[cos(2θ)−isin(2θ)−isin(2θ)cos(2θ)]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:RY(θ)=e−i2θY=[cos(2θ)sin(2θ)−sin(2θ)cos(2θ)]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: 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(θ)=e−i2θZ=[e−i2θ00ei2θ]Parameters:
[Qmod core-library function]Performs a rotation of θ around the cos(ϕ){^x}+sin(ϕ){^y} axis on a qubit.This operation is represented by the following matrix:R(θ,ϕ)=e−i2θ(cos(ϕ)X+sin(ϕ)Y)=[cos(2θ)−ieiϕsin(2θ)−ie−iϕsin(2θ)cos(2θ)]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.
[Qmod core-library function]Performs the XX rotation gate on a pair of qubits.This operation is represented by the following matrix:RXX(θ)=e−i2θX⊗X=cos(2θ)00−isin(2θ)0cos(2θ)−isin(2θ)00−isin(2θ)cos(2θ)0−isin(2θ)00cos(2θ)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.
[Qmod core-library function]Performs the YY rotation gate on a pair of qubits.This operation is represented by the following matrix:RYY(θ)=e−i2θY⊗Y=cos(2θ)00−sin(2θ)0cos(2θ)sin(2θ)00sin(2θ)cos(2θ)0−sin(2θ)00cos(2θ)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.
[Qmod core-library function]Performs the ZZ rotation gate on a pair of qubits.This operation is represented by the following matrix:RZZ(θ)=e−i2θZ⊗Z=e−i2θ0000ei2θ0000ei2θ0000e−i2θParameters:
Name
Type
Description
Default
theta
CReal
The rotation angle in radians.
required
target
Const[QArray[QBit, Literal[2]]]
The pair of qubits to apply the ZZ rotation gate to.
required
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=21100001000011001−1Parameters:
Name
Type
Description
Default
ctrl
Const[QBit]
The control qubit.
required
target
QBit
The qubit to apply the Hadamard gate on.
required
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=1000010000010010Parameters:
Name
Type
Description
Default
ctrl
Const[QBit]
The control qubit.
required
target
QBit
The qubit to apply the Pauli-X gate on.
required
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=10000100000i00−i0Parameters:
[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=100001000010000−1Parameters:
[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θ)−i∗sin(2θ)00−i∗sin(2θ)cos(2θ)Parameters:
[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θ)00−sin(2θ)cos(2θ)Parameters:
[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=1000010000e−i2θ0000ei2θParameters:
[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θParameters:
Name
Type
Description
Default
theta
CReal
The rotation angle in radians.
required
ctrl
Const[QBit]
The control qubit.
required
target
Const[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:SWAP=1000001001000001Parameters:
Name
Type
Description
Default
qbit0
QBit
The first qubit.
required
qbit1
QBit
The second qubit.
required
IDENTITY
IDENTITY(
target: Const[QArray[QBit]]
) -> None
[Qmod core-library function]Does nothing.This operation is represented by the following matrix:IDENTITY=[1001]⊗nParameters:
[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)]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.
[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=1000000001000000001000000001000000001000000001000000000100000010Parameters:
Name
Type
Description
Default
ctrl
Const[QArray[QBit, Literal[2]]]
The control qubits.
required
target
QBit
The qubit to apply the conditioned Pauli-X gate on.