🐛 Export measurements across quantum operations - #2439
Merged
Conversation
Allow unitary operations and resets between a measurement and its destination store without moving the measurement. Retain conservative rejection across classical accesses and control flow. Assisted-by: GPT-6 via Codex Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Cover delayed measurement stores across inverse modifiers through both QC and QCO after the unitary effect contract update. Assisted-by: GPT-5 via Codex
simon1hofmann
requested review from
burgholzer
and
a lite review from Copilot
and removed request for
Copilot
September 7, 2026 19:02
Contributor
|
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
12 tasks
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
The native Qiskit exporter rejects valid programs when a SWAP or another quantum
operation separates a measurement from the store of its result. Allow constants,
unitary operations (including barriers), and resets between them. Keep the
measurement at its original position and use its existing classical destination,
without adding classical bits.
Continue rejecting intervening classical accesses and control flow: fusing the
store into the measurement writes the destination earlier and may otherwise
change the program's meaning. Update the documented export contract.
This addresses the exporter restriction discussed in #2351 independently of the
mapping fixes and the sorter changes in #2436. Neither PR is a dependency.
No standalone changelog entry or migration instructions are needed for this
correction to unreleased v4 functionality.
Validation
6b9385280, including 🐛 Enforce unitary effect contracts #2435 and 🐛 Synthesize one-qubit gates without entanglers #2444, and rebuilt the MLIRbindings at
db22ece60.SWAP, reset, barrier, and inverse modifiers through QC and QCO conversion.
They check operation order, wire and destination identity, classical-bit
count, and measured value.
case remain rejected. The existing control-flow checks still pass.
uvx nox -s lintandgit diff --checkpassed.uvx nox -s stubspassed and produced no tracked stub changes.uvx nox -s cpp-lint -- upstream/mainpassed with zero clang-format orclang-tidy findings, checking the full changed C++ file with clang-tidy 23.
Implementation, tests, documentation, and this description were prepared with
AI assistance via Codex. CI and human-review confirmations remain open for the
updated revision.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).