QEC: magic-state-consuming logical T and CCZ operations (#283) - #288
Merged
Conversation
Add scoped logical non-Clifford path for QEC-backed programs by modeling magic-state-consuming T/Tdag/CCZ operations as compiler-visible operations with explicit resource accounting and QEC experiment metadata. - Add WorkloadOp::LogicalT, LogicalTdag, LogicalCcz to workload IR - Add WorkloadBuilder methods with validation (surface-only, distinct ids, equal distances for CCZ) - Add WorkloadError variants for non-Clifford failures - Add RoundKind::MagicT, MagicTdag, MagicCcz to expand IR - Add ExpandedWorkload helpers: t_count, tdag_count, ccz_count, magic_state_demand - Add resource report fields: t_count, tdag_count, ccz_count, magic_state_demand - Add ExperimentRoundKind variants + Stim emit (comment-only) - Add expand arms for all three ops (compiler model, no physical gates) - 9 unit tests + 3 expansion tests - Add example .qn programs (surface_d3_t, surface_d3_ccz) - Add docs/neutral_atom/magic_state_operations.md This is a compiler model of magic-state consumption, not a validated distillation factory or threshold claim.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
arniber21
added a commit
that referenced
this pull request
Jul 24, 2026
Bind logical_t / logical_tdag / logical_ccz as frontend QEC builtins mirroring logical_cx, completing the #283 QEC workload layer that landed in #283/#288 without frontend wiring. - prelude_names / builtins: register the three names + surface-only schemes. - typecheck: let-bound rejection list, dispatch arms, synth_logical_t / synth_logical_tdag (shared surface-only check) and synth_logical_ccz (three surface blocks at equal distance), plus scan_qec_usage. New TypeError variants NonCliffordRequiresSurface / NonCliffordDistanceMismatch with diagnostic codes + Display, encoding the same constraints as quon_qec's WorkloadBuilder validators so lowering never hits a workload-layer rejection. - lower: lowering arms building quantum.dynamic.qec_logical_t / _tdag / _ccz, threading logical ids through the result SSA map. - mlir_bridge qec_dynamic: op names, attrs (a_id/b_id/c_id), verify + builders for the three ops; qec_collect: collection arms calling the workload builders. - examples surface_d3_t.qn / surface_d3_ccz.qn now compile end-to-end through quonc; resource reports carry t_count / ccz_count respectively. - tests: frontend typecheck tests (valid + family/distance rejection) mirroring qec_logical_cx_*, and qec_collect tests for the new ops. - incidental: drop pre-existing dead imports in mlir_bridge pipeline.rs / zx_simplification.rs that blocked the -D warnings clippy gate. No unwrap/expect/anyhow in production src; thiserror+Result throughout.
arniber21
added a commit
that referenced
this pull request
Jul 24, 2026
Bind logical_t / logical_tdag / logical_ccz as frontend QEC builtins mirroring logical_cx, completing the #283 QEC workload layer that landed in #283/#288 without frontend wiring. - prelude_names / builtins: register the three names + surface-only schemes. - typecheck: let-bound rejection list, dispatch arms, synth_logical_t / synth_logical_tdag (shared surface-only check) and synth_logical_ccz (three surface blocks at equal distance), plus scan_qec_usage. New TypeError variants NonCliffordRequiresSurface / NonCliffordDistanceMismatch with diagnostic codes + Display, encoding the same constraints as quon_qec's WorkloadBuilder validators so lowering never hits a workload-layer rejection. - lower: lowering arms building quantum.dynamic.qec_logical_t / _tdag / _ccz, threading logical ids through the result SSA map. - mlir_bridge qec_dynamic: op names, attrs (a_id/b_id/c_id), verify + builders for the three ops; qec_collect: collection arms calling the workload builders. - examples surface_d3_t.qn / surface_d3_ccz.qn now compile end-to-end through quonc; resource reports carry t_count / ccz_count respectively. - tests: frontend typecheck tests (valid + family/distance rejection) mirroring qec_logical_cx_*, and qec_collect tests for the new ops. - incidental: drop pre-existing dead imports in mlir_bridge pipeline.rs / zx_simplification.rs that blocked the -D warnings clippy gate. No unwrap/expect/anyhow in production src; thiserror+Result throughout.
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.
Fixes #283.
What
Adds scoped logical non-Clifford operations (T, T†, CCZ) as compiler-visible operations with explicit resource accounting and QEC experiment metadata.
Changes
quon_qec/src/workload.rs:WorkloadOp::LogicalT,LogicalTdag,LogicalCcz+ builder methods with validationquon_qec/src/expand.rs:RoundKind::MagicT,MagicTdag,MagicCcz+ expand arms + count helpersquon_qec/src/experiment.rs:ExperimentRoundKindvariants + Stim emit (comment-only)quon_na/src/report.rs: Resource report fieldst_count,tdag_count,ccz_count,magic_state_demandquon_na/src/qec_schedule.rs: Populate magic-state fields from expanded workloadsurface_d3_t.qn,surface_d3_ccz.qndocs/neutral_atom/magic_state_operations.mdAcceptance criteria
This is a compiler model of magic-state consumption, not a validated distillation factory or threshold claim.