Repository navigation
🩹 Preserve scoped classical storage in exporters - #2755
Merged
Merged
Conversation
Keep local classical declarations in OpenQASM control-flow blocks and reset zero-initialized Qiskit storage on each block entry. Retain source names without displacing declared registers, preserve location details, and reject empty named quantum registers before layout construction. Assisted-by: GPT-6 via Codex
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Keep location names as optional export hints while explicit attributes preserve binding names, source identities, and result labels. Exercise scoped storage export and execution after a plain IR round trip drops cosmetic location names. 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
Preserve classical bit declarations inside loops and branches when exporting to OpenQASM 3 and Qiskit. OpenQASM retains declaration scope; Qiskit allocates circuit storage and restores zero-initialized local bits on each block entry.
Use source locations as best-effort naming hints for scalar qubits and local storage. Explicit attributes retain priority and preserve parameter binding, Qiskit identities, declared register names, and QIR result labels. Export and execution work after plain textual IR drops cosmetic locations. Dynamic quantum allocation and general dynamic-bound Qiskit export remain unsupported.
Validation: 325 native OpenQASM tests and 455 Python translation tests passed for the implementation. This follow-up passed 14 focused naming/storage tests, repository lint, and MLIR reference generation. Independent review has no unresolved findings. CI for the updated head is pending.
AI assistance covered implementation, review, tests, documentation, and this description. Human acceptance remains.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).