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.

Every gate of the Circuit Builder in every target, with θ standing for an angle in radians.
GateQiskitCirqPennyLaneOpenQASM 2.0OpenQASM 3.0
Hadamardqc.h(0)cirq.H(q[0])qml.Hadamard(wires=0)h q[0];h q[0];
Pauli Xqc.x(0)cirq.X(q[0])qml.PauliX(wires=0)x q[0];x q[0];
Pauli Yqc.y(0)cirq.Y(q[0])qml.PauliY(wires=0)y q[0];y q[0];
Pauli Zqc.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 daggerqc.sdg(0)cirq.S(q[0]) ** -1qml.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 daggerqc.tdg(0)cirq.T(q[0]) ** -1qml.adjoint(qml.T)(wires=0)tdg q[0];tdg q[0];
Rotation about Xqc.rx(θ, 0)cirq.rx(θ)(q[0])qml.RX(θ, wires=0)rx(θ) q[0];rx(θ) q[0];
Rotation about Yqc.ry(θ, 0)cirq.ry(θ)(q[0])qml.RY(θ, wires=0)ry(θ) q[0];ry(θ) q[0];
Rotation about Zqc.rz(θ, 0)cirq.rz(θ)(q[0])qml.RZ(θ, wires=0)rz(θ) q[0];rz(θ) q[0];
CNOTqc.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 Zqc.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 phaseqc.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];
SWAPqc.swap(0, 1)cirq.SWAP(q[0], q[1])qml.SWAP(wires=[0, 1])swap q[0], q[1];swap q[0], q[1];
Toffoliqc.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.

How the converter writes angles, and the Cirq exponent used for the controlled-phase gate.
RadiansWritten asCirq CP
3.141593picirq.CZ(q[0], q[1])
1.570796pi/2cirq.CZ(q[0], q[1]) ** (1/2)
1.047198pi/3cirq.CZ(q[0], q[1]) ** (1/3)
0.785398pi/4cirq.CZ(q[0], q[1]) ** (1/4)
2.3561943*pi/4cirq.CZ(q[0], q[1]) ** (3/4)
-1.570796-pi/2cirq.CZ(q[0], q[1]) ** (-1/2)
0.5000000.500000cirq.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

Check the original sources for exact citations.