Lean, informalized

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

Exercise 10.26 - For any parity check matrix HH, controlled NOT gates alone take |x⟩|0⟩|x\rangle|0\rangle to |x⟩|Hx⟩|x\rangle|Hx\rangle

A circuit of controlled NOT gates computes the syndrome.

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

A classical linear code on nn bits is described by a parity check matrix HH, a k×nk \times n matrix of bits. The syndrome of a string x=(x1,…,xn)x = (x_1, \dots, x_n) of nn bits is the string HxHx of kk bits with entries (Hx)i=∑j=1nHijxj(mod⁡2),i=1,…,k.(Hx)_i = \sum_{j=1}^{n} H_{ij}\, x_j \pmod{2}, \qquad i = 1, \dots, k .(1) The exercise asks for a quantum circuit made of controlled NOT (CNOT) gates alone that takes nn data qubits in the basis state |x⟩|x\rangle and kk ancilla qubits in |0⟩|0\rangle to |x⟩|Hx⟩|x\rangle|Hx\rangle.

A Register of Qubits

A quantum system SS is a physical system whose state space is a finite dimensional complex Hilbert space.✦ A pure state |ψ⟩|\psi\rangle of SS is a unit vector in the state space of SS.✦ The closed evolutions of SS are its unitaries: 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✦, and it acts on pure states by |ψ⟩↦U|ψ⟩|\psi\rangle \mapsto U|\psi\rangle✦.

The qubit QQ is the two level system whose state space is ℂ2\mathbb{C}^2.✦ The computational basis states |0⟩|0\rangle and |1⟩|1\rangle of the qubit QQ are the two standard basis vectors of ℂ2\mathbb{C}^2.✦

The composite system ⨂iSi\bigotimes_i S_i of systems SiS_i, one for each ii in a finite index set, is the system whose state space is the tensor product of the state spaces of the SiS_i.✦ The product ⨂i|ψi⟩\bigotimes_i |\psi_i\rangle of pure states |ψi⟩|\psi_i\rangle of the factors is the pure state of the composite whose vector is the tensor product of theirs.✦ The register Q⊗mQ^{\otimes m} of mm qubits is the tensor power of the qubit, the composite of mm copies of QQ.✦ The computational basis state |c⟩|c\rangle of Q⊗mQ^{\otimes m} for a string c=(c1,…,cm)c = (c_1, \dots, c_m) of mm bits is the product |c⟩=|c1⟩⊗|c2⟩⊗⋯⊗|cm⟩.|c\rangle = |c_1\rangle \otimes |c_2\rangle \otimes \cdots \otimes |c_m\rangle .(2)

Controlled NOT Gates

A multiply controlled NOT gate g=(S,t)g = (S, t) on mm wires, the mm positions of a string of mm bits, is a set SS of control wires together with a target wire tt.✦ The control bit of gg on a string cc of mm bits is 11 when cc carries a 11 on every wire of SS and 00 otherwise, the product ∏i∈Sci\prod_{i \in S} c_i.✦ The gate takes cc to the string g(c)g(c) in which the control bit has been added to the bit on the target wire modulo 22: g(c)t=ct⊕∏i∈Sci,g(c)w=cw(w≠t).g(c)_t = c_t \oplus \prod_{i \in S} c_i , \qquad g(c)_w = c_w \quad (w \neq t) .(3)✦ With one control it is the CNOT, and with two the Toffoli gate.

The classical action of a circuit C=(g1,…,gL)C = (g_1, \dots, g_L) of such gates on a string cc of mm bits applies the gates in turn, gLg_L first: C(c)=g1(g2(⋯gL(c)⋯)).C(c) = g_1\bigl(g_2(\cdots g_L(c) \cdots)\bigr) .(4)✦

The Claim

The wires of a circuit on n+kn + k wires are the qubits of the register Q⊗(n+k)Q^{\otimes(n+k)}, the first nn holding the data and the last kk the ancillas. For a string xx of nn bits, |x⟩|0⟩|x\rangle|0\rangle is the basis state (2) of the string with xx on the data and zeros on the ancillas, and |x⟩|Hx⟩|x\rangle|Hx\rangle the one with the syndrome (1) on the ancillas.

Theorem 1. Let HH be a k×nk \times n matrix of bits. There are a circuit CC on n+kn + k wires whose gates are CNOTs, each with a single control wire and a different target wire, and a unitary UU of the register Q⊗(n+k)Q^{\otimes(n+k)} that acts on every computational basis state as the circuit does, U|c⟩=|C(c)⟩U|c\rangle = |C(c)\rangle for every string cc of n+kn + k bits, and that computes the syndrome: for every string xx of nn bits, U|x⟩|0⟩=|x⟩|Hx⟩.U\,|x\rangle|0\rangle = |x\rangle|Hx\rangle .(5)✦

What Is Checked

The claim is stated over the register Q⊗(n+k)Q^{\otimes(n+k)}, the tensor power of the qubit, with its computational basis states (2) formed as products of the qubit states |0⟩|0\rangle and |1⟩|1\rangle, and over a unitary of the register acting on them.

The library proves that the composite of finitely many systems has a finite dimensional state space, the products of basis vectors of the factors forming a basis of it, and that a product of pure states is a unit vector there, its squared norm being the product of the squared norms of the factors. It proves as well that U|ψ⟩U|\psi\rangle is a unit vector whenever |ψ⟩|\psi\rangle is, since a unitary preserves norms.