Gates and angles across frameworks
Names, argument order and angle conventions for the 16 gates of the Circuit Builder, in five targets.
8 min read · reviewed December 2026
The full table
Each row is one gate. The code in each cell is generated by the converter, so it is exactly what the Convert tab writes.
| Gate | Qiskit | Cirq | PennyLane | OpenQASM 2.0 | OpenQASM 3.0 |
|---|---|---|---|---|---|
| Hadamard | qc.h(0) | cirq.H(q[0]) | qml.Hadamard(wires=0) | h q[0]; | h q[0]; |
| Pauli X | qc.x(0) | cirq.X(q[0]) | qml.PauliX(wires=0) | x q[0]; | x q[0]; |
| Pauli Y | qc.y(0) | cirq.Y(q[0]) | qml.PauliY(wires=0) | y q[0]; | y q[0]; |
| Pauli Z | qc.z(0) | cirq.Z(q[0]) | qml.PauliZ(wires=0) | z q[0]; | z q[0]; |
| S (quarter turn) | qc.s(0) | cirq.S(q[0]) | qml.S(wires=0) | s q[0]; | s q[0]; |
| S dagger | qc.sdg(0) | cirq.S(q[0]) ** -1 | qml.adjoint(qml.S)(wires=0) | sdg q[0]; | sdg q[0]; |
| T (eighth turn) | qc.t(0) | cirq.T(q[0]) | qml.T(wires=0) | t q[0]; | t q[0]; |
| T dagger | qc.tdg(0) | cirq.T(q[0]) ** -1 | qml.adjoint(qml.T)(wires=0) | tdg q[0]; | tdg q[0]; |
| Rotation about X | qc.rx(θ, 0) | cirq.rx(θ)(q[0]) | qml.RX(θ, wires=0) | rx(θ) q[0]; | rx(θ) q[0]; |
| Rotation about Y | qc.ry(θ, 0) | cirq.ry(θ)(q[0]) | qml.RY(θ, wires=0) | ry(θ) q[0]; | ry(θ) q[0]; |
| Rotation about Z | qc.rz(θ, 0) | cirq.rz(θ)(q[0]) | qml.RZ(θ, wires=0) | rz(θ) q[0]; | rz(θ) q[0]; |
| CNOT | qc.cx(0, 1) | cirq.CNOT(q[0], q[1]) | qml.CNOT(wires=[0, 1]) | cx q[0], q[1]; | cx q[0], q[1]; |
| Controlled Z | qc.cz(0, 1) | cirq.CZ(q[0], q[1]) | qml.CZ(wires=[0, 1]) | cz q[0], q[1]; | cz q[0], q[1]; |
| Controlled phase | qc.cp(θ, 0, 1) | cirq.CZ(q[0], q[1]) ** (θ / pi) | qml.ControlledPhaseShift(θ, wires=[0, 1]) | cu1(θ) q[0], q[1]; | cp(θ) q[0], q[1]; |
| SWAP | qc.swap(0, 1) | cirq.SWAP(q[0], q[1]) | qml.SWAP(wires=[0, 1]) | swap q[0], q[1]; | swap q[0], q[1]; |
| Toffoli | qc.ccx(0, 1, 2) | cirq.CCX(q[0], q[1], q[2]) | qml.Toffoli(wires=[0, 1, 2]) | ccx q[0], q[1], q[2]; | ccx q[0], q[1], q[2]; |
Rotation conventions
The rotation gates RX, RY and RZ of θ are defined the same way in all five targets: RX(θ) = exp(−iθX/2), and likewise for Y and Z. The angle is in radians. The converter writes common angles as fractions of pi, such as pi/3.
| Radians | Written as | Cirq CP |
|---|---|---|
| 3.141593 | pi | cirq.CZ(q[0], q[1]) |
| 1.570796 | pi/2 | cirq.CZ(q[0], q[1]) ** (1/2) |
| 1.047198 | pi/3 | cirq.CZ(q[0], q[1]) ** (1/3) |
| 0.785398 | pi/4 | cirq.CZ(q[0], q[1]) ** (1/4) |
| 2.356194 | 3*pi/4 | cirq.CZ(q[0], q[1]) ** (3/4) |
| -1.570796 | -pi/2 | cirq.CZ(q[0], q[1]) ** (-1/2) |
| 0.500000 | 0.500000 | cirq.CZ(q[0], q[1]) ** (0.159155) |
The controlled-phase gate
Controlled phase applies a phase e^(iθ) to the state where both qubits are 1. In Qiskit it is cp, in OpenQASM 3.0 cp, in OpenQASM 2.0 cu1 and in PennyLane ControlledPhaseShift. Cirq expresses it as a CZ raised to the power θ/π, because CZ is the case θ = π.
Daggers
S† and T† are single gates in Qiskit and OpenQASM (sdg, tdg). In PennyLane they are written with qml.adjoint, and in Cirq as the gate raised to the power −1.
Global phase
RZ(θ) and a phase gate differ by a global phase. Global phase cannot be observed in measurements, so the outcome chances are identical, but a tool that prints the state vector may show a different overall phase.
Try it
Questions
Why is there no Toffoli in some tutorials?
It decomposes into smaller gates, and some tools do so automatically. The converter keeps it as one gate.
Do all tools support CCX?
All five targets have a three-qubit Toffoli gate. Real hardware usually compiles it into one- and two-qubit gates.
Are the angle names always the same?
The names differ (cp, cu1, ControlledPhaseShift) but the meaning is the same. Check the documentation of the version you use.
Read next
Sources and further reading
- A. W. Cross, L. S. Bishop, J. A. Smolin and J. M. Gambetta, “Open quantum assembly language” (2017)
- A. Cross et al., “OpenQASM 3: A broader and deeper quantum assembly language” (2022)
- Qiskit, Cirq and PennyLane documentation
- Frameworks overview on this site
- Circuit Builder gate reference
Check the original sources for exact citations.