✨ Add a pass cancelling self-inverse gates across call boundaries - #2200
Open
DRovara wants to merge 1 commit into
Open
✨ Add a pass cancelling self-inverse gates across call boundaries#2200DRovara wants to merge 1 commit into
DRovara wants to merge 1 commit into
Conversation
12 tasks
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
2 times, most recently
from
August 24, 2026 09:33
c1e0255 to
74f14e1
Compare
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
from
August 24, 2026 09:52
74f14e1 to
df6be2d
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
2 times, most recently
from
August 25, 2026 08:02
78260b5 to
be8d787
Compare
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
from
August 25, 2026 10:48
be8d787 to
d0f1678
Compare
burgholzer
force-pushed
the
mlir/function-boundary-commutation
branch
from
August 25, 2026 21:44
d0f1678 to
6c11286
Compare
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
2 times, most recently
from
August 26, 2026 14:11
529efe4 to
5c497cf
Compare
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
from
August 26, 2026 14:34
5c497cf to
65aae9c
Compare
DRovara
marked this pull request as ready for review
August 26, 2026 14:37
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
from
August 27, 2026 11:40
65aae9c to
a8a3d80
Compare
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
2 times, most recently
from
August 28, 2026 07:28
0c2aa0c to
217cabf
Compare
DRovara
force-pushed
the
mlir/function-boundary-commutation
branch
from
August 28, 2026 08:11
217cabf to
0fc6a4f
Compare
burgholzer
force-pushed
the
mlir/function-boundary-commutation
branch
from
August 28, 2026 12:30
0fc6a4f to
6615c42
Compare
Commute compatible operations across function boundaries and cover the call-site rewrites. Assisted-by: Claude Opus 5 <noreply@anthropic.com> Assisted-by: Codex
burgholzer
force-pushed
the
mlir/function-boundary-commutation
branch
from
August 30, 2026 14:21
6615c42 to
d5ab43e
Compare
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
Seventh of a stack replacing #1970. Builds on #2199.
quantum-function-boundary-commutationdrops a self-inverse gate applied right before a call when the callee starts by applying the same gate to that argument. The caller-side gate is erased and the call is redirected to a copy of the callee without the callee-side one.Copies are cached per callee and parameter index. The gate removed inside the copy belongs to one specific argument, so sharing a copy between parameters would drop a gate the second call site never had — that was a miscompile in the original PR, keyed only by callee name.
Testing
5 cases in
test_qco_function_boundary_commutation.cpp, scheduled on this pass alone: the cancellation itself, specialization reuse across call sites, a separate specialization per parameter, and the cases that must not cancel (different gates, controlled gates).I also ran a whole-library unity-build check here, compiling all 19 sources of
MLIRQCOTransformsas one translation unit — clean. This and #2197 both touch the sharedcopyFunctionhelper, and a duplicatestaticdefinition in that area broke the docs build during the original PR.optimizations 170.
AI assistance
Code and this description were produced with Claude Code (Opus 5) and Codex, acting on my instructions and within the scope I authorized.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).