GateIntermediateRotation and phase gates

P Phase Gate P(λ)

Phase Gate P(λ)

The phase gate P(λ) = diag(1, e^{iλ}) multiplies the |1⟩ amplitude by e^{iλ}; Z, S and T are special cases.

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$$|0\rangle$
$|1\rangle$$e^{i\lambda}|1\rangle$

Useful identities

  • $P(\pi)=Z,\;P(\pi/2)=S,\;P(\pi/4)=T$
  • $P(\lambda)=e^{i\lambda/2}R_Z(\lambda)$
  • $P(\alpha)P(\beta)=P(\alpha+\beta)$

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

$$P(\lambda)=\begin{pmatrix}1&0\\0&e^{i\lambda}\end{pmatrix}$$

The Phase Gate $P(\lambda)$ leaves $|0\rangle$ unchanged and multiplies $|1\rangle$ by $e^{i\lambda}$. In older versions of Qiskit and in OpenQASM 2 it was called u1; its current name is p.

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 is a rotation by $\lambda$ about the $z$ axis, exactly like $R_Z(\lambda)$, because $P(\lambda)=e^{i\lambda/2}R_Z(\lambda)$. Special cases: $P(\pi)=Z$, $P(\pi/2)=S$, $P(\pi/4)=T$ and $P(-\pi/2)=S^\dagger$. Its composition is additive: $P(\alpha)P(\beta)=P(\alpha+\beta)$.

Why is it sometimes preferred to $R_Z$? Because it adds no phase to $|0\rangle$; so its controlled version $CP(\lambda)$ adds the phase $e^{i\lambda}$ to $|11\rangle$ alone, which is what the quantum Fourier transformQuantum Fourier Transform: The quantum Fourier transform (QFT) is the discrete Fourier transform applied to the amplitudes of n qubits, implemented with O(n^2) gates; it is a key component of phas… and phase estimation need.

In this lab's phase estimation, $U=P(2\pi\varphi)$ is used, with eigenvector $|1\rangle$ and eigenvalue $e^{2\pi i\varphi}$; applying $U^{2^j}$ is simply $P(2\pi\varphi\,2^j)$. In the ZZ Feature Map, feature $x_i$ is encoded by the gate $P(2x_i)$ after a Hadamard.

On hardware, like $R_Z$, the phase gate is usually implemented by adjusting the phase frame in software without a separate physical pulse, because the two differ only by a global phase.

Example

Take $\lambda=2\pi\cdot0.3125$ and the state $|1\rangle$ (the eigenvector):
$$P(\lambda)|1\rangle=e^{2\pi i\,0.3125}|1\rangle.$$
For this state the phase is global and cannot be measured directly; but if we make the gate controlled by a qubit in $|+\rangle$, it turns into a relative phase: $\frac{1}{\sqrt2}(|0\rangle+e^{2\pi i\,0.3125}|1\rangle)|1\rangle$. This is the “phase kickback” on which phase estimation is built.

Live simulation

Loading the simulator…

In code

Qiskit
qc.p(lam, 0)
OpenQASM 2
p(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