qLDPC documentation
qLDPC is a library of tools for constructing and analyzing finite-size
quantum low density parity check (qLDPC) codes.
Its primary purpose is to make developments in the quantum error correction literature accessible
to a broad audience of physicists, computer scientists, and tinkerers. The hope is that these
tools facilitate the discovery and design of practical, finite-size codes for near-term (or at
least medium-term) quantum computers.
In practice the tools here work just as well for stabilizer and subsystem codes more broadly.
Use the library map to understand qLDPC’s data model and package structure, the examples for complete workflows, and the API reference for exact signatures and construction-specific literature.
Installation
qLDPC requires Python 3.10 or later and can be installed from the Python Package Index (PyPI):
pip install qldpc
Some features additionally require the GAP computer algebra system; see the README for details.
Quickstart
from sympy.abc import x, y
from qldpc import codes
# build the bivariate bicycle "gross code" with parameters [[144, 12, 12]]
code = codes.BBCode({x: 12, y: 6}, x**3 + y + y**2, y**3 + x + x**2)
print(code) # a human-readable summary of the code
print("physical qubits:", len(code)) # number of physical qubits, n
print("logical qubits:", code.dimension) # number of logical qubits, k
Where to go next
Library map explains how qLDPC represents codes, what each package does, common tasks, and current limitations.
Examples walk from code construction through code-capacity and circuit-level simulations.
API reference documents every public class and function.
The agent and contributor guide explains how to change and test qLDPC safely.