Linear-Time Maximum Likelihood Decoding of Surface Codes over the Quantum Erasure Channel
LLinear-Time Maximum Likelihood Decoding of Surface Codes over the QuantumErasure Channel
Nicolas Delfosse , and Gilles Zémor IQIM, California Institute of Technology, Pasadena, CA, USA Department of Physics and Astronomy, University of California, Riverside, CA, USA Mathematical Institute, IMB, UMR 5251, Bordeaux University, France
Surface codes are among the best candidates to ensure the fault-tolerance of a quantum computer.In order to avoid the accumulation of errors during a computation, it is crucial to have at our disposala fast decoding algorithm to quickly identify and correct errors as soon as they occur. We propose alinear-time maximum likelihood decoder for surface codes over the quantum erasure channel. Thisdecoding algorithm for dealing with qubit loss is optimal both in terms of performance and speed.
PACS numbers:
Introduction—
Surface codes [1, 2] are one of the lead-ing candidates to ensure the fault-tolerance of a quantumcomputer. Error correction is based on the measurementof local operators on a lattice of qubits. The measure-ment outcome, called the syndrome, is then processedby the decoding algorithm which uses this informationto infer the error which occurred. In order to avoid theaccumulation of errors during computation, it is essentialfor the decoder to be fast. Any speed-up of the decoderleads indirectly to a reduction of the noise strength, sincea shorter time between two rounds of correction inducesthe appearance of fewer errors.The quantum erasure channel [3, 4] is the noise modelthat represents photon loss or leakage outside the com-putational space in multi-level systems. The loss of aqubit is equivalent to applying a random Pauli error tothis qubit, while giving, as additional data, the positionof the error. For stabilizer codes, this extra informationreduces the decoding problem to solving a linear system,which can be done with cubic complexity. In the par-ticular case of surface codes, the syndrome of an erroris a set of vertices of a lattice and decoding amounts tofinding a set of paths connecting these vertices by pairs.One could pick two vertices and connect them by a pathand repeat until all the syndrome vertices are matched.This would lead to a quadratic complexity. This strategywas adopted by Dennis et al. to decode Pauli errors [2]or by Barrett and Stace in the case of a combination ofPauli errors and erasures [5].In the present work, we propose a linear-time maxi-mum likelihood decoder for erasures over surface codes.This is optimal both in terms of performance and in termsof complexity. Our algorithm can be used with any sur-face code, with arbitrary genus, and any type of bound-ary [6–8], including hyperbolic codes [9–11]. In compar-ison, in the case of Pauli errors the efficient algorithmfor maximum likelihood decoding over surface codes ob-tained by Bravyi, Suchara and Vargo [12], only appliesto a restricted set of surfaces.In the rest of the paper, we describe our decoding al-gorithm and we prove that it is a maximum likelihood decoder. To illustrate the decoding strategy, we firstconsider Kitaev’s surface codes, then we generalize theapproach to surfaces with boundaries, which are morerelevant for practical purposes [6–8].
Kitaev’s surface codes –
Kitaev’s surface codes [1] areobtained by imposing local constraints on qubits placedon a closed surface. Since only the combinatorial struc-ture of the surface matters, we denote by ( V, E, F ) sucha surface with vertex set V , edge set E and face set F .These three sets are assumed to be finite. An edge e ∈ E is a pair of distinct vertices e = { u, v } . A face is a regionof the surface homeomorphic to a disc and delimited by aset of edges. We represent a face by the set of edges lyingon its boundary. We assume that the graph ( V, E ) hasneither loops nor multiple edges. We also suppose thatits dual is well defined and satisfies the same properties.Consider the Hilbert space H = ( C ) E . Each qubit isindexed by an egde e and the Pauli operator acting onthis qubit as the matrix X, Y or Z and acting triviallyelsewhere is denoted respectively by X e , Y e or Z e . Ki-taev’s surface code is defined to be the ground space ofthe Hamiltonian − (cid:88) v ∈ V X v − (cid:88) f ∈ F Z f , where X v = (cid:81) v ∈ e X e and Z f = (cid:81) e ∈ f Z e . The operators X v and Z f generate a group S , the stabilizer group , whichfixes the code space. Elements of S are called stabilizers .The Z -stabilizers, that are products of face operators Z f ,are the operators of { I, Z } ⊗ E whose support is a trivialcycle of G . By cycle , we mean here a subset of edges of G which meets every vertex an even number of times. Acycle is said to be trivial if it lies on the boundary of aset of faces. In the same way, X -stabilizers correspond totrivial cycles of the dual graph. The correction of Paulierrors is based on the measurement of the generators X v and Z f which tells us whether or not the error commuteswith these operators. The outcome of this measurementis called the syndrome of the error. Errors with a trivialsyndrome, meaning that commute with all the stabiliz-ers, can be seen as operators acting on the code space a r X i v : . [ qu a n t - ph ] M a r and are called logical operators . For instance, stabilizersare trivial logical operators. Non-trivial logical opera-tors correspond to non-trivial cycles in the graph G orits dual. Maximum likelihood decoding for qubit loss –
The quan-tum erasure channel is one of the most simple noise mod-els. Each qubit is lost, or erased, independently withprobability p . Such a loss can be detected and the miss-ing qubit is then replaced by a totally mixed state I / .Writing I / ( ρ + XρX + Y ρY + ZρZ ) , we see thatthis new qubit can be interpreted as the original statewhich suffers from a Pauli error I, X, Y or Z chosen uni-formly at random. The set of lost qubits is denoted by E . The encoded state is subjected to a random uniformPauli error P whose support is included in E . Denotethis condition by P ⊂ E .Just like when dealing with Pauli noise, one can thenmeasure the stabilizer generators X v and Z f and try torecover the error P from its syndrome. The main differ-ence with Pauli channels is the additional knowledge ofthe erasure pattern E . Since operators of S act triviallyon the code space, the goal of the decoder is to identifythe coset P · S of the error, knowing the set E and thesyndrome σ of P . The optimal strategy, called maxi-mum likelihood decoding , is to maximize the conditionalprobability P ( P · S | E , σ ) .To illustrate how the knowledge of the erasure E sim-plifies the decoding problem, assume that we found anerror ˜ P ⊂ E whose syndrome matches σ . Both errors P and ˜ P have the same syndrome, hence ˜ P and P differ ina logical operator L ⊂ E , trivial or not. Due to the factthat errors Q ⊂ E are uniformly distributed, P ( Q · S | E , σ ) is proportional to the number | Q · S ∩ E | of Pauli errors ofthat coset that are included in E . This number dependsonly on the number | S ∩ E | of stabilizers having supportinside E , which shows that all the cosets are equiprob-able. Therefore, maximum likelihood decoding consistssimply of returning an error coset ˜ P · S such that P ⊂ E and the syndrome of P is equal to a given σ . This provesthat Lemma 1.
Given an erasure E ⊂ E for a surface codeand a measured syndrome σ , any coset ˜ P · S of a Paulierror ˜ P ⊂ E of syndrome σ is a most likely coset. The same argument can be applied to any stabilizercode.
A linear-time maximum likelihood decoder –
We nowpropose a fast algorithm that returns such a most likelycoset for Kitaev’s surface codes. We detail the construc-tion of the Z -part of the error. The same algorithm willbe applied to the dual graph to recover the X -part of theerror.Only measurements of operators X v can detect a Z -error. The syndrome of a Z -error P is thus the sub-set σ ( P ) ⊂ V of vertices v such that X v anti-commutes with this error. Equivalently, it is the set of vertices sur-rounded by an odd number of qubits supporting an error Z . In order to translate our decoding problem into agraphical language, denote by ∂ ( A ) the set of verticesthat a subset A ⊂ E encounters an odd number of timesand call it the boundary of A . The syndrome of the Z -error pattern supported on A is exactly ∂ ( A ) . Given E ⊂ E and σ ⊂ V , we are looking for a subset of edges A ⊂ E such that ∂ ( A ) = σ . ( a ) Z Z Z Z Z Z ( b ) ZZ Z Z ZZ Z Z
Figure 1: (a) A square lattice of the torus. Opposite sides areidentified. Red thick edges mark the set E of erased qubitswhich support some Z -error. Its syndrome is indicated bylarge red nodes. (b) A spanning forest F E (thick red linesin (b)) is constructed. Then, starting from the leaves, anerror included in the F E is constructed using the syndrome.Here, this provides a correct estimation of the error up to astabilizer. We now describe Algorithm 1 which is illustrated onFig. 1.Paradoxically, an obstacle to a linear-time complexityis the presence of cycles in E . Although cycles increasethe number of paths from a vertex to another and poten-tially make it easier to find one, they also make it easierto make suboptimal choices. Our basic idea is not to tryto sequentially find paths that pair the syndrome verticestogether but instead to shrink recursively the set of edgeson which we have yet to make a decision. To this end weselect a spanning forest F E inside E , that is a maximalsubset of edges of E that contains no cycle and spans allthe vertices of E . If E is a connected graph, then F E is also connected and is called a spanning tree . Such aforest can be found in linear time.Equipped with the forest F E that contains all the syn-drome vertices, we can now find the required subset A very efficiently. Starting with the empty set, we con-struct A , by applying recursively the following rules.(R1) Pick a leaf , that is an edge e = { u, v } connectedto the forest through only one of its 2 endpoints, say v .The vertex u is called a pendant vertex . Assume first that u ∈ σ , then we add the edge e to the set A and we flip the vertex v . By flipping, we mean that v is added to theset σ if v / ∈ σ and it is removed from σ in the case v ∈ σ .Then, e is removed from the forest F E .(R2) In the case when u / ∈ σ , this edge is simply re-moved from F E and A is kept unchanged.Through these 2 steps, we peel the forest F E until onlyan empty set remains. The construction of the set A isthen complete. This procedure relies on the followingobvious remark, stated as a lemma to emphasize the roleof the two rules applied in Algorithm 1. Lemma 2 ( leaf alternative). Let A be a subset of edgesof a tree T . If e = { u, v } is a leaf with pendant vertex u ,then (R1) either u ∈ ∂ ( A ) and e ∈ A , (R2) or u / ∈ ∂ ( A ) and e / ∈ A . This strategy is guaranteed to end after a finite numberof steps. It remains to show that it returns the expectedset A . We must verify that such a set A exists and thatthe peeling process does not depend on the order in whichleaves of the forest are removed. This is done in the proofof Theorem 1. Algorithm 1
Maximum Likelihood decoding
Require:
A surface G = ( V, E, F ) , an erasure E ⊂ E andthe syndrome σ ⊂ V of a Z -error. Ensure: A Z -error P such that P ⊂ E and σ ( P ) = σ . Construct a spanning forest F E of E . Initialize A by A = ∅ . While F E (cid:54) = ∅ , pick a leaf edge e = { u, v } with pendantvertex u , remove e from F E and apply the 2 rules: (R1) If u ∈ σ , add e to A , remove u from σ and flip v in σ . (R2) If u / ∈ σ do nothing. Return P = (cid:81) e ∈ A Z e . Theorem 1.
For surface codes with bounded degree andfaces of bounded size, applying Algorithm 1 to the graphand to its dual produces a linear-time maximum likelihooddecoder.
During step 3 of the algorithm, a naive approach wouldbe to look for a leaf by running over the forest at eachround but this strategy would lead to a super-linear com-plexity. However, we can ensure linear complexity byrunning over the whole forest and precomputing a list ofleaves. For a bounded degree graph, this list can then beupdated in constant time at each round when an edge isremoved from the forest.
Proof.
Finding a spanning forest has a linear cost, thenour algorithm runs over each edge of the forest only once,leading to a linear-time complexity overall. We have toprove that the set A , constructed by this algorithm, sat-isfies the claimed properties. The fact that A ⊂ E isimmediate. Only the condition ∂ ( A ) = σ deserves someattention. First, we will show that, for any choice of F E ,there exists a set A ⊂ F E such that ∂ ( A ) = σ and thatthis set is unique. Then we will see that applying (R1)and (R2), starting from the leaves, indeed constructs thisset A .There exists a subset B such that B ⊂ E and ∂ ( B ) = σ since σ is the syndrome of an error. We will reroute the paths contained in B to squeeze this subset inside F E without changing its boundary. Let x , . . . , x m be theedges of B \ F E . By maximality of the forest F E , addingany extra edge x i to F E creates a cycle γ i ⊂ F E ∪ { x i } .In order to remove x from the set B , replace B by B = B ∆ γ where ∆ denotes the symmetric differenceof these two sets of edges. Then, x / ∈ B , only edgesof F E are added to B and x , . . . , x m are untouched.By repeating this transformation, one creates a sequence B i +1 = B i ∆ γ i such that B i +1 ⊂ T E ∪ { x i , . . . , x m } for i = 1 , . . . , m . The last set, B m , is included in F E . Tak-ing the symmetric difference with a cycle γ i preservesthe boundary, i.e. ∂ ( B i ) = ∂ ( B ) for all i . This provesthat the set B m satisfies both conditions B m ⊂ F E and ∂ ( B m ) = σ . This is our set A .This set A is unique. Indeed if there exists two suchsubsets A and A (cid:48) , their symmetric difference A ∆ A (cid:48) isa subset of the forest which has a trivial boundary ∂ ( A ∆ A (cid:48) ) = ∅ meaning that A ∆ A (cid:48) is a cycle. Since thiscycle is in a forest, it can only be the empty set, provingthat A = A (cid:48) .Now that existence and unicity of A are established,we see that the alternative offered by Lemma 2 can onlyend with the set A . The result of our algorithm is inde-pendent of the order in which we pick the leaves in step3 by unicity of A . The existence of A garanties that ouralgorithm finds this set after peeling the whole forest. Surfaces with boundaries –
Kitaev’s construction ofsurface codes can be generalized to surfaces with bound-aries, that is closed surfaces punctured with holes. Intro-ducing boundaries leads to a key simplification for theexperimental realization of topological codes. One canobtain non-trivial surface codes based on planar lattices.This motivates the generalization of our decoding algo-rithm to such surface codes. Two kinds of codes basedon surfaces with boundaries have been suggested. First,Freedman and Meyer noticed that one can consider a sur-face with boundaries [6]. Algorithm 1 can be immediatelyadapted to these codes. Secondly, Bravyi and Kitaev in-troduced two different types of stabilizers supported ontwo types of boundaries [7]. Adapting our decoding al-gorithm to these codes presents two difficulties. First,the syndrome depends on the type of boundary and sec-ond, the spanning forest has to be grown in a way thatdepends on the boundary type.We use the formalism of [8] that encompasses bothgeneralizations of Kitaev’s codes. We consider a surface G = ( V, E, F ) with boundary , which means that someedges belong to a unique face. On the boundary, someedges and their endpoints are declared to be open . Wedenoted by ∂ O E (resp. ∂ O V ) these open sets and by ˚ V = V \ ∂ O V and ˚ E = E \ ∂ O E the non-open sets. Qubitsare placed on non-open edges and the generalized surface code is defined as the ground space of the Hamiltonian − (cid:88) v ∈ ˚ V X v − (cid:88) f ∈ F Z f where X v = (cid:81) v ∈ e,e ∈ ˚ E X e and Z f = (cid:81) e ∈ f,e ∈ ˚ E Z e . Noqubit is placed on an open edge and open vertices do notsupport any operator X v . Algorithm 2
Maximum Likelihood decoding forsurfaces with boundaries
Require:
A surface G = ( V, E, F ) with open and closedboundaries, an erasure E ⊂ ˚ E and the syndrome σ ⊂ ˚ V of a Z -error. Ensure: A Z -error P such that P ⊂ E and σ ( P ) = σ . Construct a spanning forest F E of E with seed ∂ O V ∩ V ( E ) . Initialize A by A = ∅ . While F E (cid:54) = ∅ , pick a leaf edge e = { u, v } with pendantvertex u ∈ ˚ V , remove e from F E and apply the 2 rules: (R1) If u ∈ σ , add e to A , remove u from σ and flip v in σ . (R2) If u / ∈ σ do nothing. Return P = (cid:81) e ∈ A Z e . Consider an erasure E ⊂ ˚ E which comes with a Paulierror affecting erased qubits. Again, it suffices to focuson the correction of the Z -part of the error. Open ver-tices do not support any measurement X v . Hence, thesyndrome of a Z -error of support A ⊂ ˚ E is given bythe restriction of ∂ ( A ) to non-open vertices. Denote by ˚ ∂ ( A ) ⊂ ˚ V this restricted boundary. The missing informa-tion on open vertices makes it impossible to reconstructthe error starting from those vertices. We must find away to peel the whole forest using only non-open ver-tices. In order to be sure that the peeling algorithm isnot stuck before removing all the edges of the forest, wewill grow the forest starting from open vertices and peelit the other way round as depicted in Figure 2.Let us explain Algorithm 2. An example is depictedin Fig. 2. We must adapt the way the spanning forest isobtained. First, let us explain a simple strategy to finda spanning tree of a connected graph H = ( V, E ) . For ageneral graph, applying this method to all the connectedcomponents produces a spanning forest. Our startingpoint is a tree T that contains only a single arbitraryvertex v of H and no edge. We grow T by adding edgesincident to the tree that connect T with a vertex of H that does not already belong to T . After adding | V | − edges, one gets our spanning tree.In algorithm 2, we will grow a spanning forest of agraph H = ( V, E ) equipped with a marked subset ofvertices O ⊂ V that we call the seed . The spanning treeof a connected component containing a vertex v O ∈ O isconstructed starting with this vertex v O . Then, just asbefore we add edges that reach new vertices but we alsorequire that these newly reached vertices do not belong to O . If the connected component does not contain anyseed vertex, the previous method applies. Theorem 2.
For generalized surface codes with boundeddegree and faces of bounded size, applying Algorithm 2 tothe graph and to its dual produces a linear-time maximumlikelihood decoder. ( a ) ( b ) Z ZZ ZZ Z ZZ Z ( c ) ( d ) Z ZZ ZZ Z ZZ Z
Figure 2: (a) Bravyi and Kitaev’s code with open and closedboundaries. White nodes and dashed lines represent open ver-tices and open edges . (b) Red thick lines indicate an erasure E with a Z -error and its syndrome which is given by the largered vertices. (c) A spanning forest F E , with open vertices as aseed. Arrows show the way the forest is grown. (d) The erroris estimated by reversing the arrows. Our algorithm succeedsin identifying the error up to a stabilizer but the choice ofanother forest may have produced a wrong estimation of theerror. Proof.
Existence and uniqueness of the set A follow fromthe same argument as in the proof of Theorem 1 afterreplacing cycles by relative cycles. Recall that a relativecycle is a subset of edges that meets each non-open vertexan even number of time. The space of relative cycles ofgraph is studied for instance in Section 4.1 of [8].Then, Lemma 2, which provides the recursive construc-tion of the error, is used in an identical way. We onlyneed to make sure that the pendant vertices u picked instep 3 are not open. Our algorithm picks these verticesby reversing the construction of the forest with open ver-tices as a seed. This guarantees that one can peel thewhole forest and we end up with the correct set A whichprovides the support of this error. Concluding remarks –
In this work, we considered thedecoding problem of surface codes over the quantum era-sure channel. Despite the presence of inconvenient shortcycles, we managed to design an optimal decoding al-gorithm that runs in linear time. Our basic idea is toremove these short cycles by decoding within a spanningforest. In the case of classical error correction, study-ing linear-time decoding from erasures paved the way forbetter and better linear (or quasi-linear) decoders in thecase of more complicated channels. We may hope thatin the quantum setting, solving the decoding problemfor the erasure channel may similarly lead towards im-proved decoders for more complicated noise models andother families of codes. In particular, a serious obsta-cle to decoding quantum LDPC codes is also the pres-ence of short cycles in their Tanner graph. How to dealwith them in general remains widely open [13–16]. It iscrucial to consider such generalizations that may allowfor fault-tolerant universal quantum computation with aconsiderably reduced overhead [17]. One could also con-sider the correction of losses assuming imperfect gatesand measurements [18, 19] or in the context of linearoptical quantum computing where photon losses are amajor obstacle [20–23].
Acknowledgement –
ND thanks Jonas Anderson for hiscomments on a preliminary version of this work. ND ac-knowledges funding provided by the Institute for Quan-tum Information and Matter, an NSF Physics FrontiersCenter (NSF Grant PHY-1125565) with support of theGordon and Betty Moore Foundation (GBMF-2644). [1] A. Y. Kitaev, Annals of Physics , 27 (2003).[2] E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, Jour-nal of Mathematical Physics , 4452 (2002).[3] M. Grassl, T. Beth, and T. Pellizzari, Physical Review A , 33 (1997).[4] C. Bennett, D. DiVincenzo, and J. Smolin, Physical Re-view Letters , 3217 (1997).[5] S. D. Barrett and T. M. Stace, Physical review letters , 200502 (2010).[6] M. H. Freedman and D. A. Meyer, Foundations of Com-putational Mathematics , 325 (2001).[7] S. B. Bravyi and A. Y. Kitaev (1998), arXiv:9811052.[8] N. Delfosse, P. Iyer, and D. Poulin, arXiv preprintarXiv:1606.07116 (2016).[9] M. H. Freedman, D. A. Meyer, and F. Luo, Mathematicsof Quantum Computation, Chapman & Hall/CRC pp.287–320 (2002).[10] G. Zémor, in Proc. of the 2nd International Workshopon Coding and Cryptology, IWCC 2009 (Springer-Verlag,2009), pp. 259–273.[11] N. P. Breuckmann and B. M. Terhal, IEEE Transactionson Information Theory , 3731 (2016).[12] S. Bravyi, M. Suchara, and A. Vargo, Physical Review A , 032326 (2014).[13] D. J. C. MacKay, G. Mitchison, and P. L. McFad-den, IEEE Transaction on Information Theory , 2315(2004). [14] D. Poulin and Y. Chung, Quantum Information & Com-putation , 987 (2008).[15] N. Delfosse and G. Zémor, Quantum Information & Com-putation , 793 (2013).[16] N. Delfosse and J.-P. Tillich, in (IEEE, 2014), pp.1071–1075.[17] D. Gottesman, Quantum Information & Computation , 1338 (2014).[18] A. C. Whiteside and A. G. Fowler, Phys. Rev. A ,052316 (2014).[19] M. Suchara, A. W. Cross, and J. M. Gambetta, in Infor-mation Theory (ISIT), 2015 IEEE International Sympo-sium on (IEEE, 2015), pp. 1119–1123.[20] E. Knill, R. Laflamme, and G. J. Milburn, nature ,46 (2001).[21] M. A. Nielsen, Physical review letters , 040503 (2004).[22] D. E. Browne and T. Rudolph, Physical Review Letters , 010501 (2005).[23] K. Kieling, T. Rudolph, and J. Eisert, Physical ReviewLetters99