The Theorem
A gate on a single qubit is a unitary operator on its state space ; in the computational basis it is a unitary complex matrix . Theorem 4.1 of Nielsen and Chuang says that rotations about two fixed axes of the Bloch sphere, and , are enough to build every such gate.
The library states the theorem for the matrix , with each rotation the exponential of a combination of the three Pauli matrices , and defined next.
Rotations About an Axis
The Pauli matrices , and are the complex matrices (1) The Pauli vector is , and for a real vector in three dimensions the matrix is the complex matrix (2)✦
The rotation about the axis by a real angle is the complex matrix (3)✦ a matrix exponential. For a unit vector it is written .
The rotation about the axis is the rotation about the unit vector , and the rotation about the axis is the one about . Since and , (4)
The Claim
Theorem 1. Let be a unitary complex matrix. Then there are real numbers , , and such that (5)✦
What Is Checked
The claim is stated over an arbitrary unitary complex matrix and over the rotations and of (4), which rest on the rotation (3) about an axis, the matrix of (2) and the Pauli matrices (1).