Skip to content

Add frontend lowering for pbc.fabricate#3019

Closed
Qottmann wants to merge 7 commits into
mainfrom
qottmann/fabricate
Closed

Add frontend lowering for pbc.fabricate#3019
Qottmann wants to merge 7 commits into
mainfrom
qottmann/fabricate

Conversation

@Qottmann

@Qottmann Qottmann commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add pbc.ref.fabricate MLIR op and value-semantics conversion to pbc.fabricate
  • Wire Catalyst capture lowering via fabricate_p / qref_fabricate_p, including deallocation support for fabricated qubits
  • Export catalyst.fabricate() for legacy QJIT tracing and add pytest/lit coverage

Test plan

  • pytest frontend/test/pytest/test_fabricate.py -v
  • python frontend/test/lit/test_fabricate.py
  • CI

Related

  • Companion PennyLane PR for qp.fabricate() / Fabricate operator

[sc-124605]

Made with Cursor

Qottmann and others added 7 commits July 13, 2026 18:15
Expose fabricate through Catalyst capture and QJIT lowering so qp.fabricate
produces new qubits that compile to pbc.fabricate after value-semantics conversion.

Co-authored-by: Cursor <cursoragent@cursor.com>
Apply black, isort, and clang-format so CI formatting checks pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
Assert empty wires directly instead of num_wires == 0, matching PennyLane
Fabricate after the produced wire is attached during plxpr conversion.

Co-authored-by: Cursor <cursoragent@cursor.com>
…tests.

Replace global capture toggles with capture=True on qjit and add an
enable_graph_decomposition pytest fixture for fabricate lowering tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add a use_empty canonicalizer for pbc.ref.fabricate, assert ref ops are
gone in fabricate tests, clarify deallocate error handling, and move the
changelog entry to New features with the PR link.

Co-authored-by: Cursor <cursoragent@cursor.com>
Handle standalone AbstractQbit tracers in QRegPromise and route qp.deallocate
to catalyst.deallocate so PBC workflows compile with the old frontend.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dime10

dime10 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

I'm guessing this PR is in need of updating? Let me know if you need anything

@Qottmann

Copy link
Copy Markdown
Contributor Author

Closing in favour of #3027 and #3029

@Qottmann Qottmann closed this Jul 20, 2026
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.

2 participants