Jessie Chen (Yale University)
The XZZX surface code is a non-CSS variant of the surface code, with stabilizer checkers given by the Pauli string XZZX [1]. The code achieves significant improvement in performance against biased
A popular choice of decoders for surface codes is the minimum-weight perfect matching (MWPM) decoder [4-6]. There have also been attempts to incorporate machine learning to improve the performance of the MWPM decoder. In this project, we consider combining belief propagation (BP) with MWPM as a new decoder for the XZZX surface code.
The first step in BP+MWPM employs BP, a standard algorithm for decoding classical low density parity check (LDPC) codes [7-9], which takes the corrupted surface code as a Tanner graph and compute the error probability of each qubit given a measured syndrome. BP’s result is exact if the topology of the graph is a tree [7]. Since the XZZX surface code decouples into stacks of repetition codes under pure biased noise, it is reasonable to assume that BP can further facilitate MWPM’s performance under high biases. Moreover, BP’s time complexity scales linearly with the block length. Therefore, adding BP to MWPM does not resulting in a drastic computation overhead.
While BP shows great performance on classical LDPC codes, quantum LDPC codes possess quantum degeneracy, which often leads to loopy structures in the corresponding Tanner graph. BP fails in face of high-density loopy structures. Thus, MWPM is added as a post-processing routine to remedy the issue.
In the rest of the document, we explain how to set up the code base and its code structure. Then, we present some simulation results for the BP+MWPM decoder across different noise biases and discuss some potential issues for the decoder. It is found that the BP+MWPM decoder exhibits improvements from the MWPM decoder at small biases. However, for high biases, contrary to the theoretical prediction, BP+MWPM exhibits poorer performance. We investigate the cause of this discrepancy and attribute it to the increasing proportion of negative weights on the syndrome graph for MWPM. The use of activation functions to remap the negative weights is proposed to mitigate the problem.
The project is developed under x86-64
Linux. The system dependencies are as follows:
conda
: Anaconda or Miniconda, for managing the appropriate Python virtual environment
To install the Python dependencies, run
conda env create -f environment.yml
at the root directory of the folder, followed by
conda activate bp-mwpm-xzzx
to activate the virtual environment.
The code base makes use of Blossom V, which cannot be distributed publicly per its license requirements [5]. To run the code base on a private basis,
- Download Blossom V
blossom5-v2.05.src.tar.gz
from here. - Download the Python wrapper from here.
- Build the C++ library
libpypm.so
with Blossom V and the Python wrapper. - Copy
libpypm.so
to the locationbin\libpypm.so
from the root directory.
bin/
: C++ library for MWPMdata/
: Results and data fileshpc/
: Skeleton code for running simulation on HPCsres/
: Tests and profiling for improving code performancesrc/
: Source code for BP+MWPM decoder for the XZZX surface codebp.py
: Implementation of belief propagationglobals.py
: Global variable declarationsmwpm.py
: Implementation of MWPM decoder with Blossom Vnoise.py
: Implementation of noise model on the XZZX surface codetests.py
: Various checks for code correctnessprogress.py
: Progress bar for Slack chatutils.py
: Various utility and plotting codexzzx.py
: Implementation of the XZZX surface code and driver code
demo.ipynb
: Tutorials for running the code baseREADME.md
: this Markdown fileenvironment.yml
:conda
virtual environment specifications
In this work, we consider the XZZX surface code on a rectangular lattice with open boundary conditions.
As shown above, data qubits rest upon the vertices of the
The error model under consideration is the site-independent biased Pauli noise on each data qubits. Let
By default, MWPM decoders rely solely on error probabilities to deduce the error chains given a set of error syndromes. Again,
BP takes the Tanner graph of the XZZX surface code as input and outputs tailored error probability distributions for each qubit on the surface code. In the Tanner graph, each qubit corresponds to a qubit vertex demo.ipynb
in the root directory.
Some simulation across different noise biases are provided below.
According to the logical error rate and error correction threshold, up to biases of
A reason for such discrepancy might be the large proportion of negative edge weights from BP at higher biases. MWPM by design can only handle edge weights of one sign. This is not a problem if we use the default formula Eqn (2) for
However, this naive countermeasure also erases all the information obtained from BP for negative edge weights. This information loss grows with biases.
As shown above, the proportion of negative edge weights grows with biases. One the one hand, the physical error rate of interest increases with biases; on the other hand, as the XZZX surface code further decouples into stacks of repetition codes, BP’s beliefs about the possible errors on qubits become sharper, resulting in a bimodal distribution at
Some attempts at recovering the lost information have been made. In particular, we find that by using an activation function [13] of the form
As a side note, we also comment that some naive solutions to the negative edge weight problem do not work. Some people believe that adding an overall shift
In this work, we create a BP+MWPM decoder for the XZZX surface code. Through simulations, we show that it outperforms the usual MWPM decoder up to noise biases of
Due to various reasons, I stopped pursuing this project actively at some point. At the time of writing, I am no longer obsessed with a particular BP+MWPM decoder. If you are interested in codes and decoders, I suggest looking at these sources [14-16], which gives a better overview of quantum error correcting codes and decoders.
However, I find the negative edge weight problem to be very fascinating, and it has been at the back of my mind. I present two potential formulations of the problem, whose solutions will resolve the negative weight edge issue (for good or bad). If you are interested in/could teach me something about the problem or want to learn more details about the project, please do not hesitate to contact me at [email protected].
From a graph theory point of view, the difficulty for MWPM to deal with negative edge weights boils down to the negative-weight cycle problem in path-finding algorithms [17]. In the surface code setting, it can be framed as the following: does there exist a polynomial-time (approximate) algorithm for finding shortest simple-paths in a regular (rectangular) graph with negative-weight cycles?
It is known that finding the shortest simple-paths in an arbitrary graph with negative-weight cycles is a NP-hard problem. This is because it can be reduced from the longest-path problem [17]. Suppose that there exists some algorithm
However, I am not sure whether restraining graph topology would yield a possible polynomial-time algorithm to the problem. Therefore, I have framed the question in the context of regular graphs.
Returning back to the issue of remapping the weight distribution function, the problem can be reformulated as: given a (bimodal) distribution
The author would like to thank Shraddha Singh (Yale Applied Physics) for answering her many questions regarding the details of surface code error correction. She also thanks Allen Mi (Yale Physics) for helping her improve the efficiency of the codes drastically.
[1]: Bonilla Ataides, J.P., Tuckett, D.K., Bartlett, S.D. et al. The XZZX surface code. Nat Commun 12, 2172 (2021). https://doi.org/10.1038/s41467-021-22274-1
[2]: A. Y. Kitaev, Fault-tolerant quantum computation by anyons. Annals Phys. 303, 2 (2003). https://arxiv.org/abs/quant-ph/9707021
[3]: E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, J. Math.Phys. 43, 4452 (2002), https://arxiv.org/abs/quant-ph/0110143
[4]: Edmonds, J. (1965). Paths, Trees, and Flowers. Canadian Journal of Mathematics, 17, 449-467. doi:10.4153/CJM-1965-045-4
[5]: Kolmogorov, V. Blossom V: a new implementation of a minimum cost perfect matching algorithm. Math. Prog. Comp. 1, 43–67 (2009). https://doi.org/10.1007/s12532-009-0002-8
[6]: A. G. Fowler, Minimum weight perfect matching of fault-tolerant topological quantum error correction in average o(1) parallel time (2014), https://arxiv.org/abs/1307.1740
[7]: D. J. C. MacKay, Information Theory, Inference and Learning Algorithms, Cambridge University Press, Cambridge, UK, October 2003.
[8]: Y.-H. Liu and D. Poulin, Neural Belief-Propagation Decoders for Quantum Error-Correcting Codes, Physical Review Letters 122, (2019). https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.122.200501
[9]: P. Panteleev and G. Kalachev, Degenerate Quantum LDPC Codes With Good Finite Length Performance, Quantum 5, 585 (2021). https://quantum-journal.org/papers/q-2021-11-22-585
[10]: B. Criger and I. Ashraf, Multi-path Summation for Decoding 2D Topological Codes, Quantum 2, 102 (2018). https://arxiv.org/abs/1709.02154
[11]: D. Poulin and Y. Chung, On the iterative decoding of sparse quantum codes (2008). https://arxiv.org/abs/0801.1241
[12]: Private communication with Shraddha Singh.
[13]: I. J. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, Cambridge, MA, USA, 2016. http://www.deeplearningbook.org
[14]: N. P. Breuckmann and J. N. Eberhardt, Quantum Low-Density Parity-Check Codes, PRX Quantum 2 (2021). https://journals.aps.org/prxquantum/abstract/10.1103/PRXQuantum.2.040101
[15]: Google Quantum AI. Suppressing quantum errors by scaling a surface code logical qubit. Nature 614, 676–681 (2023). https://doi.org/10.1038/s41586-022-05434-1
[16]: Error Correction Zoo. https://errorcorrectionzoo.org/
[17]: J. Kleinberg and E. Tardos, Algorithm Design, Addison-Wesley Longman Publishing Co., Inc., USA, 2005.