Standard Gates
Basic Gates
The following are the most common or well-known gates in quantum computing. All of these allow for any number of target_qubits
.
I
: Identity gate (this has no effect on a qubit but might be used for clarification)X
: Standard X gateY
: Standard Y gateZ
: Standard Z gateS
: Standard S gateT
: Standard T gateH
: Standard Hadamard Gate
R-value Gates
The following are R-value gates that require an rvalue
(or rvalue_expr
, rvalue_dyadic_denom
) to be specified in the gate definition. For example:
{
"gate_type": "Rx",
"rvalue": 0.4,
"target_qubits": [1]
}
R1
: Standard R1 gateRx
: Standard Rx gateRy
: Standard Ry gateRz
: Standard Rz gate
Controlled Gates
Note that any of the above gates can be controlled by simply specifying the control_qubits
and a single target_qubit
in the gate definition. However, the following are provided for compatibility and standardization with other systems.
-
CNOT
: The controlled NOT gate. Note that this is identical to the following gate definition, where the 0 qubit is the control and the 1 qubit is the target:{ "gate_type": "X", "control_qubits": [0], "target_qubits": [1] }
-
CZ
: The controlled Z gate. Note that this is identical to the following gate definition, where the 0 qubit is the control and the 1 qubit is the target:{ "gate_type": "Z", "control_qubits": [0], "target_qubits": [1] }
Measurement Gates
Measurement gates collapse the state of a qubit. Refer to the rand_source_type
gate object property to learn more about the randomness used to simulate quantum collapse.
M
orMz
: Measurement gate in the Z-basis.Mx
: Measurement gate in the X-basis.My
: Measurement gate in the Y-basis.Mz
: Measurement gate in the Z-basis.
Miscellaneous Gates
SWAP
: Swaps the two qubits specified intarget_qubits
.