Side-by-side comparison
RX vs RY vs RZ: Which Rotation Axis to Pick
RX, RY, and RZ are the three rotation-by-angle gates that parameterize the unit Bloch sphere. Together they decompose any single-qubit unitary — so in principle you only need two of the three. In practice each has a very different relationship to measurement, and that relationship drives which one appears in which algorithm.
Side by side
| Aspect | RX Gate (X-Rotation) | RY Gate (Y-Rotation) | RZ Gate (Z-Rotation) |
|---|---|---|---|
| Axis of rotation on the Bloch sphere | X axis — tips the state between the north/south poles through the +X side. | Y axis — tips the state between the north/south poles through the +Y side. | Z axis (vertical) — spins the state around the poles without changing latitude. |
| Effect on computational-basis measurement probabilities | Changes P(0) / P(1). At this becomes the X (NOT) gate: full flip. | Changes P(0) / P(1). At this becomes the Y gate: flip with a phase. | Does not change P(0) / P(1) — measurement probabilities are invariant. RZ is a pure phase rotation. |
| Complex amplitudes in the matrix | Has imaginary off-diagonal entries: -i . Introduces relative phase. | Real-only matrix: cos/sin, no i. Keeps amplitudes real when inputs are real. | Complex diagonal only: e^{±iθ/2}. Never touches magnitudes. |
| Preferred role in variational circuits (VQE/QAOA) | Less common as a lone parameterized gate because of its complex amplitudes; often paired with RZ. | The most common parameterized single-qubit gate in VQE/QAOA ansätze: real, cheap to differentiate, covers the Bloch sphere with RZ sandwiches. | The other half of the standard RZ·RY·RZ Euler decomposition used in QML and VQE. |
| Hardware-native behavior | Typically compiled to native Rϕ(± pulses plus RZ. | Often implemented as a virtual gate on platforms where RZ is 'free' (phase change on subsequent pulses). | On most superconducting-transmon hardware, RZ is virtual and takes zero physical time — the phase is absorbed into future microwave drive pulses. |
When to reach for which
- Use RY when you want real-valued coefficients and only need to change measurement probabilities (variational ansatz amplitude encoding, real-valued QML).
- Use RZ when the state is already on the equator and you need to add phase without moving probability mass (phase estimation, interference setup).
- Use RX when you need a rotation that produces complex amplitudes and is symmetric with the Y axis (physics-motivated Hamiltonian simulation, spin-½ time evolution).
- For a general single-qubit unitary, use U3 (RZ·RY·RZ) instead of stacking three separate rotations.
- On superconducting hardware, a pure RZ is near-free — prefer RZ where algebraically equivalent to save time.
Common trap
It is tempting to think RZ 'does nothing' because measurement probabilities in the computational basis don't change. But follow the RZ with a Hadamard and the hidden phase becomes visible as a flipped probability. RZ is invisible only until another gate converts the phase into amplitude — exactly how interference-based algorithms work.