Skip to content

[qref 3.2] Migrate gate-like ops' plxpr conversion to reference semantics#2672

Merged
paul0403 merged 58 commits intopaul0403/qref_frontend_mainfrom
paul0403/qref_frontend_gates
Apr 23, 2026
Merged

[qref 3.2] Migrate gate-like ops' plxpr conversion to reference semantics#2672
paul0403 merged 58 commits intopaul0403/qref_frontend_mainfrom
paul0403/qref_frontend_gates

Conversation

@paul0403
Copy link
Copy Markdown
Member

@paul0403 paul0403 commented Apr 9, 2026

Context:
Migrate gate-like ops' plxpr conversion to reference semantics.

This PR also handles dynamic allocations and deallocations from qml.allocate().

Note: adjointed gates are not handled in this PR. They will be handled in a future PR that specifically handles the adjoint region from plxpr.

  • CustomOp
  • MultiRZOp
  • PCPhaseOp
  • PauliRotOp
  • GlobalPhaseOp
  • QubitUnitaryOp
  • MeasureOp
  • SetStateOp
  • SetBasisStateOp

Related GitHub Issues:
[sc-115869]

Comment thread frontend/catalyst/from_plxpr/qfunc_interpreter.py
Base automatically changed from paul0403/qref_frontend_alloc_and_obs to paul0403/qref_frontend_main April 16, 2026 18:00
Comment thread mlir/lib/Driver/Pipelines.cpp Outdated
Copy link
Copy Markdown
Member

@rniczh rniczh left a comment

Choose a reason for hiding this comment

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

LGTM 💯 This PR is straightforward, Thanks @paul0403

Copy link
Copy Markdown
Contributor

@kipawaa kipawaa left a comment

Choose a reason for hiding this comment

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

I love reference semantics! Just a bit of style and one test request :) thanks!

Comment thread frontend/catalyst/from_plxpr/qfunc_interpreter.py Outdated
Comment thread frontend/catalyst/from_plxpr/qref_jax_primitives.py Outdated
Comment thread frontend/catalyst/from_plxpr/qref_jax_primitives.py Outdated
Comment thread frontend/catalyst/from_plxpr/qref_jax_primitives.py Outdated
Comment thread frontend/catalyst/from_plxpr/qref_jax_primitives.py Outdated
Comment thread frontend/catalyst/from_plxpr/qref_jax_primitives.py Outdated
Comment thread frontend/catalyst/from_plxpr/qref_jax_primitives.py Outdated
Comment thread frontend/test/lit/test_qref/test_flat_circuits.py
Copy link
Copy Markdown
Contributor

@kipawaa kipawaa left a comment

Choose a reason for hiding this comment

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

💯

@paul0403 paul0403 merged commit b39e14b into paul0403/qref_frontend_main Apr 23, 2026
33 of 35 checks passed
@paul0403 paul0403 deleted the paul0403/qref_frontend_gates branch April 23, 2026 14:37
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.

3 participants