Lean, informalized

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

Exercise 10.72 - The three qubit ancilla of the fault tolerant Toffoli gate and the three gates that fix it and no other state

Three stabilizers single out the Toffoli ancilla.

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 fault tolerant Toffoli circuit consumes an ancilla, a fixed state |ΘT⟩\lvert \Theta_T \rangle of three qubits prepared ahead of time. The exercise asks for its expansion in the computational basis and for two facts about three gates on the three qubits, each a Pauli operator on one qubit times a controlled operation on the other two. Each of the three leaves |ΘT⟩\lvert \Theta_T \rangle unchanged, and up to a global phase no other pure state of the three qubits is left unchanged by all of them.✦

Three Qubits

A quantum system SS is a physical system whose state space is a finite dimensional complex Hilbert space.✦ The qubit QQ is the two level system with state space ℂ2\mathbb{C}^2.✦ For two systems SS and TT, the composite S⊗TS \otimes T is the system whose state space is the tensor product of theirs.✦ Three qubits form the register Q⊗(Q⊗Q)Q \otimes (Q \otimes Q), the first qubit composed with the pair of the other two, and the qubits are numbered 1,2,31, 2, 3 from the left.

A pure state |ψ⟩\lvert \psi \rangle of SS is a unit vector in the state space of SS.✦ A state ρ\rho of SS is a positive operator of unit trace on the state space of SS✦, and each pure state |ψ⟩\lvert \psi \rangle determines the state |ψ⟩⟨ψ|\lvert \psi \rangle\langle \psi \rvert, the rank one projector onto it.✦ The basis states |0⟩\lvert 0 \rangle and |1⟩\lvert 1 \rangle of the qubit are the pure states given by the standard basis vectors e0e_0 and e1e_1 of ℂ2\mathbb{C}^2.✦ For pure states |ψ⟩\lvert \psi \rangle of SS and |φ⟩\lvert \varphi \rangle of TT, the product |ψ⟩⊗|φ⟩\lvert \psi \rangle \otimes \lvert \varphi \rangle is the pure state of S⊗TS \otimes T whose vector is the tensor product of the two✦, and the computational basis of the register consists of the products |q1q2q3⟩=|q1⟩⊗(|q2⟩⊗|q3⟩),q1,q2,q3∈{0,1}.\lvert q_1 q_2 q_3 \rangle = \lvert q_1 \rangle \otimes \bigl( \lvert q_2 \rangle \otimes \lvert q_3 \rangle \bigr), \qquad q_1, q_2, q_3 \in \{0, 1\}.(1)✦

Gates

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✦, where 11 is the identity operator; it carries a pure state |ψ⟩\lvert \psi \rangle of SS to the pure state U|ψ⟩U \lvert \psi \rangle.✦ For two unitaries UU and VV of SS, the product UVUV is the unitary that applies VV first and then UU.✦ A pure state |ψ⟩\lvert \psi \rangle of SS is an eigenstate of a unitary UU of SS, with eigenvalue μ∈ℂ\mu \in \mathbb{C}, when U|ψ⟩=μ|ψ⟩U \lvert \psi \rangle = \mu \lvert \psi \rangle, and UU stabilizes |ψ⟩\lvert \psi \rangle when μ=1\mu = 1.✦

The Pauli XX or quantum NOT, the Pauli ZZ or phase flip, and the Hadamard HH are the unitaries of the qubit with the matrices X=(0110),Z=(100−1),H=12(111−1).X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \qquad Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}, \qquad H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.(2)

For a unitary UU of SS and a unitary VV of TT, the product unitary U⊗VU \otimes V of S⊗TS \otimes T is the one whose operator is the tensor product of the operators of UU and VV.✦ With the identity unitary 11 in one of the two places it puts a gate on a single factor: U⊗1U \otimes 1 applies UU to SS and leaves TT alone✦, and 1⊗V1 \otimes V applies VV to TT.✦ On the register a gate on one qubit carries that qubit’s number, X1=X⊗1,X2=1⊗(X⊗1),Z3=1⊗(1⊗Z),X_1 = X \otimes 1, \qquad X_2 = 1 \otimes (X \otimes 1), \qquad Z_3 = 1 \otimes (1 \otimes Z),(3) and H1H_1 and H2H_2 are formed in the same way.

For a unitary UU of SS, the controlled gate C(U)C(U) is the unitary of Q⊗SQ \otimes S, a control qubit followed by the target SS, given by C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U.C(U) = \lvert 0 \rangle\langle 0 \rvert \otimes 1 + \lvert 1 \rangle\langle 1 \rvert \otimes U .(4)✦ The CNOT gate is C(X)C(X) on two qubits✦, and CNOT23=1⊗CNOT\mathrm{CNOT}_{23} = 1 \otimes \mathrm{CNOT} is the CNOT on qubits 2 and 3 of the register, with qubit 2 as control. Taking qubit 1 as control and the pair as target, CNOT13=C(1⊗X)\mathrm{CNOT}_{13} = C(1 \otimes X) flips qubit 3 when qubit 1 is |1⟩\lvert 1 \rangle✦, and the controlled ZZ on qubits 1 and 2, CZ12=C(Z⊗1)\mathrm{CZ}_{12} = C(Z \otimes 1), takes |q1q2q3⟩\lvert q_1 q_2 q_3 \rangle to (−1)q1q2|q1q2q3⟩(-1)^{q_1 q_2} \lvert q_1 q_2 q_3 \rangle.✦ Iterated, the construction gives the doubly controlled gate C2(U)=C(C(U))C^2(U) = C(C(U)) of a unitary UU of the qubit, which applies UU to qubit 3 exactly when qubits 1 and 2 are both |1⟩\lvert 1 \rangle✦; the Toffoli gate is C2(X)C^2(X).✦

The Ancilla and Its Stabilizers

The preparation circuit Prep\mathrm{Prep} is the unitary of the register that applies a Hadamard to each of qubits 1 and 2 and then the Toffoli gate✦, and the ancilla is the pure state it makes from |000⟩\lvert 000 \rangle: Prep=ToffoliH1H2,|ΘT⟩=Prep|000⟩.\mathrm{Prep} = \mathrm{Toffoli}\; H_1 H_2, \qquad \lvert \Theta_T \rangle = \mathrm{Prep}\, \lvert 000 \rangle .(5)✦

The three gates of the exercise are the unitaries of the register g1=X1CNOT23,g_1 = X_1\, \mathrm{CNOT}_{23},(6)✦ g2=X2CNOT13,g_2 = X_2\, \mathrm{CNOT}_{13},(7)✦ g3=Z3CZ12.g_3 = Z_3\, \mathrm{CZ}_{12}.(8)✦

The Claim

Theorem 1. The ancilla is |ΘT⟩=12(|000⟩+|010⟩+|100⟩+|111⟩),\lvert \Theta_T \rangle = \tfrac{1}{2} \bigl( \lvert 000 \rangle + \lvert 010 \rangle + \lvert 100 \rangle + \lvert 111 \rangle \bigr),(9)✦ and each of the gates g1g_1, g2g_2, g3g_3 stabilizes it: g1|ΘT⟩=|ΘT⟩,g_1 \lvert \Theta_T \rangle = \lvert \Theta_T \rangle,(10)✦ g2|ΘT⟩=|ΘT⟩,g_2 \lvert \Theta_T \rangle = \lvert \Theta_T \rangle,(11)✦ g3|ΘT⟩=|ΘT⟩.g_3 \lvert \Theta_T \rangle = \lvert \Theta_T \rangle.(12)✦ If a pure state |ψ⟩\lvert \psi \rangle of the register is stabilized by g1g_1, g2g_2 and g3g_3, then |ψ⟩⟨ψ|=|ΘT⟩⟨ΘT|.\lvert \psi \rangle\langle \psi \rvert = \lvert \Theta_T \rangle\langle \Theta_T \rvert .(13)✦

What Is Checked

The claim is stated over the ancilla (5), the three gates (6), (7) and (8), the eigenstate condition with eigenvalue 11, and the state |ψ⟩⟨ψ|\lvert \psi \rangle\langle \psi \rvert of a pure state; the gates are built from (2), (3) and (4).

About these constructions the library proves that the operator (4) is unitary for every unitary UU, C(U)†C(U)=C(U)C(U)†=1C(U)^\dagger C(U) = C(U) C(U)^\dagger = 1✦, and that the matrices (2) are unitary and so give unitaries of the qubit. A product of unitaries is unitary, both UVUV and U⊗VU \otimes V.