Skip to content

[Prototype] Add TemplateOp to quantum dialect#2685

Draft
mudit2812 wants to merge 9 commits intomainfrom
operator2.0
Draft

[Prototype] Add TemplateOp to quantum dialect#2685
mudit2812 wants to merge 9 commits intomainfrom
operator2.0

Conversation

@mudit2812
Copy link
Copy Markdown
Contributor

@mudit2812 mudit2812 commented Apr 13, 2026

TODOs:

  • Add to qref dialect
  • Add to xDSL dialect

The new op looks like this:

%qreg1 = quantum.template "Foo"(%mat : tensor<?x?xcomplex<f64>>)
    in_qreg (%qreg0) qubit_inds (%wire_reg0 : tensor<?xi64>)
    adjoint ctrls (%ctrl_reg : tensor<3xi64>) ctrl_vals (%ctrl_vals : tensor<3xi1>)
    -> !quantum.reg
    param_map = {mat = [0]}
    in_qubits_map = {reg = [0]}
    static_data = {check = true}

[sc-117467]

@paul0403
Copy link
Copy Markdown
Member

😮

Let's talk about doing this in reference semantics! Since the entire plxpr frontend is being migrated there, this could be super natural over there.

@mudit2812
Copy link
Copy Markdown
Contributor Author

@paul0403 this is just me brainstorming as part of the future abstractions ADR

@paul0403
Copy link
Copy Markdown
Member

@paul0403 this is just me brainstorming as part of the future abstractions ADR

Ah ok!

@mudit2812
Copy link
Copy Markdown
Contributor Author

@paul0403 but yes, I will definitely need your support once we do need to add the same op to the qref dialect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants