Lean, informalized

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

Problem 10.3 - A circuit carrying each generator ZiZ_i of |0⟩⊗n|0\rangle^{\otimes n} to its row of the standard form

An encoding circuit for stabilizer codes in standard form.

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

Encoding a stabilizer code on nn qubits starts from |0⟩⊗n|0\rangle^{\otimes n}, whose stabilizer is generated by Z1,…,ZnZ_1, \dots, Z_n; the generator ZiZ_i is ZZ on qubit ii and the identity on every other qubit.✦ A unitary UU carries this stabilizer to the one generated by the UZiU†U Z_i U^\dagger, and it encodes the code when these are the generators of the code together with its encoded ZZ operators.

A Pauli string gg on nn qubits is a tensor product g1⊗⋯⊗gng_1 \otimes \cdots \otimes g_n of single qubit operators gk∈{I,X,Y,Z}g_k \in \{I, X, Y, Z\}, taken up to an overall phase. The check bits of a single qubit Pauli operator are its XX bit, which is 11 for XX and YY and 00 for II and ZZ, and its ZZ bit, which is 11 for YY and ZZ and 00 for II and XX.✦ The check row of gg lists the check bits of its factors, r(g)=(x|z)∈ℤ2n×ℤ2n,(xk,zk)=the check bits of gk,r(g) = (x \,|\, z) \in \mathbb{Z}_2^n \times \mathbb{Z}_2^n, \qquad (x_k, z_k) = \text{the check bits of } g_k,(1)✦ and the check matrix of a family of Pauli strings has their check rows as its rows.

Let the code encode kk qubits, with its generators in standard form. Their check matrix, with the check rows of the encoded ZZ operators below it, is [IA1A2B0C000DIE000A2T0I],\left[\begin{array}{ccc|ccc} I & A_1 & A_2 & B & 0 & C \\ 0 & 0 & 0 & D & I & E \\ 0 & 0 & 0 & A_2^{T} & 0 & I \end{array}\right],(2) where II and 00 are identity and zero blocks, A1,A2,B,C,D,EA_1, A_2, B, C, D, E are binary matrices, rr is the number of generators with an XX part, and the columns on either side of the bar fall into blocks of rr, n−k−rn-k-r and kk. The check matrix of Z1,…,ZnZ_1, \dots, Z_n is (0|I)(0 \,|\, I), and Problem 10.3 asks for a circuit that takes it to (2).

Gates and Circuits

An elementary Clifford gate on nn wires, one for each qubit, is a Hadamard gate HjH_j on a wire jj, a phase gate SjS_j on a wire jj, or a controlled NOT gate CNOTc→t\mathrm{CNOT}_{c \to t} (CNOT) with control cc and a different target tt.✦ A Clifford circuit is a finite sequence of such gates; the sequence G1,…,GmG_1, \dots, G_m stands for the unitary G1G2⋯GmG_1 G_2 \cdots G_m, in which GmG_m acts first.✦

A gate GG acts on a Pauli string gg by conjugation, taking it to GgG†G g G^\dagger up to phase: HjH_j and SjS_j change only the factor on wire jj, a CNOT only the factors on its two wires.✦ A circuit acts gate by gate, and UgU†U g U^\dagger is the Pauli string that the circuit UU makes of gg.✦

The controlled ZZ gate on two different wires cc and tt is the circuit CZct=HtCNOTc→tHt.\mathrm{CZ}_{ct} = H_t \, \mathrm{CNOT}_{c \to t} \, H_t .(3)✦

The Encoding Circuit

Standard form data on nn wires consist of three pairwise disjoint groups of wires, the pivots 𝒫\mathcal P and the data wires 𝒟\mathcal D, each listed without repetition, and the middle wires ℳ\mathcal M, together with a list T(w)T(w) of distinct targets for every wire ww; the targets of a pivot are middle or data wires, and those of a data wire are middle wires.✦ For (2) the pivots are the first rr wires, the middle wires the next n−k−rn-k-r and the data wires the last kk; T(p)T(p) is the support of row pp of (A1A2)(A_1\; A_2), and T(d)T(d) the support of column dd of EE.

The Hadamard layer H𝒫=∏p∈𝒫HpH_{\mathcal P} = \prod_{p \in \mathcal P} H_p puts a Hadamard on every pivot.✦ The CNOT fan FcF_c from a wire cc to its targets applies CNOTc→t\mathrm{CNOT}_{c \to t} for each t≠ct \neq c in T(c)T(c) in turn✦, and the CNOT network N=∏cFcN = \prod_c F_c runs over the pivots cc and then the data wires cc, in the order listed.✦ The core is the Clifford circuit VV made of the Hadamard layer H𝒫H_{\mathcal P} followed by the CNOT network NN, V=NH𝒫.V = N \, H_{\mathcal P} .(4)✦

For a list WW of wires, the phase layer SW=∏w∈WSwS_W = \prod_{w \in W} S_w puts a phase gate on every wire of WW✦; for a list Γ\Gamma of pairs of wires, the controlled ZZ network CZΓ\mathrm{CZ}_\Gamma is the product of CZab\mathrm{CZ}_{ab} over the pairs (a,b)(a, b) of Γ\Gamma with a≠ba \neq b.✦ The phase and controlled ZZ network SWCZΓS_W\,\mathrm{CZ}_\Gamma placed after the core gives the encoding circuit UW,Γ=SWCZΓV.U_{W,\Gamma} = S_W \, \mathrm{CZ}_\Gamma \, V .(5)✦

The Claim

For a set AA of wires, 𝟏A∈ℤ2n\mathbf 1_A \in \mathbb{Z}_2^n is its indicator vector, and v|Av|_A is the vector that agrees with v∈ℤ2nv \in \mathbb{Z}_2^n on AA and vanishes off it; epe_p is 𝟏{p}\mathbf 1_{\{p\}}, and the subscript pp on a matrix marks its row pp.

Theorem 1. Let 𝒫\mathcal P, ℳ\mathcal M, 𝒟\mathcal D and TT be standard form data on nn wires, with core VV.

(a) Let WW be a list of distinct wires and Γ\Gamma a list of pairs of distinct wires. Then for every data wire dd r(UW,ΓZdUW,Γ†)=r(VZdV†),r\bigl(U_{W,\Gamma} Z_d U_{W,\Gamma}^\dagger\bigr) = r\bigl(V Z_d V^\dagger\bigr),(6)✦ and for every middle wire mm r(UW,ΓZmUW,Γ†)=r(VZmV†).r\bigl(U_{W,\Gamma} Z_m U_{W,\Gamma}^\dagger\bigr) = r\bigl(V Z_m V^\dagger\bigr).(7)✦

(b) Let BB and CC be n×nn \times n matrices over ℤ2\mathbb{Z}_2, with Cqd=0C_{qd} = 0 whenever dd is not a data wire, such that for all pivots pp and qq Bpq+Bqp=∑d∈T(p)Cqd+∑d∈T(q)Cpd.B_{pq} + B_{qp} = \sum_{d \in T(p)} C_{qd} + \sum_{d \in T(q)} C_{pd} .(8) Then there are a list WW of distinct wires and a list Γ\Gamma of pairs of distinct wires, with no middle wire in WW or in any pair of Γ\Gamma, such that for every pivot pp r(UW,ΓZpUW,Γ†)=(ep+𝟏T(p)|Bp|𝒫+Cp|𝒟).r\bigl(U_{W,\Gamma} Z_p U_{W,\Gamma}^\dagger\bigr) = \bigl(e_p + \mathbf 1_{T(p)} \,\big|\, B_p|_{\mathcal P} + C_p|_{\mathcal D}\bigr).(9)✦

What Is Checked

The claim is stated over the encoding circuit (5) of standard form data, and over the check rows of the images of the generators ZiZ_i under its action by conjugation. For every list WW of distinct wires and every list Γ\Gamma of pairs of distinct wires, the check rows of UW,ΓZdUW,Γ†U_{W,\Gamma} Z_d U_{W,\Gamma}^\dagger on the data wires✦ and of UW,ΓZmUW,Γ†U_{W,\Gamma} Z_m U_{W,\Gamma}^\dagger on the middle wires equal those of the core VV alone.✦ For BB and CC satisfying (8), phase and controlled ZZ gates away from the middle wires can be chosen so that the pivot rows take the form (9).✦