Lean, informalized

Nielsen & Chuang · Chapter 4, Quantum circuits · p. 176

Exercise 4.12 - Single qubit rotations with product one that give the Hadamard gate up to a global phase

The Hadamard gate from rotations about two axes.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The Exercise

The Hadamard gate HH acts on a single qubit. The exercise asks for single qubit unitaries AA, BB and CC whose product ABCABC is the identity, together with a phase α\alpha, such that H=eiαAXBXCH = e^{i\alpha} AXBXC, where XX is the Pauli XX gate. The library answers it with rotations about the yˆ\hat y and zˆ\hat z axes.

A Quantum System

A quantum system SS 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 ℂ2\mathbb{C}^2, with the computational basis |0⟩|0\rangle, |1⟩|1\rangle.✦

A state ρ\rho of SS is a positive operator of unit trace on the state space of SS, pure or mixed.✦ A unitary UU of SS, an evolution of SS as a closed system, is an operator on the state space of SS with U†U=UU†=IU^\dagger U = U U^\dagger = I.✦ The evolution of a state ρ\rho of SS under UU is ρ↦UρU†.\rho \mapsto U \rho U^\dagger .(1)✦ For two unitaries UU and VV of SS, UU after VV is the unitary of SS with operator UVUV: VV acts first, then UU.✦

Gates of the Qubit

In the computational basis the Pauli matrices are X=(0110),Y=(0−ii0),Z=(100−1),X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \qquad Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}, \qquad Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},(2) and the Hadamard matrix is H=12(111−1).H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.(3)

For a real vector n→=(nx,ny,nz)\vec n = (n_x, n_y, n_z) in three dimensions, the matrix n→⋅σ→\vec n \cdot \vec\sigma is nxX+nyY+nzZn_x X + n_y Y + n_z Z.✦ The rotation by a real angle θ\theta about n→\vec n is the 2×22 \times 2 complex matrix Rn→(θ)=exp⁡(−iθ2n→⋅σ→),R_{\vec n}(\theta) = \exp\Bigl( -\frac{i\theta}{2}\, \vec n \cdot \vec\sigma \Bigr),(4)✦ written Rnˆ(θ)R_{\hat n}(\theta) when the axis is a unit vector nˆ\hat n. About the yˆ\hat y axis, yˆ=(0,1,0)\hat y = (0, 1, 0), and about the zˆ\hat z axis, zˆ=(0,0,1)\hat z = (0, 0, 1), the rotations are Ry(θ)=e−iθY/2,Rz(θ)=e−iθZ/2.R_y(\theta) = e^{-i\theta Y/2}, \qquad R_z(\theta) = e^{-i\theta Z/2}.(5)

The Hadamard gate HH is the unitary of the qubit whose operator acts on ℂ2\mathbb{C}^2 as the matrix (3) in the computational basis.✦ The Pauli XX gate, the quantum NOT, and the rotation gates Ry(θ)R_y(\theta) and Rz(θ)R_z(\theta), for every real angle θ\theta, are the unitaries of the qubit given in the same way by XX and by the matrices (5).

The Three Matrices

The library’s matrices are A=Ry(π/4),A = R_y(\pi/4),(6) B=Ry(−π/4)Rz(−π/2),B = R_y(-\pi/4)\, R_z(-\pi/2),(7) C=Rz(π/2).C = R_z(\pi/2).(8) As a gate of the qubit, AXBXCAXBXC is the composite of six gates, AXBXC=Ry(π/4)XRy(−π/4)Rz(−π/2)XRz(π/2).AXBXC = R_y(\pi/4)\, X\, R_y(-\pi/4)\, R_z(-\pi/2)\, X\, R_z(\pi/2).(9)

The Claim

Theorem 1. The matrices AA, BB and CC of (6), (7) and (8) multiply to the identity, ABC=I.ABC = I.(10)✦ For every state ρ\rho of the qubit, the Hadamard gate and the gate (9) give the same evolution, HρH†=(AXBXC)ρ(AXBXC)†,H \rho H^\dagger = (AXBXC)\, \rho\, (AXBXC)^\dagger ,(11)✦ and as operators the two differ by the global phase eiπ/2e^{i\pi/2}, H=eiπ/2AXBXC.H = e^{i\pi/2}\, AXBXC.(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 XX and rotation gates and their composites, and the matrices AA, BB and CC built from the rotations RyR_y and RzR_z of (5), which rest on the Pauli matrices and the exponential (4).

The library proves that the Hadamard matrix, XX, Ry(θ)R_y(\theta) and Rz(θ)R_z(\theta) 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.