Rotation gates: Rx, Ry and Rz

The rotation gates Rx(θ)R_x(\theta), Ry(θ)R_y(\theta) and Rz(θ)R_z(\theta) turn the sphere by any angle θ about the x, y or z axis. The Pauli gates, S and T are special cases, and together these rotations can make any one-qubit gate.

In the app, R(θ) ▾ on the gate bar picks the axis and the angle. A ghost arrow previews the result while you drag the slider; Apply plays it.

A Bloch sphere: the x-rotation by 60 degrees turns the arrow from the top 60 degrees toward |−i⟩.|0⟩|1⟩|+⟩|−⟩|+i⟩|−i⟩
Rx(60∘)R_x(60^\circ) tilts ∣0⟩|{0}\rangle by 60° about the x axis, toward ∣−i⟩|{-i}\rangle. Now P(0) is 75%.

The matrices

Rx(θ)=[cos⁡θ2−isin⁡θ2−isin⁡θ2cos⁡θ2],Ry(θ)=[cos⁡θ2−sin⁡θ2sin⁡θ2cos⁡θ2],Rz(θ)=[e−iθ/200eiθ/2]R_x(\theta) = \begin{bmatrix} \cos\frac{\theta}{2} & -i\sin\frac{\theta}{2} \\ -i\sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{bmatrix}, \quad R_y(\theta) = \begin{bmatrix} \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{bmatrix}, \quad R_z(\theta) = \begin{bmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{bmatrix}

All three are the general rotation Rn^(θ)=cos⁡θ2 I−isin⁡θ2 (n^⋅σ⃗)R_{\hat n}(\theta) = \cos\tfrac{\theta}{2}\, I - i\sin\tfrac{\theta}{2}\,(\hat n \cdot \vec\sigma) with the axis n^\hat n along x, y or z, where σ⃗=(X,Y,Z)\vec\sigma = (X, Y, Z).

Half angles, again

The matrices use θ/2\theta/2 for the same reason the Bloch sphere does: a turn of θ on the sphere is a turn of θ/2 between state vectors. One surprise follows. A full turn, Rx(360∘)R_x(360^\circ), brings every arrow back where it started, but its matrix is −I-I, not II: the state comes back with a global phase of −1-1. Only two full turns give II.

The named gates as rotations

Each named gate is a rotation times a global phase, which doesn't change how it turns the sphere:

GateAs a rotation
XXX=i Rx(180∘)X = i\,R_x(180^\circ)
YYY=i Ry(180∘)Y = i\,R_y(180^\circ)
ZZZ=i Rz(180∘)Z = i\,R_z(180^\circ)
SSS=eiπ/4 Rz(90∘)S = e^{i\pi/4}\,R_z(90^\circ)
TTT=eiπ/8 Rz(45∘)T = e^{i\pi/8}\,R_z(45^\circ)
S†S^\daggerS†=e−iπ/4 Rz(−90∘)S^\dagger = e^{-i\pi/4}\,R_z(-90^\circ)
T†T^\daggerT†=e−iπ/8 Rz(−45∘)T^\dagger = e^{-i\pi/8}\,R_z(-45^\circ)

Any gate from rotations

Every one-qubit gate can be written as three rotations, about z, then y, then z, times a global phase. These are its Z-Y-Z Euler angles:

U=eiα Rz(β) Ry(γ) Rz(δ)U = e^{i\alpha}\,R_z(\beta)\,R_y(\gamma)\,R_z(\delta)

Or as one rotation, by some angle about some axis: that's what the app's Gate panel reports for every gate, and what the Gate Lab finds for any sequence.

Try it

See also: Gates are rotations · S and T · The Gate Lab