Skip to content

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

Open
maliasadi wants to merge 5 commits into
ctrl-loweringfrom
ctrl-lowering-nested
Open

[MLIR] Add nested adjoint/ctrl support to quantum.ctrl and quantum.adjoint regions#3090
maliasadi wants to merge 5 commits into
ctrl-loweringfrom
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant