Skip to content

[qref 3.1] Migrate alloc, dealloc and observable plxpr conversion to reference semantics#2664

Open
paul0403 wants to merge 13 commits intopaul0403/qref_frontend_mainfrom
paul0403/qref_frontend_alloc_and_obs
Open

[qref 3.1] Migrate alloc, dealloc and observable plxpr conversion to reference semantics#2664
paul0403 wants to merge 13 commits intopaul0403/qref_frontend_mainfrom
paul0403/qref_frontend_alloc_and_obs

Conversation

@paul0403
Copy link
Copy Markdown
Member

@paul0403 paul0403 commented Apr 8, 2026

Context:
Migrate alloc, dealloc and observable plxpr conversion to reference semantics.

Note: this PR only handles the initial allocation from the device initialization. It does not deal with dynamically allocated qubits from qml.allocate() within a circuit. These will be handled after the gates are handled, so there's a reasonable way to test them.

  • Alloc
  • Dealloc
  • AllocQubit (not generated by frontend)
  • DeallocQubit (not generated by frontend)
  • Compbasis
  • NamedObs
  • Hermitian

Related GitHub Issues:
[sc-115868]

@paul0403 paul0403 changed the title [qref3.1] Migrate alloc, dealloc and observable plxpr conversion to reference semantics [qref 3.1] Migrate alloc, dealloc and observable plxpr conversion to reference semantics Apr 8, 2026
**_get_device_kwargs(device),
)
qreg = qalloc_p.bind(len(device.wires))
self.init_qreg = QubitHandler(qreg, self.qubit_index_recorder)
Copy link
Copy Markdown
Member Author

@paul0403 paul0403 Apr 8, 2026

Choose a reason for hiding this comment

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

No more handler!!!! 🚀 🚀 🔥 🔥

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md on your branch with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@paul0403 paul0403 requested a review from a team April 9, 2026 15:10
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