Skip to content

[MLIR] Add nested adjoint/ctrl support to quantum.ctrl and quantum.adjoint regions - #3090

Merged
maliasadi merged 8 commits into
mainfrom
ctrl-lowering-nested
Aug 12, 2026
Merged

maliasadi merged 8 commits into
mainfrom
ctrl-lowering-nested

Conversation

@maliasadi

Copy link
Copy Markdown
Member

Context:

This PR adds the nested adjoint and ctrl compositin.

At the op level, adjoint and ctrl are commuting fields (Adjoint(Ctrl(g)) == Ctrl(Adjoint(g))), so the only work is composing the two region lowerings! Both passes now defer silently when their region still contains the other kind of unlowered region:

  • ctrl-lowering defers on a nested quantum.adjoint;
  • adjoint-lowering defers on a nested quantum.ctrl.

^ Nesting will be reduced innermost-out: each pass reduces the layers whose body is already op-level gates, and the modifiers land on the gate in any order. So a controlled gate under adjoint just gets its adjoint flag flipped while preserving control wires & values.

Benefits:

  • Add support for nested adjoint and ctrl composition.

Related GitHub Issues:
[sc-125409]

@maliasadi
maliasadi requested review from kipawaa and paul0403 August 4, 2026 15:17
@maliasadi
maliasadi force-pushed the ctrl-lowering-nested branch from caea19a to ceba5fe Compare August 4, 2026 18:51

@kipawaa kipawaa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Base automatically changed from ctrl-lowering to main August 12, 2026 18:54
@maliasadi
maliasadi force-pushed the ctrl-lowering-nested branch from ceba5fe to d42fa56 Compare August 12, 2026 19:07
@maliasadi maliasadi added the author:build-wheels Run the wheel building workflows on this Pull Request label Aug 12, 2026
@maliasadi
maliasadi merged commit 9ba2f74 into main Aug 12, 2026
59 checks passed
@maliasadi
maliasadi deleted the ctrl-lowering-nested branch August 12, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:build-wheels Run the wheel building workflows on this Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants