Lean, informalized

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

Exercise 10.1 - Two controlled NOT gates take a qubit and two zeros to the bit flip codeword

Encoding a qubit in the three qubit bit flip code.

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 three qubit bit flip code stores a state a|0⟩+b|1⟩a|0\rangle + b|1\rangle of one qubit, with |a|2+|b|2=1|a|^2 + |b|^2 = 1, in three qubits. Two more qubits, each prepared in |0⟩|0\rangle, are placed beside it, and the encoding circuit acts on all three. The exercise is to verify that the circuit returns a|000⟩+b|111⟩a|000\rangle + b|111\rangle.

A Quantum System

A quantum system SS is a physical system whose state space is a finite dimensional complex Hilbert space.✦ A pure state ψ\psi of SS is a unit vector ψ\psi in the state space of SS, ‖ψ‖=1\lVert \psi \rVert = 1, determined physically up to a global phase.✦ The superposition aψ+bφa\psi + b\varphi of two orthogonal pure states ψ\psi and φ\varphi of SS, with complex amplitudes aa and bb such that |a|2+|b|2=1|a|^2 + |b|^2 = 1, is again a pure state of SS.✦

The composite system S⊗TS \otimes T of two systems SS and TT is the system whose state space is the tensor product of their state spaces.✦ Given pure states ψ\psi of SS and φ\varphi of TT, the product ψ⊗φ\psi \otimes \varphi is the pure state of S⊗TS \otimes T given by the tensor product of the two vectors.✦

The Qubit

The qubit is the two level system whose state space is ℂ2\mathbb{C}^2.✦ The basis state |i⟩|i\rangle of the qubit, for a bit ii, is the pure state given by the standard basis vector eie_i of ℂ2\mathbb{C}^2; |0⟩|0\rangle and |1⟩|1\rangle are the computational basis states.✦ With amplitudes aa and bb such that |a|2+|b|2=1|a|^2 + |b|^2 = 1, the qubit state a|0⟩+b|1⟩a|0\rangle + b|1\rangle(1)✦ is the superposition of the two basis states.

The state space of three qubits is ℂ2⊗ℂ2⊗ℂ2\mathbb{C}^2 \otimes \mathbb{C}^2 \otimes \mathbb{C}^2, and |ijk⟩|ijk\rangle stands for the product state |i⟩⊗|j⟩⊗|k⟩|i\rangle \otimes |j\rangle \otimes |k\rangle. The bit flip codeword with the amplitudes aa and bb of (1) is the pure state of three qubits a|000⟩+b|111⟩.a|000\rangle + b|111\rangle.(2)✦

Unitaries and Controlled Gates

A unitary UU of a quantum system SS is an operator on the state space of SS with U†U=UU†=IU^\dagger U = U U^\dagger = I, where II is the identity; it is a closed system evolution of SS✦, and it carries a pure state ψ\psi of SS to the pure state UψU\psi✦. The identity II is itself a unitary of SS, the identity evolution.✦ Two unitaries UU and VV of SS compose to the unitary UVUV, first VV then UU.✦ When UU is a unitary of SS and VV one of TT, the product unitary U⊗VU \otimes V of S⊗TS \otimes T is the tensor product of the two operators.✦

The Pauli XX of the qubit, the quantum NOT, is the unitary whose matrix in the computational basis is X=(0110).X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.(3)✦

Let UU be a unitary of a system SS. The controlled gate C(U)C(U) on the composite of a control qubit and the target SS is C(U)=|0⟩⟨0|⊗I+|1⟩⟨1|⊗U.C(U) = |0\rangle\langle 0| \otimes I + |1\rangle\langle 1| \otimes U.(4)✦

The Encoding Circuit

The encoding circuit EE is the unitary of three qubits E=C(X⊗I)C(I⊗X),E = C(X \otimes I)\, C(I \otimes X),(5)✦ in which both controlled gates take the first qubit as control and the other two as target. The gate that acts first, C(I⊗X)C(I \otimes X), is a controlled NOT on the third qubit, and C(X⊗I)C(X \otimes I) is a controlled NOT on the second.

The Claim

Theorem 1. Let aa and bb be complex numbers with |a|2+|b|2=1|a|^2 + |b|^2 = 1. The encoding circuit EE, applied to the pure state of three qubits in which the first is in the state a|0⟩+b|1⟩a|0\rangle + b|1\rangle and the other two are in |0⟩|0\rangle, gives the bit flip codeword: E((a|0⟩+b|1⟩)⊗|0⟩⊗|0⟩)=a|000⟩+b|111⟩.E\bigl((a|0\rangle + b|1\rangle) \otimes |0\rangle \otimes |0\rangle\bigr) = a|000\rangle + b|111\rangle.(6)✦

What Is Checked

The claim is stated over the encoding circuit (5), built from the controlled gate (4), the Pauli XX and the identity evolution, over the product input state and the codeword (2), and over the action of a unitary on a pure state.

The library proves that the matrix (3) is unitary, and that C(U)C(U) is unitary for every unitary UU of every system.