Lean, informalized

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

Exercise 4.13 - The three Pauli matrices placed between two Hadamard matrices

Between two Hadamard gates, XX and ZZ trade places.

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

Take a qubit and a circuit of three gates on it: a Hadamard gate HH, then one of the Pauli gates XX, YY or ZZ, then a second Hadamard gate. The circuit acts on the qubit as the product HXHHXH, HYHHYH or HZHHZH, and the exercise asks which single gate each of these three products is.

The Gates as Matrices

Each gate is written as its matrix in the computational basis |0⟩,|1⟩|0\rangle, |1\rangle of the qubit. The Pauli matrices XX, YY and ZZ 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},(1) with ii the imaginary unit. The Hadamard matrix HH is the complex 2×22 \times 2 matrix H=12(111−1).H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.(2)✦

The Claim

Theorem 1. Let HH be the Hadamard matrix (2) and let XX, YY and ZZ be the Pauli matrices (1). Then HXH=Z,HXH = Z,(3)✦ HYH=−Y,HYH = -Y,(4)✦ HZH=X.HZH = X.(5)✦

What Is Checked

The theorem is stated over the matrices (1) and (2) and assumes nothing else about them. About these matrices the library proves the identities (3), (4) and (5), each an equality of 2×22 \times 2 matrices under the matrix product.