Lean, informalized

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

Exercise 10.66 - The circuit of figure 10.25 on its amplitudes, and the gate identities behind it

Applying the T gate through an ancilla and a measurement.

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 circuit of Figure 10.25 applies the π/8\pi/8 gate TT to a data qubit |ψ⟩=a|0⟩+b|1⟩|\psi\rangle = a|0\rangle + b|1\rangle without ever acting on that qubit with TT. An ancilla is prepared in the state |Θ⟩|\Theta\rangle that a Hadamard gate HH followed by TT makes from |0⟩|0\rangle. A controlled NOT gate (CNOT) then acts with the ancilla as control and the data qubit as target, and the data qubit is measured in the computational basis. On outcome 00 the ancilla is left in T|ψ⟩T|\psi\rangle.✦ On outcome 11 the correction SXSX, the bit flip XX followed by the phase gate SS, brings it to T|ψ⟩T|\psi\rangle up to a global phase.

Gates and States

Each gate is a matrix in the computational basis |0⟩=(1,0)|0\rangle = (1,0), |1⟩=(0,1)|1\rangle = (0,1) of ℂ2\mathbb{C}^2. The π/8\pi/8 gate TT, the phase gate SS, the Pauli matrix XX and the Hadamard gate HH are the complex 2×22 \times 2 matrices T=(100eiπ/4),S=(100i),X=(0110),H=12(111−1).T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}, \qquad S = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}, \qquad X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \qquad H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.(1) The correction gate SXSX is the product of the phase gate and the Pauli matrix XX, SX=SX=(01i0).SX = S\,X = \begin{pmatrix} 0 & 1 \\ i & 0 \end{pmatrix}.(2)✦ The ancilla state |Θ⟩|\Theta\rangle is the qubit state |Θ⟩=12(|0⟩+eiπ/4|1⟩).|\Theta\rangle = \frac{1}{\sqrt{2}} \bigl( |0\rangle + e^{i\pi/4} |1\rangle \bigr).(3)✦

A vector of two qubits has four amplitudes, on |00⟩|00\rangle, |01⟩|01\rangle, |10⟩|10\rangle and |11⟩|11\rangle in this order. The tensor product of qubit vectors |u⟩=u0|0⟩+u1|1⟩|u\rangle = u_0|0\rangle + u_1|1\rangle and |v⟩=v0|0⟩+v1|1⟩|v\rangle = v_0|0\rangle + v_1|1\rangle is the vector of two qubits |u⟩⊗|v⟩=(u0v0,u0v1,u1v0,u1v1).|u\rangle \otimes |v\rangle = (u_0 v_0,\ u_0 v_1,\ u_1 v_0,\ u_1 v_1).(4)✦ The CNOT with the first qubit as control is the 4×44 \times 4 matrix that exchanges |10⟩|10\rangle and |11⟩|11\rangle and fixes |00⟩|00\rangle and |01⟩|01\rangle. The gate TT on the control qubit is T⊗IT \otimes I, where II is the identity on the second qubit; it is the diagonal matrix T⊗I=diag⁡(1,1,eiπ/4,eiπ/4).T \otimes I = \operatorname{diag}\bigl(1,\ 1,\ e^{i\pi/4},\ e^{i\pi/4}\bigr).(5)✦

For complex numbers aa and bb, the state of the circuit after the CNOT is the vector of two qubits |χ⟩=CNOT(|Θ⟩⊗|ψ⟩)=χ0|00⟩+χ1|01⟩+χ2|10⟩+χ3|11⟩,|\chi\rangle = \mathrm{CNOT}\,\bigl(|\Theta\rangle \otimes |\psi\rangle\bigr) = \chi_0|00\rangle + \chi_1|01\rangle + \chi_2|10\rangle + \chi_3|11\rangle,(6)✦ with the ancilla as the first qubit and the data qubit |ψ⟩=a|0⟩+b|1⟩|\psi\rangle = a|0\rangle + b|1\rangle as the second. The data qubit reads 00 on the amplitudes χ0\chi_0 and χ2\chi_2, and 11 on χ1\chi_1 and χ3\chi_3.

The Claim

Theorem 1. Let aa and bb be complex numbers, |ψ⟩=a|0⟩+b|1⟩|\psi\rangle = a|0\rangle + b|1\rangle, and |χ⟩|\chi\rangle the state (6). The vector the ancilla is left with on outcome 00 of the data qubit is χ0|0⟩+χ2|1⟩=12T|ψ⟩,\chi_0|0\rangle + \chi_2|1\rangle = \frac{1}{\sqrt{2}}\, T|\psi\rangle,(7)✦ and the correction SXSX takes the vector it is left with on outcome 11 to SX(χ1|0⟩+χ3|1⟩)=eiπ/42T|ψ⟩.SX \bigl( \chi_1|0\rangle + \chi_3|1\rangle \bigr) = \frac{e^{i\pi/4}}{\sqrt{2}}\, T|\psi\rangle.(8)✦

Theorem 2. The Hadamard gate and TT prepare the ancilla state from |0⟩|0\rangle: TH|0⟩=|Θ⟩.TH|0\rangle = |\Theta\rangle.(9)✦ The gate TT on the control qubit commutes with the CNOT: (T⊗I)CNOT=CNOT(T⊗I).(T \otimes I)\,\mathrm{CNOT} = \mathrm{CNOT}\,(T \otimes I).(10)✦ Conjugation by TT takes XX to a multiple of the correction gate, TXT†=e−iπ/4SX,T X T^\dagger = e^{-i\pi/4}\, SX,(11)✦ while the product TXTX differs from that multiple: TX≠e−iπ/4SX.TX \neq e^{-i\pi/4}\, SX.(12)✦

What Is Checked

The first theorem is stated over the state (6) after the CNOT and over the gates TT and SXSX. What the library proves about these constructions is the second theorem, (9) to (12).