The Exercise
A gate on a single qubit can be built from rotations about two fixed axes. The exercise asks for the Hadamard gate in this form: a product of rotations about the and axes, times a global phase .
The library’s answer uses three rotations by the angle , about the , and axes in turn, and holds both for the gates themselves and for the way they act on the states of the qubit.
A Quantum System
A quantum system is a physical system whose state space is a finite dimensional complex Hilbert space.✦ The qubit is the two level quantum system whose state space is , with the computational basis , in which every matrix below is written.✦ A state of is a positive operator of unit trace on the state space of , pure or mixed.✦
A unitary of is an operator on the state space of with ; it describes the evolution of as a closed system.✦ For unitaries and of , the unitary after is the product , which applies first and then .✦ The evolution of a state of under a unitary of is the state (1)✦
Gates of the Qubit
The Pauli matrices are the complex matrices (2) For a real vector in three dimensions, the matrix is the combination of the Pauli matrices, with the components of as coefficients.✦ The rotation operator about by a real angle is the complex matrix (3)✦ a matrix exponential; for a unit vector it is the rotation by about the axis . The rotations about the and axes are the cases and : (4)
For a real angle , the rotation gates and of the qubit are the unitaries of the qubit whose matrices are and .
The Hadamard gate is the unitary of the qubit whose matrix is the Hadamard matrix (5)✦
The Claim
Let be the unitary of the qubit that applies , then , then again, so that .
Theorem 1. The Hadamard gate is the product of the three rotations up to a global phase: (6)✦ For every state of the qubit, the evolution under and the evolution under give the same state: (7)✦
What Is Checked
The claim is stated over the Hadamard gate and the rotation gates and of the qubit, over the unitary that composes them, and over the evolution (1) of a state of the qubit under and under .
About these constructions the library proves that the Hadamard matrix (5) and the matrices and of (4) are unitary for every angle , so that each gate is a unitary of the qubit. It proves as well that the product of two unitaries is unitary, and that conjugating a density operator by a unitary gives a density operator, so that is again a state.