Skip to main content

stabilizer-synth

License: MIT Python 3.10+ QEC Challenge Record

Fast, automated SAT-based synthesis and verification of non-CSS quantum stabilizer error-correcting codes with group symmetries and 2D hardware-aware layouts.

Developed by @joacibb.


Highlights

  • Non-CSS Quantum Codes: Discovers and analyzes codes outside the conventional CSS framework, achieving high logical rate ($k/n$) at small blocklengths.
  • Record Performance: Powering verified records on the official Unitary Fund QEC Challenge, including [[21, 7, 4]] ($kd^2/n = 5.333$) and [[24, 6, 4]] ($w=5$).
  • Hardware-Aware 2D Layouts: Built-in simulated annealing placement to minimize interaction radius on single-layer 2D chips (local-2d-single).
  • Exact Distance Verification: Integrates exhaustive Pauli enumeration (meet-in-the-middle) and mixed-integer linear programming (MILP).
  • Standards Compliant: Directly exports to QEC Challenge schema JSON and quantum simulation circuits.

Installation

git clone https://github.com/joacibb/stabilizer-synth.git
cd stabilizer-synth
pip install -e .

Quickstart

from stabilizer_synth import (
    synthesize_cyclic_code,
    verify_commutation,
    exhaustive_distance_search,
    optimize_2d_layout
)

# 1. Synthesize a Z7-invariant non-CSS code [[21, 7, 4]]
code = synthesize_cyclic_code(m=7, num_blocks=3, num_generators=2)
print(f"Synthesized: {code.name} with rate k/n = {code.rate:.2%}")

# 2. Verify all stabilizer generators commute
assert verify_commutation(code)
print("Commutation verified: OK")

# 3. Verify distance (confirm no logical operator of weight <= 3 exists)
logical = exhaustive_distance_search(code, max_weight=3)
assert logical is None
print("Exact distance d >= 4 verified: OK")

# 4. Optimize 2D planar layout for single-layer chip
layout = optimize_2d_layout(code, grid_size=5, max_steps=2000)
print(f"2D Layout radius: {layout['interaction_radius']} (single-layer: {layout['layers']})")

# 5. Export JSON for QEC Challenge
with open("codes/21-7-4.json", "w") as f:
    f.write(code.to_json())

Verified Records

Code Parameters $[[n, k, d]]$ Max Check Weight $w$ Efficiency $kd^2/n$ Locality Status
21-7-4 $[[21, 7, 4]]$ $6$ 5.333 2D-local single #1 Record on QEC Challenge (PR #7371)
24-6-4 $[[24, 6, 4]]$ $5$ 4.000 2D-local single Submitting to QEC Challenge

License

MIT License. Copyright (c) 2026 Joaquin (@joacibb).

Metadata

Release files for stabilizer-synth 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stabilizer-synth 0.1.0
File Size Uploaded Provenance Actions
stabilizer_synth-0.1.0.tar.gz 8.9 kB Without provenance Details for stabilizer_synth-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stabilizer-synth 0.1.0
File Interpreter ABI Platform Actions
stabilizer_synth-0.1.0-py3-none-any.whl Python 3 none any Details for stabilizer_synth-0.1.0-py3-none-any.whl

Total release size: 16.9 kB

Release files / stabilizer_synth-0.1.0.tar.gz

Download URL stabilizer_synth-0.1.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
06e291c3b1636cf422e8c81f3c01590ef80a6633de3699cc01aababe363015b0
BLAKE2b-256 checksum
How to use checksums
3a2a022274a0e59a25d6d0f9eef9e107bef2ad5ee306cfdd7799dcbeb7257019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / stabilizer_synth-0.1.0-py3-none-any.whl

Download URL stabilizer_synth-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fcb09d205a4ce4473cf76c263a82383e6bf8405201cd3320dfe6fe1764070a7
BLAKE2b-256 checksum
How to use checksums
418aff8e4062e55835ef405235931eb9cd7b292ba2ac1240c9ab5cc7385a7d79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for stabilizer-synth 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page