The Exercise
The Hadamard gate acts on a single qubit. The exercise asks for single qubit unitaries , and whose product is the identity, together with a phase , such that , where is the Pauli gate. The library answers it with rotations about the and axes.
A Quantum System
A quantum system is a physical object whose state space is a finite dimensional complex Hilbert space.✦ The qubit is the two level system whose state space is , with the computational basis , .✦
A state of is a positive operator of unit trace on the state space of , pure or mixed.✦ A unitary of , an evolution of as a closed system, is an operator on the state space of with .✦ The evolution of a state of under is (1)✦ For two unitaries and of , after is the unitary of with operator : acts first, then .✦
Gates of the Qubit
In the computational basis the Pauli matrices are (2) and the Hadamard matrix is (3)
For a real vector in three dimensions, the matrix is .✦ The rotation by a real angle about is the complex matrix (4)✦ written when the axis is a unit vector . About the axis, , and about the axis, , the rotations are (5)
The Hadamard gate is the unitary of the qubit whose operator acts on as the matrix (3) in the computational basis.✦ The Pauli gate, the quantum NOT, and the rotation gates and , for every real angle , are the unitaries of the qubit given in the same way by and by the matrices (5).
The Three Matrices
The library’s matrices are (6) (7) (8) As a gate of the qubit, is the composite of six gates, (9)
The Claim
Theorem 1. The matrices , and of (6), (7) and (8) multiply to the identity, (10)✦ For every state of the qubit, the Hadamard gate and the gate (9) give the same evolution, (11)✦ and as operators the two differ by the global phase , (12)✦
What Is Checked
The claim is stated over the qubit and its states, the evolution (1) of a state under a unitary, the Hadamard, Pauli and rotation gates and their composites, and the matrices , and built from the rotations and of (5), which rest on the Pauli matrices and the exponential (4).
The library proves that the Hadamard matrix, , and are unitary matrices, so that each gate is a unitary of the qubit, and that a product of unitaries is unitary. Conjugating a density operator by a unitary gives a density operator, so the evolution (1) takes states to states.