✨ Add concatenated magic-state distillation - #2543
Open
burgholzer wants to merge 2 commits into
Open
burgholzer wants to merge 2 commits into
burgholzer wants to merge 2 commits into
Conversation
Add the 15-to-1 Reed-Muller benchmark with one to four concatenated levels and shared C++, Python, JSON, and CLI interfaces. Retain actual child outputs for parent blocks and report rejection and root-state checks through the existing output contract. Interpret parameterized unitary qco.call operations through the shared DD call walker so compiled OpenQASM gate helpers execute correctly. Cover ideal sampling, input Z errors, generation, and both DDSIM paths. Assisted-by: GPT-6 via Codex
burgholzer
force-pushed
the
codex/magic-state-distillation
branch
from
September 12, 2026 10:58
7a02ede to
0a2ceae
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Remove level 2 simulation from CI while retaining cheap generation and metadata checks. Use 16 shots for the deterministic level 1 examples and smoke tests, avoiding hundreds of adaptive circuit executions. Keep the exhaustive input-fault coverage. Group all Unreleased changelog entries under Added, Changed, and Fixed. Record manual level 2 validation and measured shot-count costs. Assisted-by: GPT-6 via Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Description
Add the
magic-state-distillationbenchmark for concatenated 15-to-1 Reed–Muller distillation. C++, Python, strict JSON, manifests, and the CLI support levels 1–4, allocating exactly 15, 225, 3,375, or 50,625 qubits. Each level consumes the retained quantum outputs of its children. The two-bit result reports any rejected block and checks the root T state; ideal inputs produce00.The implementation uses a fixed decoder, measurement-dependent Clifford corrections, and structured loops around a reusable block. It models ideal inputs without noise, retries, or physical error correction. Reusing the measured root for the rejection readout preserves the qubit count and permits Adaptive QIR execution through the existing result interface.
Compiled OpenQASM exposed a DD interpreter gap for parameterized
qco.callgate helpers. Reuse the existing call interpreter with its parameter bindings, wire mapping, and recursion checks. Add a nested-call regression that checks global phase as well as functionality, statevectors, and sampling.Include executable examples, generated Python stubs, and Unreleased changelog entries. No new dependencies or migrations are needed. Codex assisted with implementation, tests, documentation, and this PR.
Validation
{"00": 16}. Higher levels retain inexpensive generation and metadata checks; level 2 simulation is excluded from CI.{"00": 256}through all three execution paths with seed 17. The level 2 runs took approximately 225 s (direct), 176 s (Adaptive QIR), and 263 s (OpenQASM 3), including generation and compilation where applicable. Levels 3–4 were validated for generation and QCO conversion only.test/python/bench/andtest/python/qdmi/test_compilation.py. The affected native sampling and generation tests passed in 0.24 s using Clang 23 Release with ThinLTO. The full native benchmark and DD suites passed during feature validation; exhaustive fault coverage still checks all single/double input Z errors and all 35 accepted triple-error patterns.Hosted CI is pending. Human review remains required before acceptance or merging.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).