Curriculum / Quantum Gates Deep Dive / Rotation Gates: Rx, Ry, Rz
Rotation Gates: Rx, Ry, Rz
Parameterized gates for arbitrary qubit rotations.
Rotation Gates: Rx, Ry, Rz
The rotation gates provide continuous control over qubit states. They're essential for variational quantum algorithms (VQE, QAOA) and parameterized circuits.
The Bloch Sphere Geometry
Every single-qubit state corresponds to a point on the Bloch sphere. The rotation gates spin a qubit around one of the three principal axes:
- •Rx(θ): rotates around the X axis (between |0⟩↔|1⟩ through the ±Y points, e.g. Rx(π/2)|0⟩ = |−i⟩)
- •Ry(θ): rotates around the Y axis (between |0⟩↔|1⟩ through a real superposition)
- •Rz(θ): rotates around the Z axis (changes phase without changing probabilities)
The Three Rotation Gates
Rx(θ)|0⟩ = cos(θ/2)|0⟩ − i·sin(θ/2)|1⟩ Ry(θ)|0⟩ = cos(θ/2)|0⟩ + sin(θ/2)|1⟩ (adds phase only)
import math
qc.rx(math.pi/2, 0) # 90° rotation around X
qc.ry(math.pi, 0) # 180° rotation around Y (same as Y gate)
qc.rz(math.pi/4, 0) # 45° rotation around Z (same as T gate)Special Cases: Pauli Gates
The Pauli gates are rotation gates with θ = π (180°):
| Rotation | Angle | Equivalent |
|---|---|---|
| Rx(π) | 180° around X | X gate (up to global phase) |
| Ry(π) | 180° around Y | Y gate (up to global phase) |
| Rz(π) | 180° around Z | Z gate (up to global phase) |
| Ry(π/2) | 90° around Y | Sends the start state to the same superposition as H (but Ry(π/2) is not H; H = X·Ry(π/2)) |
"Up to global phase" means the measurement statistics are identical: only the relative phase between |0⟩ and |1⟩ components matters.
Why Rotation Gates Matter for VQE/QAOA
In variational algorithms, the circuit contains parameters (angles) that a classical optimizer adjusts to minimize a cost function. Rotation gates are the natural parameterized gate:
theta = 0.7 # parameter, adjusted by optimizer
qc.ry(theta, 0)
qc.rz(theta * 2, 0)The circuit runs many times with different θ values until the optimizer finds the minimum energy configuration.
Ry(π/2) and H agree exactly on |0⟩: both produce (|0⟩+|1⟩)/√2. The difference shows on other inputs: H|1⟩ = (|0⟩−|1⟩)/√2 while Ry(π/2)|1⟩ = (−|0⟩+|1⟩)/√2. As operators they are related by H = X·Ry(π/2), not by a global phase. In circuits with subsequent interference, they are different gates.
This is the opening of the lesson. The full walkthrough, the interactive circuit, and the graded challenge continue inside myqubit.
How this lesson works
A hands-on coding challenge. You write Qiskit-compatible Python in the browser editor, run it instantly via WebAssembly, watch the circuit and Bloch sphere react, and pass automatic output checks. The AI tutor Qubitus gives Socratic hints if you get stuck.
Part of: Quantum Gates Deep Dive
Master single-qubit and multi-qubit gates. Understand rotations, phases, and the math behind every gate in Qiskit.
This lesson is part of Pro
Unlock Quantum Gates Deep Dive and all 10 tracks with Pro: $12.99/month, $79/year, or $97 lifetime. Start with the free track first if you are new.