Lean, informalized

Nielsen & Chuang · Chapter 10, Quantum error-correction · p. 462

Exercise 10.41 - What the Toffoli gate does to XX and ZZ on each of three qubits, and the π/8\pi/8 gate to XX and ZZ on one

Pauli operators under the Toffoli and π/8\pi/8 gates.

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 Toffoli gate UU acts on three qubits and the π/8\pi/8 gate TT on one. The exercise asks what conjugation by these gates does to the Pauli operators: for UU, to XX and to ZZ acting on any one of the three qubits with the identity on the other two, six operators in all; for TT, to XX and to ZZ on its single qubit.

The library gives the eight answers as identities between matrices in the computational basis, where it defines the gates and the Pauli operators.

Gates and Pauli Operators

The identity and the Pauli matrices are the 2×22 \times 2 complex matrices I=(1001),X=(0110),Y=(0−ii0),Z=(100−1),I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}, \quad Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},(1) with rows and columns labelled by 00 and 11. The π/8\pi/8 gate TT is the diagonal matrix T=(100eiπ/4).T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}.(2)✦

The computational basis states |abc⟩|abc\rangle of three qubits, with a,b,c∈{0,1}a, b, c \in \{0, 1\}, are numbered from 00 to 77 by reading abcabc as a binary number, the first qubit the most significant: (a,b,c)↦4a+2b+c.(a, b, c) \longmapsto 4a + 2b + c.(3)✦ The 8×88 \times 8 matrix of an operator MM on the three qubits has in row 4a+2b+c4a + 2b + c and column 4a′+2b′+c′4a' + 2b' + c' the matrix element of MM between the corresponding basis states, M4a+2b+c,4a′+2b′+c′=⟨abc|M|a′b′c′⟩,M_{4a+2b+c,\; 4a'+2b'+c'} = \langle abc | M | a'b'c' \rangle,(4)✦ and an operator on the three qubits is identified with this matrix.

For k=1,2,3k = 1, 2, 3, the Pauli operator XkX_k of the three qubits is the operator that acts as XX on qubit kk and as the identity on the other two: X1=X⊗I⊗I,X_1 = X \otimes I \otimes I,(5)✦ X2=I⊗X⊗I,X_2 = I \otimes X \otimes I,(6)✦ X3=I⊗I⊗X.X_3 = I \otimes I \otimes X.(7)✦ The Pauli operator ZkZ_k acts as ZZ on qubit kk and as the identity on the other two: Z1=Z⊗I⊗I,Z_1 = Z \otimes I \otimes I,(8)✦ Z2=I⊗Z⊗I,Z_2 = I \otimes Z \otimes I,(9)✦ Z3=I⊗I⊗Z.Z_3 = I \otimes I \otimes Z.(10)✦

The Toffoli gate UU is the 8×88 \times 8 permutation matrix that exchanges the basis states numbered 66 and 77, which are |110⟩|110\rangle and |111⟩|111\rangle, and fixes the other six. With ⊕\oplus denoting addition modulo 22, it flips the third qubit exactly when the first two are 11: U|a,b,c⟩=|a,b,c⊕ab⟩.U |a, b, c\rangle = |a, b, c \oplus ab\rangle.(11)✦

The Claim

Theorem 1. Conjugation by the Toffoli gate UU, with U†U^\dagger its conjugate transpose, acts on the Pauli operators of the three qubits as UX1U†=X112(I+Z2+X3−Z2X3),U X_1 U^\dagger = X_1 \, \tfrac{1}{2} \left( I + Z_2 + X_3 - Z_2 X_3 \right),(12)✦ UX2U†=X212(I+Z1+X3−Z1X3),U X_2 U^\dagger = X_2 \, \tfrac{1}{2} \left( I + Z_1 + X_3 - Z_1 X_3 \right),(13)✦ UX3U†=X3,U X_3 U^\dagger = X_3,(14)✦ UZ1U†=Z1,U Z_1 U^\dagger = Z_1,(15)✦ UZ2U†=Z2,U Z_2 U^\dagger = Z_2,(16)✦ UZ3U†=Z312(I+Z1+Z2−Z1Z2),U Z_3 U^\dagger = Z_3 \, \tfrac{1}{2} \left( I + Z_1 + Z_2 - Z_1 Z_2 \right),(17)✦ where II is the identity on the three qubits.

Theorem 2. Conjugation by the π/8\pi/8 gate TT, with T†T^\dagger its conjugate transpose, acts on the Pauli matrices as TXT†=12(X+Y),T X T^\dagger = \frac{1}{\sqrt{2}} \left( X + Y \right),(18)✦ TZT†=Z.T Z T^\dagger = Z.(19)✦

What Is Checked

The six identities for UU are stated over the Toffoli gate (11) and the operators XkX_k and ZkZ_k, tensor products of the matrices (1) written as 8×88 \times 8 matrices by (4) in the numbering (3). The two for TT are stated over the matrices (1) and (2).