RZ rotation

Rotates about the Z axis, which changes relative phase and leaves probabilities alone.

Rotation · 1 qubit · reviewed November 2026

Matrix

[ e^(−iθ/2)   0        ]
[ 0        e^(iθ/2) ]

What it does

|+⟩, θ = π/2→a state on the equator, a quarter-turn from |+⟩

In plain words

RZ is a pure phase rotation. On many real devices it is implemented in software by changing the reference frame, so it is nearly free and error-free.

Identities

  • RZ(π) = −i·Z
  • RZ(θ) differs from a phase gate only by a global phase

Where it is used

  • Phase control
  • Virtual Z gates on hardware
  • Quantum Fourier transform pieces

Code

# Qiskit
qc.rz(theta, 0)

// OpenQASM 2.0
rz(theta) q[0];

Qiskit prints qubit 0 on the right of a bitstring. The builder prints it on the left.

Related gates

Questions

Why is RZ often free on hardware?

Because it can be absorbed into the phase of later drive pulses, so no physical operation is needed.

Try the Rz(θ) gate in the Circuit Builder →