Lean, informalized

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

Exercise 4.4 - Rotations about xx, zz and xx by a right angle give the Hadamard gate up to a phase

The Hadamard gate as three rotations and a phase.

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

A gate on a single qubit can be built from rotations about two fixed axes. The exercise asks for the Hadamard gate HH in this form: a product of rotations about the xˆ\hat x and zˆ\hat z axes, times a global phase eiφe^{i\varphi}.

The library’s answer uses three rotations by the angle π/2\pi/2, about the xˆ\hat x, zˆ\hat z and xˆ\hat x 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 SS 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 ℂ2\mathbb{C}^2, with the computational basis |0⟩|0\rangle, |1⟩|1\rangle in which every matrix below is written.✦ 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 is an operator on the state space of SS with U†U=UU†=1U^\dagger U = U U^\dagger = 1; it describes the evolution of SS as a closed system.✦ For unitaries UU and VV of SS, the unitary UU after VV is the product UVUV, which applies VV first and then UU.✦ The evolution of a state ρ\rho of SS under a unitary UU of SS is the state ρ↦UρU†.\rho \mapsto U \rho U^\dagger .(1)✦

Gates of the Qubit

The Pauli matrices are the complex 2×22 \times 2 matrices 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) 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 the combination nxX+nyY+nzZn_x X + n_y Y + n_z Z of the Pauli matrices, with the components of n→\vec n as coefficients.✦ The rotation operator Rn→(θ)R_{\vec n}(\theta) about n→\vec n by a real angle θ\theta is the complex 2×22 \times 2 matrix Rn→(θ)=exp⁡(−iθ2n→⋅σ→),R_{\vec n}(\theta) = \exp\!\left( -\frac{i\theta}{2}\, \vec n \cdot \vec\sigma \right),(3)✦ a matrix exponential; for a unit vector nˆ\hat n it is the rotation Rnˆ(θ)R_{\hat n}(\theta) by θ\theta about the axis nˆ\hat n. The rotations about the xˆ\hat x and zˆ\hat z axes are the cases nˆ=(1,0,0)\hat n = (1, 0, 0) and nˆ=(0,0,1)\hat n = (0, 0, 1): Rx(θ)=e−iθX/2,Rz(θ)=e−iθZ/2.R_x(\theta) = e^{-i\theta X/2}, \qquad R_z(\theta) = e^{-i\theta Z/2}.(4)

For a real angle θ\theta, the rotation gates Rx(θ)R_x(\theta) and Rz(θ)R_z(\theta) of the qubit are the unitaries of the qubit whose matrices are e−iθX/2e^{-i\theta X/2} and e−iθZ/2e^{-i\theta Z/2}.

The Hadamard gate HH is the unitary of the qubit whose matrix is the Hadamard matrix H=12(111−1).H = \frac{1}{\sqrt 2} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.(5)✦

The Claim

Let UU be the unitary of the qubit that applies Rx(π/2)R_x(\pi/2), then Rz(π/2)R_z(\pi/2), then Rx(π/2)R_x(\pi/2) again, so that U=Rx(π/2)Rz(π/2)Rx(π/2)U = R_x(\pi/2)\, R_z(\pi/2)\, R_x(\pi/2).

Theorem 1. The Hadamard gate is the product of the three rotations up to a global phase: H=eiπ/2Rx(π/2)Rz(π/2)Rx(π/2).H = e^{i\pi/2}\, R_x(\pi/2)\, R_z(\pi/2)\, R_x(\pi/2).(6)✦ For every state ρ\rho of the qubit, the evolution under HH and the evolution under UU give the same state: HρH†=UρU†.H \rho H^\dagger = U \rho U^\dagger .(7)✦

What Is Checked

The claim is stated over the Hadamard gate HH and the rotation gates Rx(π/2)R_x(\pi/2) and Rz(π/2)R_z(\pi/2) of the qubit, over the unitary UU that composes them, and over the evolution (1) of a state of the qubit under HH and under UU.

About these constructions the library proves that the Hadamard matrix (5) and the matrices Rx(θ)R_x(\theta) and Rz(θ)R_z(\theta) of (4) are unitary for every angle θ\theta, 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 UρU†U \rho U^\dagger is again a state.