This package contains tools for constructing and analyzing quantum low density parity check (qLDPC) codes. At least, that was the original motivation for this package. In practice, the tools here can work just as well for more general error-correcting stabilizer and subsystem codes.
This package requires Python>=3.10, and can be installed from the Python Package Index (PyPI) with
pip install qldpc
To install a local version of qLDPC from source:
git clone https://github.com/Infleqtion/qLDPC.git
pip install -e qLDPC
You can also pip install -e 'qLDPC[dev]'
to additionally install some development tools.
If you use Windows you will need to have a C compiler installed, as discussed here, before to installing qLDPC
. One option is to install Visual Studio (2022 or later).
If you use macOS you may need to install cvxpy
manually by following the instructions here before installing qLDPC
. If you use conda
to manage your python environment, you can obtain cvxpy
simply by running conda install -c conda-forge cvxpy
.
Notable features include:
ClassicalCode
: class for representing classical linear error-correcting codes over finite fields.- Various pre-defined classical code families.
- Communication with the GAP/GUAVA package for even more codes.
QuditCode
: class for constructing Galois-qudit codes, including both stabilizer and subsystem codes.QuditCode.get_logical_ops
: method to construct a complete basis of nontrivial logical Pauli operators for aQuditCode
.QuditCode.concatenate
: method to concatenateQuditCode
s in various ways.QuditCode.get_distance
: method to compute the code distance (i.e., the minimum weight of a nontrivial logical operator) of aQuditCode
.
CSSCode
: subclass ofQuditCode
for the special case of constructing a quantum CSS code out of two mutually compatibleClassicalCode
s.CSSCode.get_distance_bound
: method to estimate an upper bound on code distance using the method of arXiv:2308.07915.
- Classes for special quantum code constructions and code families, such as:
TBCode
: two-block quantum codes.BBCode
: bivariate bicycle codes, as in arXiv:2308.07915 and arXiv:2311.16980. Seeexamples/bivariate_bicycle_codes.ipynb
for methods to identify...- toric layouts of a
BBCode
, in which the code looks like a toric code augmented by some long-distance checks, as in discussed in arXiv:2308.07915, and - qubit layouts that minimize the communication distance for neutral atoms, as discussed in arXiv:2404.18809.
- toric layouts of a
HGPCode
: hypergraph product codes.SHPCode
: subsystem hypergraph product codes, as in arXiv:2002.06257.SHYPSCode
: subsystem hypergraph product codes simplex, as in arXiv:2502.07150.LPCode
: lifted product codes, as in arXiv:2012.04068 and arXiv:2202.01702.QTCode
: quantum Tanner codes, as in arXiv:2202.13641 and arXiv:2206.07571.
decoders.py
: module for decoding errors with various methods, including BP-OSD, BP-LSD, and belief-field (vialdpc
), minimum-weight perfect matching (viapymatching
), and others. Includes an interface for using custom decoders.abstract.py
: module for basic abstract algebra (groups, algebras, and representations thereof).- Various pre-defined groups (mostly borrowed from SymPy).
- Communication with the GAP computer algebra system and GroupNames.org for constructing even more groups.
objects.py
: module for constructing helper objects such as Cayley complexes and chain complexes, which are instrumental for the construction of various quantum codes.qldpc.circuits.get_transversal_ops
: construction of all SWAP-transversal logical Clifford gates in one code block of a qubit code (see arXiv:2409.18175; requires GAP and GUAVA). Warning: this method relies on a subroutine (namely, finding classical code automorphisms) that has exponential complexity, and is therefore only practical for codes with small-to-moderate size.
This project aspires to have a documentation page, but at the moment the documentation is out of date and auto-generated from source code that was written to be human-readable in a plain text editor. For now, I recommend looking at the source code (and comments therein) directly, as well as the examples
directory. Test files (such as qldpc/codes/quantum_test.py
) also contain some examples of using the classes and methods in this library.
If you have any questions, feedback, or requests, please open an issue on GitHub or email me at mika.perlin@gmail.com!
If you use this software in your work, please cite with:
@misc{perlin2023qldpc,
author = {Perlin, Michael A.},
title = {{qLDPC}},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/Infleqtion/qLDPC}},
}
This may require adding \usepackage{url}
to your LaTeX file header. Alternatively, you can cite
Michael A. Perlin. qLDPC. https://github.com/Infleqtion/qLDPC, 2023.