PennyLaneAI / catalyst

A JIT compiler for hybrid quantum programs in PennyLane
https://docs.pennylane.ai/projects/catalyst
Apache License 2.0
101 stars 26 forks source link

Added an empty pass boilerplate as a tutorial #872

Open paul0403 opened 1 week ago

paul0403 commented 1 week ago

Before submitting

Please complete the following checklist when submitting a PR:

When all the above are checked, delete everything above the dashed line and fill in the pull request template.


Context: Added an empty pass boilerplate in the catalyst dialect that prints out hello world.

Description of the Change:

Benefits: A tutorial for the pass boilerplate infrastructure for those who want to write custom passes.

Possible Drawbacks:

Related GitHub Issues:

[sc-67240]

github-actions[bot] commented 1 week ago

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

Qottmann commented 1 week ago

100 extra points to fuse this with the QubitUnitaryFusion example below. I tried to create a pass using the provided example code but still struggle with the boilerplate and where to put what (I might also just represent the lower bar of potential users for this 😓 )

If I understand it correctly, most passes are organized in two separate files: one for the pattern and one for the pass. In this tutorial we only cover the pass. The QubitUnitaryFusion example covers the patterns (and briefly the pass). Would be amazing to be able to have both 😇