Z-Y Decomposition of Single-Qubit Gates

A single-qubit gate is a 2×22\times 2 unitary matrix, and the space of such matrices looks, at first, like a four-parameter thicket with no obvious handles. The Z-Y decomposition is the theorem that tames it: every single-qubit unitary can be written as a global phase followed by three rotations about just two fixed axes — spin about zz, tilt about yy, spin about zz again. It is the exact quantum echo of the Euler angles that orient a spinning top, transplanted from classical rigid bodies to the Bloch sphere. The statement (Nielsen & Chuang, Theorem 4.1) is that there exist real numbers α,β,γ,δ\alpha,\beta,\gamma,\delta with U=eiαRz(β)Ry(γ)Rz(δ)U = e^{i\alpha}R_z(\beta)R_y(\gamma)R_z(\delta). The proof is constructive rather than abstract: unitarity forces the rows and columns of UU to be orthonormal, and that single constraint is enough to read the four angles straight off the matrix entries. Three angles is not one too few or one too many — a 2×22\times 2 unitary carries four real parameters, one of which is the physically invisible global phase, leaving exactly three for the rotation. The decomposition earns its keep twice over. As a normal form it turns any abstract gate into a recipe of hardware-native pulses. As an algebraic identity it splits into the corollary U=eiαAXBXCU = e^{i\alpha}AXBXC with ABC=IABC = I, and those two interleaved XX's are precisely what a pair of CNOTs supplies inside a controlled-UU circuit — the bridge from an abstract two-qubit gate to a construction any real quantum computer can run.

Key takeaways
  • Any single-qubit unitary factors as U=eiαRz(β)Ry(γ)Rz(δ)U = e^{i\alpha}R_z(\beta)R_y(\gamma)R_z(\delta): a global phase and three rotations about only two axes, the zz-yy-zz Euler convention applied to a qubit.
  • The three angles β,γ,δ\beta,\gamma,\delta match the three physical degrees of freedom exactly: U(2)U(2) has four real parameters, the global phase α\alpha removes one, leaving three.
  • Two non-parallel axes generate all of SU(2)SU(2) — the middle RyR_y tilts the pole to any latitude and the flanking RzR_z's point and orient it, so a third axis would be redundant.
  • The corollary U=eiαAXBXCU = e^{i\alpha}AXBXC with ABC=IABC = I is the standard recipe for building any controlled-UU from two CNOTs, three single-qubit gates, and one phase on the control.
  • The global phase α\alpha, invisible for a lone qubit, becomes an observable relative phase under control — dropping it silently breaks the controlled-UU construction.
  • Key idea: two non-parallel rotation axes generate all of SU(2)SU(2) — a zz-rotation, a yy-rotation, then a zz-rotation reproduce any single-qubit unitary up to global phase, with three Euler angles matching the three physical degrees of freedom.
The core insight

Two non-parallel rotation axes generate all of SU(2)SU(2): a zz-rotation, then a yy-rotation, then a zz-rotation reproduce any single-qubit unitary up to global phase, with three Euler angles exactly matching the three physical degrees of freedom.

Where this lives today

The Z-Y decomposition is not a textbook curiosity — it is the innermost loop of every quantum compiler. When a transpiler such as Qiskit lowers an arbitrary single-qubit gate to hardware, it emits a U3(θ,ϕ,λ)U3(\theta,\phi,\lambda) instruction, and that gate is literally the zz-yy-zz Euler form U3=Rz(ϕ)Ry(θ)Rz(λ)U3 = R_z(\phi)R_y(\theta)R_z(\lambda) up to phase convention. On superconducting hardware the payoff is dramatic because of the virtual-Z trick (McKay et al., 2017): an RzR_z rotation need not be a physical pulse at all — it is realized for free by relabelling the phase of every subsequent microwave drive. So a general single-qubit gate costs only the one physical pulse of the middle RyR_y, with both RzR_z's absorbed into software phase bookkeeping — arbitrary single-qubit gates run at essentially the cost of one calibrated pulse. The corollary reaches even further. Every controlled-UU in a compiled circuit — controlled-phase gates in the quantum Fourier transform, controlled rotations in phase estimation — is realized through the two-CNOT ABC template, and the count of two entangling gates per controlled-UU is a hard budget that shapes how algorithms are written for noisy hardware, where CNOTs dominate the error. When a device is characterized the same decomposition runs in reverse, factoring a measured process matrix into (α,β,γ,δ)(\alpha,\beta,\gamma,\delta) to separate axis errors (in γ\gamma) from phase errors (in β,δ\beta,\delta). And in universality proofs, the reduction of any UU to rotations about two axes is the first step of the Solovay-Kitaev machinery that shows a finite gate set densely fills SU(2)SU(2).

The physical picture

Picture the Bloch sphere as a rigid globe carrying the qubit's state at the tip of an arrow. Any reorientation of a globe — send the arrow from anywhere to anywhere, and fix how the globe is twisted about it — can be achieved in three moves: spin about the vertical zz-axis, tilt about the horizontal yy-axis, then spin about zz once more. These are the classical Euler angles, and the Z-Y decomposition is that centuries-old fact re-read in the language of qubits. The reason two axes suffice is geometric: the middle Ry(γ)R_y(\gamma) drags the north pole down to any latitude, while the two RzR_z rotations swing it to any longitude and set the final twist. A third independent axis buys nothing.

Figure
Three moves reorient the qubit: a spin about z, a tilt about y, a spin about z. The count is exact — U(2) has 4 real parameters, the invisible global phase α removes 1, leaving 3 for the Euler angles β, γ, δ, so 4 − 1 = 3
Any single-qubit gate = spin z · tilt y · spin z, up to a global phase z · |0⟩ |1⟩ y x R_z(β) R_y(γ) Why exactly three angles real dim U(2) = 4 − global phase α − 1 phys. gates SU(2)/±I = 3 matched by (β, γ, δ) R_z(δ) acts first; on |0⟩ it only adds a phase U = e^{iα} R_z(β) R_y(γ) R_z(δ)

Parameter counting makes the theorem feel inevitable. A 2×22\times 2 unitary carries four real numbers, physical single-qubit gates carry three because the global phase is invisible, and three Euler angles supply exactly three — with α\alpha mopping up the leftover phase. But the decomposition's real power shows only when the qubit stops being alone. The identity XRz(θ)X=Rz(−θ)XR_z(\theta)X = R_z(-\theta) says that conjugating a zz-rotation by a NOT gate flips its angle. Sprinkle two XX's into the zz-yy-zz sequence and the angles can be arranged to cancel to the identity when the XX's are absent, yet reassemble into UU when they are present. That is exactly the switch a controlled-UU needs, and a CNOT is exactly the gate that supplies the XX's on demand.

Figure
Controlled-U from the ABC identity: two CNOTs sandwich the blocks A, B, C with ABC = I, so a control in state 0 leaves the target alone and a control in state 1 applies U. For controlled-H the blocks are A = R_y(π/4), B = R_y(−π/4)R_z(−π/2), C = R_z(π/2), with S = diag(1, e^{iπ/2}) restoring the phase α = π/2
Λ(U): two CNOTs + A, B, C with ABC = I build any controlled-U c t S C B A time → control |0⟩ : target sees ABC = I control |1⟩ : target sees A X B X C = R_z(β) R_y(γ) R_z(δ) phase

The gate changes character the moment UU is conditioned on another qubit. What was a harmless overall phase eiαe^{i\alpha} becomes a genuine relative phase between the two control branches, and it has to be reinstated by a small phase gate on the control line. Miss it, and the controlled operation is wrong by a diagonal factor. This is the single subtlety that separates a correct compilation from a plausible-looking broken one, and it is why the decomposition is always carried with its phase, never without.

The core equations

The two building blocks are the standard rotation gates. The zz-rotation is diagonal, so it only rephases the computational basis; it is the generator ZZ exponentiated with the physics convention that a rotation by angle θ\theta carries a factor e−iθZ/2e^{-i\theta Z/2}.

Rz(θ)=e−iθZ/2=(e−iθ/200eiθ/2)(1)R_z(\theta) = e^{-i\theta Z/2} = \begin{pmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{pmatrix} \qquad (1)

where: θ\theta — rotation angle about the zz-axis of the Bloch sphere; ZZ — Pauli-ZZ matrix diag(1,−1)\mathrm{diag}(1,-1). Reading it: RzR_z never mixes ∣0⟩|0\rangle and ∣1⟩|1\rangle, it only advances their relative phase by θ\theta. The yy-rotation is the one gate in the trio with purely real entries. That is the whole reason yy is chosen for the middle slot — it is the axis that actually moves probability between ∣0⟩|0\rangle and ∣1⟩|1\rangle using only cosines and sines.

Ry(θ)=e−iθY/2=(cos⁡θ2−sin⁡θ2sin⁡θ2cos⁡θ2)(2)R_y(\theta) = e^{-i\theta Y/2} = \begin{pmatrix} \cos\tfrac{\theta}{2} & -\sin\tfrac{\theta}{2} \\ \sin\tfrac{\theta}{2} & \cos\tfrac{\theta}{2} \end{pmatrix} \qquad (2)

where: θ\theta — rotation angle about the yy-axis; YY — Pauli-YY matrix with entries −i-i above and +i+i below the diagonal. Reading it: Ry(θ)R_y(\theta) tips the Bloch vector through polar angle θ\theta in the xx-zz plane, the geometric heart of the decomposition. The theorem itself asserts that these two gates, arranged zz-yy-zz and dressed with a global phase, exhaust the entire single-qubit group. Nothing more general than 2×22\times 2 unitary can be reached, and nothing less than these three angles is needed.

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

where: α\alpha — global phase, invisible for an isolated qubit; β,δ\beta,\delta — outer and inner zz-rotation angles; γ\gamma — middle yy-rotation angle. Reading it: any gate is "point, tip, twist" plus an overall phase. Multiplying the three matrices out gives the explicit form that the existence proof matches term by term. Every entry is a single cosine or sine multiplied by a clean phase, which is what makes the angles readable directly off any given UU.

Rz(β)Ry(γ)Rz(δ)=(e−i(β+δ)/2cos⁡γ2−e−i(β−δ)/2sin⁡γ2ei(β−δ)/2sin⁡γ2ei(β+δ)/2cos⁡γ2)(4)R_z(\beta)R_y(\gamma)R_z(\delta) = \begin{pmatrix} e^{-i(\beta+\delta)/2}\cos\tfrac{\gamma}{2} & -e^{-i(\beta-\delta)/2}\sin\tfrac{\gamma}{2} \\ e^{i(\beta-\delta)/2}\sin\tfrac{\gamma}{2} & e^{i(\beta+\delta)/2}\cos\tfrac{\gamma}{2} \end{pmatrix} \qquad (4)

where: the diagonal magnitudes are cos⁡(γ/2)\cos(\gamma/2), the off-diagonal magnitudes sin⁡(γ/2)\sin(\gamma/2); the phases split into the sum β+δ\beta+\delta (diagonal) and the difference β−δ\beta-\delta (off-diagonal). Reading it: magnitudes fix γ\gamma, phases fix β\beta and δ\delta. The conjugation identities are the algebraic pivot for everything two-qubit. A Pauli-XX sandwiched around either rotation reverses its angle, because XX swaps the two basis states and hence the two half-phases.

X Rz(θ) X=Rz(−θ),X Ry(θ) X=Ry(−θ)(5)X\, R_z(\theta)\, X = R_z(-\theta), \qquad X\, R_y(\theta)\, X = R_y(-\theta) \qquad (5)

where: XX — Pauli-XX (NOT) gate. Reading it: wrapping a rotation in NOT gates negates its angle, the lever the ABC construction pulls. Applying that lever to (3) produces the corollary that makes controlled operations buildable. The gate splits into three blocks separated by two XX's, engineered so the blocks collapse to the identity when the XX's are gone.

U=eiα A X B X C,ABC=I(6)U = e^{i\alpha}\, A\, X\, B\, X\, C, \qquad A B C = I \qquad (6)

where: A=Rz(β)Ry(γ/2)A = R_z(\beta)R_y(\gamma/2); B=Ry(−γ/2)Rz(−(δ+β)/2)B = R_y(-\gamma/2)R_z(-(\delta+\beta)/2); C=Rz((δ−β)/2)C = R_z((\delta-\beta)/2). Reading it: the XX's toggle between ABC=IABC=I (do nothing) and AXBXC=UAXBXC=U (apply the gate). Finally, the accounting that guarantees the theorem cannot be improved. Three angles is the exact real dimension of the physical single-qubit gate group.

dim⁡RU(2)=4,dim⁡RSU(2)=dim⁡RSO(3)=3(7)\dim_{\mathbb R} U(2) = 4, \qquad \dim_{\mathbb R} SU(2) = \dim_{\mathbb R} SO(3) = 3 \qquad (7)

where: U(2)U(2) — all 2×22\times 2 unitaries; SU(2)SU(2) — the unit-determinant subgroup, the double cover of the rotation group SO(3)SO(3). Reading it: physical gates live on a three-dimensional manifold, so three Euler angles are necessary and sufficient.

Derivation AThe z-y-z Euler factorization from unitarity

The goal is to prove that every U∈U(2)U\in U(2) can be written as eiαRz(β)Ry(γ)Rz(δ)e^{i\alpha}R_z(\beta)R_y(\gamma)R_z(\delta), and to do so constructively — not merely asserting the angles exist, but showing how to compute all four of them from the entries of any given matrix. The engine is a single fact: the columns of a unitary are orthonormal. That constraint fixes the magnitudes of all four entries in terms of one angle γ\gamma, and pins the four phases down to exactly three free combinations, which are the phase α\alpha and the two zz-angles.

Step 1. Write a generic unitary U=(abcd)U = \begin{pmatrix} a & b \\ c & d \end{pmatrix} and impose U†U=IU^\dagger U = I. Column orthonormality gives ∣a∣2+∣c∣2=1|a|^2+|c|^2 = 1, ∣b∣2+∣d∣2=1|b|^2+|d|^2 = 1, and a∗b+c∗d=0a^*b + c^*d = 0; the determinant has unit modulus. Why: these are the only constraints on UU, so any parametrization consistent with them is complete — nothing about UU is left unaccounted for.

Step 2. Compare UU to the explicit product in equation (4). The diagonal magnitudes force ∣a∣=∣d∣=cos⁡(γ/2)|a| = |d| = \cos(\gamma/2) and the off-diagonal magnitudes force ∣b∣=∣c∣=sin⁡(γ/2)|b| = |c| = \sin(\gamma/2); since ∣a∣2+∣c∣2=1|a|^2 + |c|^2 = 1 these are automatically consistent, and a unique γ∈[0,π]\gamma\in[0,\pi] satisfies them. Why: on [0,π][0,\pi] the map γ↦cos⁡(γ/2)\gamma\mapsto\cos(\gamma/2) is a bijection onto [0,1][0,1], so the magnitude of one entry determines the middle angle with no ambiguity.

Step 3. Write each entry in polar form, a=∣a∣eiϕaa = |a|e^{i\phi_a} and so on. Matching phases to (4) gives ϕa=α−(β+δ)/2\phi_a = \alpha - (\beta+\delta)/2, ϕd=α+(β+δ)/2\phi_d = \alpha + (\beta+\delta)/2, ϕc=α+(β−δ)/2\phi_c = \alpha + (\beta-\delta)/2, and ϕb=π+α−(β−δ)/2\phi_b = \pi + \alpha - (\beta-\delta)/2. Why: the four measured phases are four linear equations in the three unknowns α,β,δ\alpha, \beta, \delta; unitarity guarantees they are consistent, leaving no over-determination.

Step 4. Invert the linear system: α=(ϕa+ϕd)/2\alpha = (\phi_a+\phi_d)/2, then β+δ=ϕd−ϕa\beta+\delta = \phi_d - \phi_a and β−δ=ϕc−ϕa−α+α\beta - \delta = \phi_c - \phi_a - \alpha + \alpha collapse to β=12(ϕd−ϕa)+12(ϕc−ϕb+π)\beta = \tfrac12(\phi_d-\phi_a) + \tfrac12(\phi_c-\phi_b+\pi) and δ\delta likewise, each determined modulo 2π2\pi. Why: two sum-and-difference equations invert to give β\beta and δ\delta separately whenever γ≠0,π\gamma\neq 0,\pi; the phase α\alpha is the average of the diagonal phases and is always defined. *Why this works: symbolically multiplying Rz(β)Ry(γ)Rz(δ)R_z(\beta)R_y(\gamma)R_z(\delta) reproduces equation (4) entry for entry, and reconstructing UU from angles read off a random unitary returns the original matrix to machine precision.*

Go deeper · Derivation B · 1 minThe ABC identity behind controlled gates
Derivation BThe ABC identity behind controlled gates

The goal is to derive the corollary U=eiαAXBXCU = e^{i\alpha}AXBXC with ABC=IABC = I from the Euler form, exhibiting explicit blocks A,B,CA, B, C that satisfy both requirements simultaneously — collapsing to the identity in the absence of the two XX's, yet reproducing UU in their presence. The mechanism is entirely the conjugation identity XRz(θ)X=Rz(−θ)XR_z(\theta)X = R_z(-\theta), XRy(θ)X=Ry(−θ)XR_y(\theta)X = R_y(-\theta): an XX-sandwich flips a rotation angle, and the flips are engineered to telescope.

Step 1. Define A=Rz(β)Ry(γ/2)A = R_z(\beta)R_y(\gamma/2), B=Ry(−γ/2)Rz(−(δ+β)/2)B = R_y(-\gamma/2)R_z(-(\delta+\beta)/2), and C=Rz((δ−β)/2)C = R_z((\delta-\beta)/2). Multiply straight through: ABC=Rz(β) Ry(γ/2)Ry(−γ/2) Rz(−(δ+β)/2)Rz((δ−β)/2)ABC = R_z(\beta)\,R_y(\gamma/2)R_y(-\gamma/2)\,R_z(-(\delta+\beta)/2)R_z((\delta-\beta)/2). Why: the blocks are chosen so the two RyR_y halves are inverses and the two inner RzR_z angles sum to −β-\beta, which is exactly what will cancel the leading Rz(β)R_z(\beta).

Step 2. Collapse the middle: Ry(γ/2)Ry(−γ/2)=IR_y(\gamma/2)R_y(-\gamma/2) = I and Rz(−(δ+β)/2)Rz((δ−β)/2)=Rz(−β)R_z(-(\delta+\beta)/2)R_z((\delta-\beta)/2) = R_z(-\beta), so ABC=Rz(β)Rz(−β)=IABC = R_z(\beta)R_z(-\beta) = I. Why: this is the "control off" branch — when the qubit that would insert the XX's is ∣0⟩|0\rangle, the target must be untouched, and ABC=IABC=I guarantees it.

Step 3. Now conjugate BB: using the identities, XBX=XRy(−γ/2)X  XRz(−(δ+β)/2)X=Ry(γ/2)Rz((δ+β)/2)XBX = X R_y(-\gamma/2)X\; X R_z(-(\delta+\beta)/2)X = R_y(\gamma/2)R_z((\delta+\beta)/2). Why: each XX-sandwich negates one angle, turning BB into its sign-flipped partner — the single algebraic move the whole corollary rests on.

Step 4. Assemble AXBXC=A (XBX) C=Rz(β)Ry(γ/2)⋅Ry(γ/2)Rz((δ+β)/2)⋅Rz((δ−β)/2)AXBXC = A\,(XBX)\,C = R_z(\beta)R_y(\gamma/2)\cdot R_y(\gamma/2)R_z((\delta+\beta)/2)\cdot R_z((\delta-\beta)/2). The two Ry(γ/2)R_y(\gamma/2) merge to Ry(γ)R_y(\gamma) and the two trailing RzR_z angles sum to δ\delta, giving Rz(β)Ry(γ)Rz(δ)=e−iαUR_z(\beta)R_y(\gamma)R_z(\delta) = e^{-i\alpha}U. Why: this is the "control on" branch — with both XX's present the flipped blocks recombine into exactly the Euler product, so the target sees UU up to the phase. *Why this works: direct matrix multiplication confirms ABC=IABC=I and AXBXC=Rz(β)Ry(γ)Rz(δ)AXBXC = R_z(\beta)R_y(\gamma)R_z(\delta) for arbitrary angles, and the explicit controlled-Hadamard blocks A=Ry(π/4)A=R_y(\pi/4), B=Ry(−π/4)Rz(−π/2)B=R_y(-\pi/4)R_z(-\pi/2), C=Rz(π/2)C=R_z(\pi/2) satisfy both to machine precision.*

Go deeper · Derivation C · 1 minControlled-U from two CNOTs and a control phase
Derivation CControlled-U from two CNOTs and a control phase

The goal is to turn the ABC identity into an actual circuit for the controlled gate Λ(U)\Lambda(U), which applies UU to a target qubit only when the control is ∣1⟩|1\rangle, using nothing but single-qubit gates and CNOTs. The idea is to let the control qubit itself supply the two XX's of the ABC identity through a pair of CNOTs, so the "control off" and "control on" branches automatically execute ABC=IABC=I and AXBXC=UAXBXC=U respectively; a final controlled phase repairs the global factor.

Step 1. Lay the target out as CC, then a CNOT, then BB, then a CNOT, then AA, reading left to right in time. Each CNOT applies XX to the target if and only if the control is ∣1⟩|1\rangle. Why: the CNOTs turn the abstract XcX^c (an XX raised to the control bit cc) into a physical gate, so the same fixed circuit realizes both branches depending on the control.

Step 2. Trace the control-∣0⟩|0\rangle branch: both CNOTs are inert, the target experiences A⋅I⋅B⋅I⋅C=ABC=IA\cdot I\cdot B\cdot I\cdot C = ABC = I. The target is returned unchanged, as a controlled gate demands. Why: this is the correctness condition on the "off" branch, and it is exactly what ABC=IABC=I was built to guarantee.

Step 3. Trace the control-∣1⟩|1\rangle branch: both CNOTs fire, the target experiences AXBXC=Rz(β)Ry(γ)Rz(δ)=e−iαUAXBXC = R_z(\beta)R_y(\gamma)R_z(\delta) = e^{-i\alpha}U. Every entangled amplitude with control ∣1⟩|1\rangle picks up this operator on the target. Why: this is the "on" branch, and it delivers UU up to precisely the missing phase eiαe^{i\alpha}.

Step 4. Repair the phase: place a gate diag(1,eiα)\mathrm{diag}(1, e^{i\alpha}) on the control line. It does nothing to the ∣0⟩|0\rangle branch and multiplies the ∣1⟩|1\rangle branch by eiαe^{i\alpha}, upgrading e−iαUe^{-i\alpha}U to UU. Why: the once-global α\alpha is now a relative phase between branches, so it must be applied by the control, not the target — a phase gate on the control is the only correct home for it. *Why this works: the branch-by-branch trace gives Λ(U)=diag(I, U)\Lambda(U) = \mathrm{diag}(I,\,U) exactly, and the resource count is two CNOTs, three single-qubit gates, and one control phase.*

Limiting cases

CaseResultMeaning
Diagonal gateγ=0⇒U=eiαRz(β+δ)\gamma = 0 \Rightarrow U = e^{i\alpha}R_z(\beta+\delta)The yy-rotation vanishes and the two zz-rotations merge; only the sum β+δ\beta+\delta is fixed, not β\beta and δ\delta separately — gimbal lock.
Pure real gateβ=δ=0⇒U=eiαRy(γ)\beta=\delta=0 \Rightarrow U = e^{i\alpha}R_y(\gamma)A gate with real entries and no relative phase collapses to a single yy-rotation.
HadamardH=eiπ/2Rz(0)Ry(π/2)Rz(π)H = e^{i\pi/2}R_z(0)R_y(\pi/2)R_z(\pi)Concrete instance α=π/2, β=0, γ=π/2, δ=π\alpha=\pi/2,\ \beta=0,\ \gamma=\pi/2,\ \delta=\pi reproduces the Hadamard gate exactly.
T (phase) gateT=eiπ/8Rz(π/4)T = e^{i\pi/8}R_z(\pi/4)A diagonal gate: γ=0\gamma=0, so it is a pure zz-rotation by π/4\pi/4 with global phase π/8\pi/8.
Axis relabellingU=eiαRz(β)Rx(γ)Rz(δ)U = e^{i\alpha}R_z(\beta)R_x(\gamma)R_z(\delta)Any two non-parallel axes generate SU(2)SU(2); swapping yy for xx gives an equally valid Z-X-Z decomposition.

Worked examples

1 · Decomposing the Hadamard gate from its matrix (fully worked)

Given the Hadamard H=12(111−1)H = \tfrac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}, find angles α,β,γ,δ\alpha,\beta,\gamma,\delta with H=eiαRz(β)Ry(γ)Rz(δ)H = e^{i\alpha}R_z(\beta)R_y(\gamma)R_z(\delta) by running the existence construction on its four entries.

Step 1. Read the magnitudes. Every entry has modulus 1/21/\sqrt2, so matching equation (4), cos⁡(γ/2)=∣a∣=1/2\cos(\gamma/2) = |a| = 1/\sqrt2 and sin⁡(γ/2)=∣b∣=1/2\sin(\gamma/2) = |b| = 1/\sqrt2. Both give γ/2=π/4\gamma/2 = \pi/4, hence γ=π/2\gamma = \pi/2 — the middle tilt is a quarter turn, which is what sends the north pole ∣0⟩|0\rangle to the equator.

Step 2. Read the phases. Writing each entry as (magnitude)×eiϕ\times e^{i\phi}: entry a=+1/2a = +1/\sqrt2 has ϕa=0\phi_a = 0; entry c=+1/2c = +1/\sqrt2 has ϕc=0\phi_c = 0; entry d=−1/2d = -1/\sqrt2 has ϕd=π\phi_d = \pi; entry b=+1/2b = +1/\sqrt2 but sits behind a leading minus in (4), so its phase equation is π+α−(β−δ)/2=0\pi + \alpha - (\beta-\delta)/2 = 0.

Step 3. Solve the diagonal pair. From (4), ϕa=α−(β+δ)/2=0\phi_a = \alpha - (\beta+\delta)/2 = 0 and ϕd=α+(β+δ)/2=π\phi_d = \alpha + (\beta+\delta)/2 = \pi. Adding gives 2α=π2\alpha = \pi, so α=π/2\alpha = \pi/2; subtracting gives β+δ=π\beta+\delta = \pi.

Step 4. Solve the off-diagonal pair. From (4), ϕc=α+(β−δ)/2=0\phi_c = \alpha + (\beta-\delta)/2 = 0, so with α=π/2\alpha=\pi/2 we get β−δ=−π\beta-\delta = -\pi. Combined with β+δ=π\beta+\delta=\pi this yields β=0\beta = 0 and δ=π\delta = \pi. The bb-entry equation π+π/2−(β−δ)/2=π+π/2+π/2=2π≡0\pi+\pi/2-(\beta-\delta)/2 = \pi+\pi/2+\pi/2 = 2\pi \equiv 0 checks consistently.

Result. H=eiπ/2Rz(0)Ry(π/2)Rz(π)H = e^{i\pi/2}R_z(0)R_y(\pi/2)R_z(\pi). Substituting back: Ry(π/2)=12(1−111)R_y(\pi/2) = \tfrac{1}{\sqrt2}\begin{pmatrix}1&-1\\1&1\end{pmatrix}, Rz(π)=diag(−i,i)R_z(\pi) = \mathrm{diag}(-i,i), their product is 12(−i−i−ii)\tfrac{1}{\sqrt2}\begin{pmatrix}-i&-i\\-i&i\end{pmatrix}, and multiplying by eiπ/2=ie^{i\pi/2}=i returns 12(111−1)=H\tfrac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix} = H. The angles (α,β,γ,δ)=(π/2,0,π/2,π)(\alpha,\beta,\gamma,\delta) = (\pi/2, 0, \pi/2, \pi) reproduce the Hadamard exactly.

2 · Building a controlled-Hadamard from the ABC blocks (fully worked)

Use the Hadamard angles from Example 1 to construct the ABC blocks and write down an explicit controlled-HH circuit with its full resource count.

Step 1. Substitute β=0, γ=π/2, δ=π\beta=0,\ \gamma=\pi/2,\ \delta=\pi into the block definitions. A=Rz(0)Ry(π/4)=Ry(π/4)A = R_z(0)R_y(\pi/4) = R_y(\pi/4). B=Ry(−π/4)Rz(−(π+0)/2)=Ry(−π/4)Rz(−π/2)B = R_y(-\pi/4)R_z(-(\pi+0)/2) = R_y(-\pi/4)R_z(-\pi/2). C=Rz((π−0)/2)=Rz(π/2)C = R_z((\pi-0)/2) = R_z(\pi/2).

Step 2. Check the "control off" branch: ABC=Ry(π/4) Ry(−π/4)Rz(−π/2) Rz(π/2)=Ry(0)Rz(0)=IABC = R_y(\pi/4)\,R_y(-\pi/4)R_z(-\pi/2)\,R_z(\pi/2) = R_y(0)R_z(0) = I. The identity holds, so a ∣0⟩|0\rangle control leaves the target alone.

Step 3. Check the "control on" branch: AXBXC=Ry(π/4) (XRy(−π/4)Rz(−π/2)X) Rz(π/2)=Ry(π/4)Ry(π/4)Rz(π/2)Rz(π/2)=Ry(π/2)Rz(π)AXBXC = R_y(\pi/4)\,(X R_y(-\pi/4)R_z(-\pi/2) X)\,R_z(\pi/2) = R_y(\pi/4)R_y(\pi/4)R_z(\pi/2)R_z(\pi/2) = R_y(\pi/2)R_z(\pi), and with β=0\beta=0 this is Rz(0)Ry(π/2)Rz(π)=e−iπ/2HR_z(0)R_y(\pi/2)R_z(\pi) = e^{-i\pi/2}H. The target sees HH up to the phase e−iπ/2e^{-i\pi/2}.

Step 4. Repair the phase. Place diag(1,eiπ/2)=diag(1,i)=S\mathrm{diag}(1, e^{i\pi/2}) = \mathrm{diag}(1,i) = S on the control qubit; it converts e−iπ/2He^{-i\pi/2}H to HH on the ∣1⟩|1\rangle branch and does nothing on the ∣0⟩|0\rangle branch.

Result. Controlled-HH = [ C=Rz(π/2)C=R_z(\pi/2) on target ] → [ CNOT ] → [ B=Ry(−π/4)Rz(−π/2)B=R_y(-\pi/4)R_z(-\pi/2) on target ] → [ CNOT ] → [ A=Ry(π/4)A=R_y(\pi/4) on target ], with an SS gate on the control. Total cost: 2 CNOTs, 3 single-qubit rotation blocks, and 1 control-phase gate — the generic controlled-UU budget, here made concrete for the Hadamard.

Physics of the portrait

The Z-Y decomposition is a two-hundred-and-fifty-year-old idea wearing a quantum costume. The three angles that orient a spinning top in Euler's mechanics are, letter for letter, the three angles that specify a single-qubit gate — because the Bloch sphere is a rotation group, and rotation groups have been parametrized by Euler angles since 1775.

Origins · 1 minLeonhard Euler and how this was discovered
LE
Leonhard Euler
1707–1783 · rigid-body rotation and the three-angle parametrization of orientation

Leonhard Euler was the most prolific mathematician in history, and among his vast output sits the small, sturdy result that underwrites this article. In his work on rigid-body mechanics he proved that any orientation of a rigid body relative to a reference frame can be reached by three successive rotations about specified axes — the Euler angles — and separately that any single reorientation is itself a rotation about some fixed axis (Euler's rotation theorem, 1775). For a spinning top these angles are precession, nutation, and spin; the standard zz-yy-zz convention rotates about the vertical, then a tilted horizontal, then the vertical again. Two centuries later, when quantum mechanics recast a spin-12\tfrac12 system as a point on the Bloch sphere, the group of single-qubit gates turned out to be SU(2)SU(2), the double cover of Euler's rotation group SO(3)SO(3). The very same three-angle chart carried over intact: Rz(β)Ry(γ)Rz(δ)R_z(\beta)R_y(\gamma)R_z(\delta) is Euler's zz-yy-zz sequence, and the extra global phase eiαe^{i\alpha} is the only new feature the double cover contributes. Euler never saw a qubit, but every quantum compiler that lowers a gate to hardware pulses is running his construction.

History
1775
— Euler parametrizes rigid-body orientation by three successive rotation angles
1879
— Cayley's rotation parameters express SU(2) as the double cover of SO(3)
1927
— Pauli introduces the spin matrices that become the gates X, Y, Z
1946
— Bloch's sphere pictures any single-qubit state as a point on a unit ball
1995
— Barenco and collaborators derive the ABC controlled-U construction

Going further

Texts. Nielsen & Chuang, Quantum Computation and Quantum Information, §4.2 (Theorem 4.1, Corollary 4.2) · Barenco, Bennett, Cleve et al., "Elementary gates for quantum computation," Phys. Rev. A 52, 3457 (1995) · Preskill, Lecture Notes on Quantum Computation, Ch. 5 · Watrous, The Theory of Quantum Information, Ch. 2 · Kitaev, Shen & Vyalyi, Classical and Quantum Computation, §8 · Mermin, Quantum Computer Science, Ch. 2. Key identities one can confirm directly: symbolically multiplying Rz(β)Ry(γ)Rz(δ)R_z(\beta)R_y(\gamma)R_z(\delta) equals equation (4) entry by entry; XRz(θ)X=Rz(−θ)XR_z(\theta)X = R_z(-\theta) and XRy(θ)X=Ry(−θ)XR_y(\theta)X = R_y(-\theta) follow by direct conjugation; the explicit blocks A=Ry(π/4)A=R_y(\pi/4), B=Ry(−π/4)Rz(−π/2)B=R_y(-\pi/4)R_z(-\pi/2), C=Rz(π/2)C=R_z(\pi/2) satisfy ABC=IABC=I and AXBXC=e−iπ/2HAXBXC=e^{-i\pi/2}H; and the Hadamard angles (α,β,γ,δ)=(π/2,0,π/2,π)(\alpha,\beta,\gamma,\delta)=(\pi/2,0,\pi/2,\pi) reproduce HH. The dimension counts dim⁡RU(2)=4\dim_{\mathbb R}U(2)=4 and dim⁡RSU(2)=3\dim_{\mathbb R}SU(2)=3 are standard Lie-group facts.

Prerequisites. Single-Qubit Rotation Gates · Pauli Gates (X, Y, Z) · Bloch Sphere Representation of Gates. Leads to. Controlled-U Gates · Universal Gate Sets · Circuit Identities and Equivalences.

Ask the tutor: Ask me to walk you through decomposing any specific gate — hand me a 2×22\times 2 unitary and I will read off its Euler angles and build its controlled version step by step.

Why z-y-z specifically, rather than three different axes?

Any three rotations that alternate between two non-parallel axes will parametrize SU(2)SU(2), so zz-yy-zz, zz-xx-zz, and yy-zz-yy are all legitimate. The zz-yy-zz choice is favoured for two practical reasons. First, RyR_y is the only rotation with purely real matrix entries, so the middle step uses nothing but cosines and sines, which keeps hand computation and the existence proof clean. Second, RzR_z is diagonal, so on hardware it can often be implemented virtually as a phase relabelling rather than a physical pulse. Using three genuinely different axes would work mathematically but would waste this diagonal-plus-real structure that makes the two-axis form so convenient.

Is the Euler-angle decomposition unique?

Generically yes, up to the usual 2π2\pi ambiguities in each angle, but it fails to be unique exactly at the gimbal-lock configurations γ=0\gamma = 0 or γ=π\gamma = \pi. When γ=0\gamma=0 the middle rotation is trivial and the two zz-rotations combine into one, so only the sum β+δ\beta+\delta is determined — you may add any amount to β\beta and subtract it from δ\delta without changing the gate. Away from those degenerate slices, the magnitude of a matrix entry fixes γ\gamma uniquely on [0,π][0,\pi] and the phases fix β\beta and δ\delta modulo 2π2\pi, so the decomposition is essentially one-to-one. The non-uniqueness is a measure-zero set and the exact analogue of classical gimbal lock.

What is gimbal lock here, and does it hurt real hardware?

Gimbal lock is the degeneracy at γ=0\gamma=0 or γ=π\gamma=\pi where the two zz-rotation axes align and one angular degree of freedom is lost — only β±δ\beta\pm\delta survives, not β\beta and δ\delta individually. On real hardware it is essentially harmless as a physics problem: the gate you want is still perfectly representable, you have simply lost the ability to distinguish two of its parameters. It matters only numerically, when a calibration or compilation routine tries to solve for β\beta and δ\delta near the degeneracy and hits an ill-conditioned system. Robust transpilers detect small sin⁡(γ/2)\sin(\gamma/2) and switch to the collapsed diagonal form, quoting the single combined angle rather than two unstable ones.

Why does the global phase suddenly matter under control?

Because "global" is a statement about the whole Hilbert space, and controlling a gate changes what the whole space is. For a lone qubit, eiαe^{i\alpha} multiplies every amplitude equally, so it drops out of every probability and every expectation value — genuinely unobservable. But a controlled-UU lives in a two-qubit space, and it applies UU only to the branch where the control is ∣1⟩|1\rangle. Now eiαe^{i\alpha} multiplies just that branch, not the ∣0⟩|0\rangle branch, so it becomes a relative phase between the two — and relative phases are observable through interference. The fix is a phase gate diag(1,eiα)\mathrm{diag}(1,e^{i\alpha}) on the control, which is the correct place to inject a phase that distinguishes control branches.

How does this connect to IBM's U3 gate and the transpiler?

Very directly: IBM's native parametrized single-qubit gate U3(θ,ϕ,λ)U3(\theta,\phi,\lambda) is the Z-Y decomposition itself, equal to Rz(ϕ)Ry(θ)Rz(λ)R_z(\phi)R_y(\theta)R_z(\lambda) up to a phase convention. When a Qiskit circuit contains an arbitrary single-qubit unitary, the transpiler computes its Euler angles and emits exactly one U3U3 instruction. On superconducting backends this is then lowered further using the virtual-Z technique: the two RzR_z rotations become software phase updates that cost no time and introduce no error, while only the middle θ\theta rotation is realized as a physical microwave pulse. So the decomposition is not a pedagogical detour — it is the compilation target that every gate passes through on the way to the machine.

Does the z-y-z form use the minimum number of gates?

For a fully general single-qubit unitary, yes — three rotations is the minimum, because the physical gate group is three-dimensional and each rotation supplies one real parameter, so no two-rotation product can reach every gate. Special gates need fewer: a diagonal gate is a single RzR_z, a real gate a single RyR_y. For controlled operations the analogous bound is two CNOTs per generic controlled-UU, and the ABC construction meets it; specially structured gates can sometimes use one CNOT. The Z-Y decomposition is therefore optimal in gate count for the generic case a compiler must handle.

How does the decomposition feed into universality proofs?

Universality asks whether a finite set of gates can approximate any unitary to arbitrary accuracy. For single-qubit gates the Z-Y decomposition is the crucial reduction: reaching every gate amounts to reaching every triple of rotation angles about just two axes, so you only need to densely generate rotations about two non-parallel axes. Combined with the fact that an irrational rotation densely fills the circle, and the Solovay-Kitaev theorem bounding the convergence rate, this proves a small set such as Hadamard and TT plus CNOT is universal. The decomposition breaks the full three-dimensional group into tractable one-parameter pieces.

Before this

Where this leads