Rotation Gates and Arbitrary Single-Qubit Unitaries
Suppose you need to implement the single-qubit unitary in a variational quantum eigensolver. A classical optimizer chose it to be some seemingly arbitrary 2×2 matrix. Your hardware gives you only a small native gate set. Perhaps Rz gates from microwave phase shifts and Rx gates from Rabi pulses. Can any single-qubit unitary be built exactly from just these two rotation families? The answer is yes. The reason is a beautiful piece of Lie-group mathematics. Quantum engineers use it every single day. This matters because every real quantum computer restricts you to a small hardware-native gate set. Superconducting qubits, trapped ions, and photonic systems each expose only a handful of controllable rotations. Compilers translate a quantum algorithm into physical pulses. They must therefore decompose every single-qubit operation into those primitives. The Euler-angle decomposition is the exact recipe that guarantees this. It works always, with no error and no approximation, for the single-qubit case. The big picture is this: the group of single-qubit unitaries, up to an overall phase, is exactly the group of rotations of the Bloch Sphere. Just as any 3D rotation decomposes into rotations about coordinate axes, any single-qubit unitary decomposes similarly. It becomes a sequence of Rz, Ry (or Rx) rotations. Building on Single-Qubit Gates: X, Y, Z, H, Phase Gates, this article replaces those fixed, discrete gates. It introduces a continuous family of rotation gates parameterized by an angle. It shows precisely how far that continuous family reaches. This article delivers three things. First, a precise definition of Rx, Ry, Rz as matrix exponentials of the Pauli operators. Second, a full derivation and proof of the Euler-angle (ZYZ) decomposition theorem. This applies to arbitrary single-qubit unitaries. Third, worked numerical examples showing the decomposition applied to concrete gates. These include the Hadamard and the T gate. It sets up the machinery needed for Universal Gate Sets and The Quantum Circuit Model.
- Rx(θ), Ry(θ), Rz(θ) are defined as for Pauli matrices , giving rotations of the Bloch vector about the corresponding axis by angle θ.
- Every single-qubit unitary factors exactly as for real angles α, β, γ, δ.
- This ZYZ (or ZXZ) decomposition mirrors classical Euler angles for 3D rotations, because double-covers .
- The decomposition is constructive: the four angles are computable in closed form from the entries of .
- The result guarantees any single-qubit gate can be compiled exactly using only two rotation axes plus phase — no approximation needed.
- This is the foundation for compiling arbitrary quantum algorithms onto hardware-native gate sets and for later multi-qubit universality results.
Every single-qubit unitary is, up to a global phase, a rotation of the Bloch sphere, and every such rotation factors exactly into three rotations about just two fixed axes.
The idea
A rotation gate is defined as the exponential of a Pauli matrix. For the Pauli operators
we define, for a real angle θ,
Because each Pauli matrix squares to the identity, , the exponential series collapses using the same identity that gives Euler's formula for complex numbers. Splitting the Taylor series of into even and odd powers of , and using , , yields the closed form
Substituting each Pauli matrix gives explicit 2×2 matrices:
Geometrically, , , and rotate the Bloch Sphere vector by angle θ about the x-, y-, or z-axis respectively. This is not a metaphor: the qubit density matrix can be written for a real Bloch vector , and conjugation by acts on exactly as the classical 3×3 rotation matrix about the z-axis by angle θ acts on a vector in . This correspondence is a concrete instance of the fact that is a double cover of : rotating the qubit state by angle θ in Hilbert space rotates the Bloch vector by angle θ in real space, but the state vector itself only returns to its starting point after θ = 4π, not 2π, since . The central theorem of this article is that these three one-parameter families, together with an overall phase, generate the entire group of single-qubit unitaries. Precisely: for any unitary matrix , there exist real numbers such that
This is the Euler-angle (ZYZ) decomposition. It is the direct quantum analogue of the classical fact that any 3D rotation can be written as a composition of rotations about the z-axis, then the y-axis, then the z-axis again — the same "precession, nutation, spin" decomposition used in classical mechanics and computer graphics, transported into the 2×2 unitary picture via the double cover .
How it works
The proof of the ZYZ decomposition is constructive, which is exactly what makes it useful for compiling circuits rather than merely an existence statement.
Step 1 — strip off the global phase. Any unitary can be written where , i.e. . Concretely and . Global phase has no physical effect on measurement statistics, so all the "work" is in decomposing .
Step 2 — write in the special unitary form. Every can be written as
for complex numbers . This is simply the general form of a unitary matrix with determinant 1.
Step 3 — match against the ZYZ product. Direct matrix multiplication gives
Comparing entries with and from Step 2:
so γ is recovered from (using `atan2` for numerical robustness when or vanishes). The phases of and then separate into sum and difference,
which is a linear system solved instantly for β and δ.
Step 4 — assemble the answer. Output ; the identity holds exactly. ```text FUNCTION EulerDecompose(U):
# U is a 2x2 unitary matrix detU <- U[0][0]U[1][1] - U[0][1]U[1][0] alpha <- arg(detU) / 2 V <- exp(-ialpha) U # V is now in SU(2), det(V) = 1 a <- V[0][0] b <- V[1][0] gamma <- 2 atan2(abs(b), abs(a)) # robust to a=0 or b=0 sum_ad <- -2 arg(a) # = beta + delta dif_ad <- 2 arg(b) # = beta - delta beta <- (sum_ad + dif_ad) / 2 delta <- (sum_ad - dif_ad) / 2 RETURN (alpha, beta, gamma, delta) FUNCTION Reconstruct(alpha, beta, gamma, delta): RETURN exp(ialpha) Rz(beta) Ry(gamma) * Rz(delta)
# Reconstruct(EulerDecompose(U)) == U for every unitary U ``` Edge cases matter here: when (so is diagonal, i.e. a pure Z-rotation up to phase), β and δ are not individually determined — only their sum is — and any split works, e.g. fix . When (so ), only is determined; fix . These are genuine gimbal-lock-style degeneracies, directly analogous to the coordinate singularities of classical Euler angles, and any correct implementation must special-case them rather than dividing by a vanishing quantity. An equivalent and equally common variant uses X instead of the outer Z rotations, , or places the "matched" axis as X-Y-X; all such triples work as long as the two outer axes are equal to each other and different from the middle axis. This flexibility is precisely why different hardware platforms — trapped ions naturally producing Rx/Ry pulses, superconducting qubits favoring virtual Rz plus physical Rx — can each pick the decomposition matching their native controls.
Complexity & correctness
Time and space complexity. The decomposition algorithm reads four fixed matrix entries, computes two magnitudes, two arguments, one `atan2`, and solves a linear system — a constant number of arithmetic and trigonometric operations independent of any problem size. The complexity is therefore time and space per single-qubit unitary. There is no hidden asymptotic growth because a single-qubit unitary is always exactly a matrix; the "input size" does not scale. This constant-time exactness is precisely why compilers invoke this routine once per gate, at negligible cost, when translating a circuit of gates: the total compilation overhead for single-qubit gates is , linear in the number of gates, dominated entirely by circuit size rather than by decomposition cost.
Correctness. The proof has two independent parts, both of which must hold for the theorem to be true. Existence (surjectivity of the parameterization). We must show every is reachable by some choice of angles. The set of matrices of the form ranges over , , (a 2-parameter-plus-radius covering, echoing spherical coordinates). Matching entries as in Step 3 above shows that for any with , valid real angles exist: γ always has a solution in since is always in the domain of (extended via `atan2`), and the phase-matching equations for β, δ are a solvable linear system in two unknowns for any given sum and difference. No unitary is missed. Exactness (algebraic identity, not approximation). Because and satisfy automatically — the unitarity of guarantees this — the reconstructed matrix exactly reproduces and , with no rounding beyond floating-point arithmetic. This is a genuine algebraic identity, not a numerical fit: given exact real inputs, exactly, for every unitary , with equality holding as a polynomial identity in verified directly by the matrix multiplication in Step 3.
Why this is not obvious a priori. A skeptical reader might worry that two rotation axes are not enough — that you would need three genuinely different axes (x, y, and z) to reach every unitary, the way you might expect three independent directions to be needed to span . The resolution is that is only 3-real-dimensional (three free parameters after removing the overall phase and the unit-determinant constraint), matching exactly or — three numbers, not three distinct axes. The middle rotation need only be non-parallel to the outer two; repeating the same axis (z) at both ends is what supplies the missing degree of freedom, because and enter the matrix through independent linear combinations ( and ), not redundantly.
Tradeoffs. The ZYZ decomposition is exact and cheap, but it is a single-qubit result. It says nothing about how to build multi-qubit unitaries — that is a much harder problem addressed by Universal Gate Sets and typically requires approximate synthesis (e.g., Solovay–Kitaev) once you also restrict to a discrete gate set like {H, T, CNOT} rather than continuously tunable rotations. If your hardware genuinely offers continuous Rz and Ry pulses, ZYZ gives exact, immediate compilation; if it only offers a fixed discrete set, this theorem tells you the target you are approximating but not how to reach it with finitely many discrete gates.
Worked example
Decompose the Hadamard gate,
Step 1 — global phase. , so , giving . Then
Check: . Good, .
Step 2 — read off . Comparing to the standard form :
Step 3 — solve for angles.
Result:
Verification table, checking each factor and the running product:
| step | matrix | value |
|---|---|---|
| product | — | |
| times | — | ✓ |
The reconstruction exactly reproduces , confirming the algorithm and the underlying theorem on a genuinely non-diagonal, non-trivial gate — not a case where β or γ vanish trivially. As a second, quicker example, decompose the T gate, . Here , so , and , which is already exactly . Since here, we hit the degenerate case: , and only is fixed at ; choosing gives . So , confirming that diagonal gates need no y-rotation at all — exactly as expected, since diagonal unitaries correspond to pure rotations about the Bloch sphere's own z-axis.
Common pitfalls & traps
| pitfall | why it happens | fix | ||||
|---|---|---|---|---|---|---|
| Confusing with in the matrix exponential | rotates the Bloch vector by θ but the matrix entries carry , due to the spin-½ double cover | Always derive from ; never guess the matrix form from memory | ||||
| Forgetting the global phase | Many textbook problems present gates already in , hiding the need for | Always compute first; if , an term is mandatory | ||||
| Dividing by zero when or | Naive blows up at the poles | Use `atan2( | b | , | a | )` and special-case degenerate splits of β, δ |
| Assuming ZYZ angles are unique | At only is determined, not β and δ individually | Treat the decomposition as one valid representative, not a canonical fingerprint, unless you fix a convention | ||||
| Mixing up axis order (ZYZ vs ZXZ vs XYX) | Different textbooks and hardware papers pick different middle/outer axes | State the convention explicitly; verify by direct matrix multiplication, not by pattern memory | ||||
| Treating this as a multi-qubit universality result | ZYZ only proves single-qubit universality of {Rz, Ry} | Remember Universal Gate Sets additionally requires an entangling two-qubit gate |
Pioneers & history
The mathematics underlying rotation gates predates quantum computing by over a century, rooted in the theory of Lie groups and the geometry of rotations, later fused with quantum mechanics by the discovery of electron spin.
Origins · 1 minLeonhard Euler and how this was discovered
Euler showed that any rotation of three-dimensional space can be built from three successive rotations about two axes — the classical ancestor of the ZYZ decomposition used for single-qubit unitaries two centuries later.
Pauli's 1927 formulation of spin-½ quantum mechanics produced the very matrices whose exponentials define , linking the abstract mathematics of directly to physical two-level systems.
Where this matters
Every quantum compiler stack — Qiskit's transpiler, Cirq's optimizers, IBM's and Google's pulse-level control software — implements some variant of this exact Euler-angle decomposition as a basic pass. When a high-level algorithm specifies an arbitrary single-qubit unitary (say, from a variational ansatz whose parameters were just updated by a classical optimizer), the compiler must translate it into the physical control pulses the hardware actually supports. On superconducting-qubit platforms, Rz rotations are frequently implemented "virtually," by simply adjusting the phase reference of subsequent microwave pulses at zero cost and zero error, while Rx/Ry rotations require an actual physical microwave pulse of finite duration and finite fidelity. The ZYZ decomposition, rearranged so the physical work concentrates in the minimum number of Ry pulses (ideally one), directly reduces gate error and circuit depth — a concrete engineering payoff of a purely mathematical theorem. On trapped-ion platforms, native gates are typically Rx and Ry via laser pulses, with Rz again implementable virtually through phase bookkeeping; the same decomposition, reflected onto different axes, governs compilation there too. In photonic and continuous-variable systems, analogous single-mode decompositions appear when compiling optical unitaries into beamsplitters and phase shifters. Beyond hardware compilation, the Euler decomposition also underlies theoretical results about the structure of used throughout quantum information theory, including the study of Universal Gate Sets and approximate synthesis algorithms like Solovay–Kitaev that build on the exact single-qubit case before tackling multi-qubit unitaries in The Quantum Circuit Model.
Ask the tutor: Can you show me how the ZYZ decomposition changes if I require the middle rotation to be about the X-axis instead of Y, and re-derive the angle formulas for that convention?
Why do we divide the angle by 2 in the rotation matrices?
This factor of 2 comes from the spin-½ nature of a qubit under the SU(2)-to-SO(3) double cover. A physical rotation of the Bloch vector by angle θ in ordinary 3D space corresponds to a rotation of the underlying complex state vector by only θ/2 in its own exponential parameter. Concretely, has eigenvalues , and it is precisely this halved phase that, when squared through the density-matrix map , produces a Bloch-vector rotation by the full angle θ. Without the factor of 2, the state vector and the Bloch vector would rotate at different, mismatched rates, breaking the geometric correspondence that makes the Bloch sphere useful at all.
Is the ZYZ decomposition unique?
Not always. When the middle angle γ equals 0 or π, the matrix becomes degenerate in the sense that β and δ only ever appear as a sum or a difference, never independently — exactly the coordinate singularity familiar from classical Euler angles ("gimbal lock"). For generic γ strictly between 0 and π, the decomposition is unique up to the standard periodicity of angles (adding 2π to any angle, or flipping sign conventions consistently). Practical implementations fix a convention, such as restricting γ to and choosing a canonical split at the degenerate points, to get a well-defined, reproducible output.
Why use Rz and Ry specifically, rather than some other pair of axes?
Any two distinct, non-parallel axes work in principle; Rz–Ry and Rz–Rx are simply the most common conventions because they match how physical hardware naturally implements gates. Superconducting and trapped-ion qubits often implement Rz "virtually" for free by shifting a phase reference, while Rx or Ry require an actual driven pulse. Choosing the decomposition whose outer rotations align with the free, virtual gate minimizes the number of costly physical pulses needed to implement any given single-qubit unitary, which is a real engineering optimization, not just a mathematical convenience.
Does this decomposition generalize to multi-qubit gates?
No, not directly. The ZYZ theorem is a special fact about , exploiting that it is only three real parameters, small enough to be spanned by two rotation axes. Multi-qubit unitary groups like for two qubits have far more parameters and no such simple three-rotation formula. Building arbitrary multi-qubit unitaries instead relies on results studied under Universal Gate Sets, typically combining arbitrary single-qubit gates (via exactly this ZYZ trick) with a fixed entangling two-qubit gate such as CNOT, proven sufficient by separate universality theorems.
How does this relate to the Bloch sphere picture I already know?
The Bloch Sphere represents a single-qubit pure state as a point on a unit sphere in . Rotation gates are literally rotations of this sphere: spins the sphere about its vertical axis by angle θ, and tips it about a horizontal axis. The Euler decomposition then says exactly what you would expect from ordinary 3D geometry: any orientation of the sphere reachable by some rotation is reachable by a spin, then a tip, then another spin — precisely the aircraft-attitude "yaw-pitch-yaw" idea generalized from to its quantum double cover .
What happens if my hardware only has Rx and Rz, no Ry — does the theorem still apply?
Yes. The theorem only needs two distinct axes with a middle rotation not parallel to the outer ones; Rz–Rx–Rz works identically to Rz–Ry–Rz, just with different explicit formulas relating the angles to the entries of . In fact and are related by a fixed change of basis, up to global phase considerations, so any working ZYZ decomposition can be algebraically rewritten into a ZXZ form for hardware exposing Rx pulses instead of Ry pulses.
Why is this decomposition considered "exact" rather than an approximation?
Because it is derived from an algebraic identity, not a numerical fitting procedure. Given the exact real and imaginary parts of the entries of , the formulas for α, β, γ, δ involve only `arg`, `atan2`, and elementary arithmetic, all of which, evaluated in exact real arithmetic, reproduce with zero residual error, as verified directly by substituting the recovered angles back into the matrix product. This differs sharply from later results like Solovay–Kitaev, which only approximate a target unitary using a finite discrete gate set and explicitly trade approximation error against circuit length.