GateIntermediateRotation and phase gates

RZ RZ Rotation Gate

RZ Rotation Gate

RZ(λ) = e^{−iλZ/2} rotates about the z axis, changing only the relative phase; equal to P(λ) up to a global phase.

The unitary matrix

Computing the matrix with the simulation engine…

Computed by the same engine that runs the circuits, with π/2 for the parameters. Multi-qubit gates are shown in textbook order (control qubit first).

Its effect on the basis states

InputOutput
$|0\rangle$$e^{-i\lambda/2}|0\rangle$
$|1\rangle$$e^{i\lambda/2}|1\rangle$

Useful identities

  • $R_Z(\lambda)=e^{-i\lambda/2}P(\lambda)$
  • $HR_Z(\theta)H=R_X(\theta)$
  • $R_Z(\pi)=-iZ$

On the Bloch sphere: rotation by λ about the z axis

$$R_Z(\lambda)=e^{-i\lambda Z/2}=\begin{pmatrix}e^{-i\lambda/2}&0\\0&e^{i\lambda/2}\end{pmatrix}$$

The RZ Rotation gateRZ Rotation Gate: The gate R_Z(λ)=e^-iλ Z/2 rotates the state about the z axis, changing only the relative phase; it equals P(λ) up to a global phase. is defined by $R_Z(\lambda)=e^{-i\lambda Z/2}=\mathrm{diag}(e^{-i\lambda/2},e^{i\lambda/2})$. It is diagonal, so it does not change the computational measurement probabilities; it adds a phase difference of $\lambda$ between $|0\rangle$ and $|1\rangle$.

On the Bloch sphereBloch Sphere: The Bloch sphere is a geometric representation of single-qubit states: pure states are points on the surface of a unit sphere, mixed states are points inside it, and sin… it rotates the vector by an angle $\lambda$ about the $z$ axis, i.e. it increases the azimuthal angle $\phi$ by $\lambda$ while the polar angle stays the same. The two poles stay fixed.

Its relation to the phase gate: $R_Z(\lambda)=e^{-i\lambda/2}P(\lambda)$, so the difference is only a global phase, which has no effect on measurement when the gate is applied on its own. But the difference becomes important when the gate is made controlled: $CR_Z$ and $CP$ are not equal, because the global phase becomes a relative phase with respect to the control qubitQubit: The qubit is the unit of quantum information: a two-level system whose state is a unit vector α0⟩+β1⟩ in ℂ^2..

Uses: on IBM processors rz is usually implemented “virtually” by adjusting the phase frame in software (Virtual Z), so it is almost free. In QAOA the cost layer consists of $R_{ZZ}$ terms, which are $R_Z$ surrounded by two CNOT gates. Together with $R_Y$ it suffices to represent any single-qubit gate: $U=e^{i\alpha}R_Z(\beta)R_Y(\gamma)R_Z(\delta)$ (the ZYZ Euler decomposition).

Example

Apply $R_Z(\pi/2)$ to $|+\rangle$:
$$R_Z(\tfrac\pi2)|+\rangle=\tfrac{1}{\sqrt2}\left(e^{-i\pi/4}|0\rangle+e^{i\pi/4}|1\rangle\right)=e^{-i\pi/4}\,\tfrac{1}{\sqrt2}(|0\rangle+i|1\rangle)=e^{-i\pi/4}|{+i}\rangle.$$
The result is $|{+i}\rangle$ up to a global phase, the same as $S|+\rangle$; the Bloch vector rotated from $(1,0,0)$ to $(0,1,0)$.

Live simulation

Loading the simulator…

In code

Qiskit
qc.rz(lam, 0)
OpenQASM 2
rz(lambda) q[0];

Related topics

References

  1. Michael A. Nielsen; Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press doi:10.1017/CBO9780511976667The standard reference for quantum computing; the Crossref record gives 2012 for the Cambridge Core online edition.
  2. IBM Quantum (2025). Qiskit SDK API documentation. IBM Quantum Documentation quantum.cloud.ibm.com