Rx, Ry and Rz: rotating by any angle, and preparing any state

The continuous rotation gates, their half-angle matrices, and a two-gate recipe for preparing any point on the sphere.

7 min read · reviewed December 2026

Three rotations, any angle

Rx(θ), Ry(θ) and Rz(θ) rotate the Bloch vector by the angle θ about the x, y and z axes. Their matrices use θ/2 inside the cosine and sine, again because sphere angles are double state angles. For example Ry(θ) = [[cos θ/2, −sin θ/2], [sin θ/2, cos θ/2]].

Rx(π) = X, Ry(π) = Y, Rz(π) = Z (each up to a global phase)

Rz(π/2) = S, Rz(π/4) = T (up to a global phase)

Ry sets the probabilities

Starting from |0⟩, Ry(θ) tilts the vector down by θ in the x–z plane. The chance of reading 1 is sin²(θ/2). The table shows common angles.

Ry(θ) applied to |0⟩. The chance of reading 1 is sin²(θ/2).
θx, y, zP(1)
0°0.00, 0.00, 1.000.0%
30°0.50, 0.00, 0.876.7%
45°0.71, 0.00, 0.7114.6%
60°0.87, 0.00, 0.5025.0%
90°1.00, 0.00, 0.0050.0%
120°0.87, 0.00, -0.5075.0%
150°0.50, 0.00, -0.8793.3%
180°0.00, 0.00, -1.00100.0%

A recipe for any state

To prepare the state at angles (θ, φ) from |0⟩, apply Ry(θ) and then Rz(φ). The first sets the height, the second turns the vector around to the right longitude. Try it in the lab: choose Ry with an angle, then Rz with another, and compare the result with the same θ and φ set in the Set state tab.

Any single-qubit gate from three rotations

Any single-qubit gate can be written, up to a global phase, as Rz(α) Ry(β) Rz(γ). This is the Z–Y–Z decomposition, and compilers use it to turn arbitrary gates into the rotations that hardware implements.

Where rotation gates are used

  • Loading data: encoding a number into the angle of a qubit.
  • Variational algorithms: circuits whose angles are tuned by an optimiser.
  • Calibration: experimentalists scan the angle and watch the probability oscillate.
  • Hardware: on many devices, Rz is nearly free because it can be done by shifting the phase reference of later pulses.

Try it

Questions

Is Ry(π/2) the same as H?

No. Ry(π/2) takes |0⟩ to |+⟩ like H does, but it rotates other states differently. H is a half-turn about a tilted axis.

Why is a 720-degree rotation needed to return the matrix to itself?

The matrix uses half angles, so a 360-degree turn gives −1 times the identity, a global phase. The sphere cannot show it, and it has no effect on measurements.

Read next

Sources and further reading

  • F. Bloch, “Nuclear induction” (1946)
  • M. Nielsen and I. Chuang, Quantum Computation and Quantum Information, section 1.2 and chapter 4
  • C. Dawson and M. Nielsen, “The Solovay–Kitaev algorithm” (2005)
  • Dictionary: Bloch sphere

Check the original sources for exact citations.