lcd-qec: rigorous logical-error bounds for matching decoders
lcd-qec computes rigorous upper bounds on the per-shot logical failure probability of minimum-weight matching
(pymatching) on stim detector error models, and therefore also of the maximum-likelihood decoder. A sampled logical
error rate is an estimate with error bars; these bounds are guarantees, valid for every shot of every sample.
pip install "lcd-qec[sinter]"
lcd-peierls --generated surface_code:rotated_memory_z -d 5 -p 1e-3
# surface_code:rotated_memory_z d=5 r=5 p=0.001: p_L(MWPM) <= 2.000e-03 (Theorem 4.34, lam = 0.500, rho <= 0.4370)
lcd-peierls my_circuit.stim other_model.dem --json
Next to a sinter run:
import sinter
from lcd.integrations.sinter_peierls import compare
stats = sinter.collect(num_workers=4, tasks=tasks, decoders=["pymatching"], max_shots=10**6)
for row in compare(tasks, stats): # sampled rate and interval, rigorous bound, bound / rate, consistency flag
print(row["json_metadata"], row["rate"], row["bound"], row["ratio"], row["consistent"])
On Google's published hardware models (fetched on demand, about 0.4 MB):
from lcd.integrations.zenodo import willow_dem
from lcd.analysis.hardware import certifiability_margin
dem = willow_dem(distance=5, basis="Z", rounds=10, prior="rl_optimized").flattened()
print(certifiability_margin(dem, method="4.34")) # s* = 1.19: the bound is finite at the fitted noise
What is covered
- Detector error models whose observable part is a balanced matching graph (checked; unbalanced models are refused), with one or several logical observables (union bound over observables).
- stim's surface-code memory circuits under circuit-level and phenomenological noise; Google's published Sycamore and Willow models.
- Bounds: the circuit-level Peierls bound (Theorem 4.28) and its geodesic (4.32) and gap (4.34) refinements; by default the smallest. pymatching's integer weight rounding is accounted for.
How tight: at p = 1e-3 the bound is about 8x (d = 3) and 15x (d = 5) the simulated pymatching rate; it is finite up to p = 6.9e-3, 4.4e-3, 3.6e-3 at d = 5, 7, 9. On Willow's data-fitted models it is finite at d = 3 and 5 but its value at d = 5 is still above 1. Correlated matching, belief matching and neural decoders are not covered.
Background
The theorems, proofs and their numerical checks are in the project repository,
https://github.com/RuiZhu1/coset-distinguishability (theory/main.tex, section 4.9), together with the research
programme they belong to (logical coset distinguishability as a resource). The proofs are drafts that have not been
independently reviewed. Licence: Apache-2.0.
Metadata
Release files for lcd-qec 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lcd_qec-0.1.0.tar.gz | 90.0 kB | Without provenance | Details for lcd_qec-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lcd_qec-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for lcd_qec-0.1.0-py3-none-any.whl |
Total release size: 154.9 kB
Release files / lcd_qec-0.1.0.tar.gz
| Download URL | lcd_qec-0.1.0.tar.gz |
|---|---|
| Size | 90.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b77c7e7b29d4c0b838a3ae7dabdd41cd08675055d7dd58da0ab1b6acfc8bfa1
|
|
BLAKE2b-256 checksum How to use checksums |
c8846ab41764da2222bcc999bf24f3f85e1606af4859dc8d0b9b273a2c4248ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / lcd_qec-0.1.0-py3-none-any.whl
| Download URL | lcd_qec-0.1.0-py3-none-any.whl |
|---|---|
| Size | 64.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d1e663d543e3ad7a2ab9b75ed5d6e143f9edbc1def28deb5304711de4ad9419
|
|
BLAKE2b-256 checksum How to use checksums |
396a61cf429c0b3fd750f154bd1598032dd8c10e7f10ed7019aa60eb35d1951d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for lcd-qec 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.