U3 General Single-Qubit Gate
The three-parameter gate that realizes any single-qubit unitary up to global phase, the universal one-qubit primitive.
Definition
The U3(θ, φ, λ) gate — recently renamed simply U in Qiskit — parameterizes every single-qubit unitary with three Euler angles. Any one-qubit operation, up to an overall global phase, is some U3, so it is the most general single-qubit building block a compiler needs.
Matrix
Here θ sets the polar rotation angle on the Bloch sphere while φ and λ set azimuthal phases before and after. Choosing angles recovers familiar gates: U3(π,0,π) = X, U3(π/2,0,π) = H, U3(0,0,λ) = phase gate P(λ).
ZYZ structure
U3 corresponds to the Euler ZYZ decomposition: U3(θ,φ,λ) = RZ(φ)·RY(θ)·RZ(λ) up to a global phase. This is why exactly three real parameters are needed — two for the axis direction and one for the rotation angle. See ZYZ decomposition.
import numpy as np
def u3(theta, phi, lam):
c, s = np.cos(theta/2), np.sin(theta/2)
return np.array([[c, -np.exp(1j*lam)*s],
[np.exp(1j*phi)*s, np.exp(1j*(phi+lam))*c]])
Role in compilation
During transpilation, an arbitrary sequence of single-qubit gates on one wire is collapsed into a single U3 by multiplying the matrices and extracting Euler angles. This gate-fusion step minimizes single-qubit gate count. On hardware that lacks a direct U3, it is further broken into the native rotations U1, U2, or virtual-Z plus √X. See U2 and U1.