QuantumSimulator
Interactive Course
Interactive chapters from intuition to mastery
Structured Lessons
Eight modules with formulas and self-checks
Quantum Brain
Navigate lessons, laws, gates, devices, and tools
Guided Experiments
Hands-on circuits that teach one idea each
Circuit Lab
Build circuits, run them, and see the results
Gate Reference
Quick reference for all quantum gates
Cryostat Studio
3D cryostat design and simulation
Component Catalog
Browse all cryostat components
System Checks
Check your design for errors
Menu
physics
Interactive Course
Interactive chapters from intuition to mastery
Structured Lessons
Eight modules with formulas and self-checks
Quantum Brain
Navigate lessons, laws, gates, devices, and tools
Guided Experiments
Hands-on circuits that teach one idea each
simulator
Circuit Lab
Build circuits, run them, and see the results
Gate Reference
Quick reference for all quantum gates
wiringStudio
Cryostat Studio
3D cryostat design and simulation
Component Catalog
Browse all cryostat components
System Checks
Check your design for errors
Home/Quantum Physics/Lessons/RZ Gate (Z-Rotation)
Rz

RZ Gate (Z-Rotation)

RotationSingle-qubitZ-rot

Rotates the qubit around the Z axis of the Bloch sphere by a chosen angle θ.

Intuition

RZ shifts the relative phase between ∣0⟩ and ∣1⟩ by a continuously tunable angle θ. Relative phase is the difference in the complex-number angles of the two amplitudes. It determines how the ∣0⟩ and ∣1⟩ components interfere when combined by a later gate. Like Z, RZ does not change measurement probabilities in the computational basis. The effect is purely in the phase. It becomes visible only after a gate like H converts the phase difference into a probability change. On many real quantum processors, RZ is implemented as a "virtual gate" by adjusting the classical control frame, making it essentially free of errors.

Matrix representation
(e−iθ/20​0eiθ/2​)
Action on states
Rz​(θ)∣ψ⟩=e−iθZ/2∣ψ⟩
Bloch sphere
|+⟩
→
RZ(π/2)|+⟩
Circuit
q0HRzH
State comparison
Before RZ Gate
|+⟩
|0\u27E9
50%
|1\u27E9
50%
Bloch: (1.00, 0.00, 0.00)
→
After RZ Gate
RZ(π/2)|+⟩
|0\u27E9
50%
|1\u27E9
50%
Bloch: (0.00, 1.00, 0.00)
Full technical statement

RZ(θ)=exp(−iθZ/2)= diag(exp(−iθ/2),exp(iθ/2)). "Diag" means a diagonal matrix: one that acts on each basis state independently, multiplying ∣0⟩ by exp(−iθ/2) and ∣1⟩ by exp(iθ/2). This creates 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 therefore commutes with all other Z-rotations. Two Z-rotations in sequence simply add their angles: RZ(α) RZ(β)= RZ(α+β).

What changes in measurements

No change to measurement probabilities in the computational basis.

What stays hidden until later

The relative phase between ∣0⟩ and ∣1⟩ shifts by θ. This becomes visible after a mixing gate converts phase into probability.

Bloch sphere

Rotates the Bloch vector by θ around the Z axis. The poles (∣0⟩ and ∣1⟩ stay fixed. Equatorial states rotate by θ, shifting the relative phase.

Step-by-step example

Tuning phase for interference

  1. 1Start with ∣+⟩=(∣0⟩+∣1⟩)/2​.
  2. 2Apply RZ(π/2). Each basis state picks up a different phase factor. The relative phase between ∣0⟩ and ∣1⟩ is now π/2.
  3. 3Measure in the computational basis. The probabilities are still 50/50 because RZ only changes phase, not amplitudes.
  4. 4Apply H. Hadamard converts the phase difference into a probability bias, shifting the measurement outcome away from 50/50.
Where this gate appears
  • Fine-tuning phase in variational quantum circuits
  • Quantum Fourier Transform, where each controlled rotation is an RZ at a specific angle
  • Virtual Z gates on superconducting hardware, implemented by adjusting the microwave pulse frame at zero error cost
  • Euler decomposition: any single-qubit gate = RZ RY RZ
Connected gates
  • RZ(π) = −iZ — the Z gate up to global phase
  • RZ(π/2) equals the S (Phase) gate up to global phase
  • RZ(π/4) equals the T gate up to global phase
  • All RZ gates commute: RZ(α) RZ(β) = RZ(α+β), because they all rotate around the same axis
Tempting but wrong

It is tempting to think RZ does nothing because the measurement histogram looks unchanged. That sounds reasonable because the probabilities truly do not change. What actually happens is that RZ shifts the relative phase, and relative phase is what drives every interference effect in quantum computing. Without precise phase control, no quantum algorithm works.

Why this gate matters for what comes next

RZ is arguably the most practical gate. On many superconducting quantum processors, Z-rotations are implemented by adjusting the classical reference frame rather than pulsing the qubit physically. This makes them virtually error-free and instantaneous. Understanding RZ is key to efficient circuit compilation.

Test your understanding

Why is RZ sometimes called a "virtual gate" on real hardware?

Quick reference →↗ Nielsen and Chuang, Quantum Computation and Quantum Information
←
Previous
RY Gate
Next
U3 Gate
→
← Back to all lessons