Rotates around the Z axis by angle θ.
RZ adjusts the relative phase between |0⟩ and |1⟩ by a continuously tunable angle. Like the Z gate, it does not change measurement probabilities in the computational basis. The effect is purely in the phase, which means it is invisible until a later gate (like H) converts the phase difference into a measurable probability change. RZ is often the cheapest gate to implement on real quantum hardware, sometimes even “free” as a virtual gate.
RZ(θ) = exp(−iθZ/2) = diag(exp(−iθ/2), exp(iθ/2)). It multiplies |0⟩ by exp(−iθ/2) and |1⟩ by exp(iθ/2), creating a relative phase of θ between the two basis states. At θ = π, RZ(π) = −iZ, which is the Z gate up to global phase. RZ is diagonal and commutes with all other Z-rotations.
No change to computational-basis measurement probabilities.
Phase-only change — visible after a mixing gate.
Rotates by θ around the Z axis. The poles stay fixed. Equatorial states rotate by θ, adjusting relative phase between |0⟩ and |1⟩.
Because RZ does not change measurement odds, it might seem like it does nothing. But phase is the lifeblood of quantum algorithms — every interference effect depends on carefully tuned phases.
RZ is arguably the most practical gate. On many quantum hardware platforms, Z-rotations are implemented virtually by adjusting the reference frame, making them error-free. Understanding RZ is key to efficient circuit compilation.
Why is RZ sometimes called a “virtual gate” on real hardware?