PennyLaneAI / catalyst

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

add from_plxpr conversion function #837

Closed albi3ro closed 1 month ago

albi3ro commented 3 months ago

Context:

This PR ports the pennylane PR #5883 to catalyst and renames it from_plxpr.

Adding this code to catalyst solves many of the dependency and testing issues that arise from placing this code in the pennylane resposity. In the future, if we move more of the catalyst frontend into pennylane, this function may move there as well.

Description of the Change:

Adds a function for converting pennylane variant jaxpr into catalyst variant jaxpr.

Benefits:

Opens up the ability to have improved program capture directly integrated with catalyst.

Possible Drawbacks:

Related GitHub Issues:

[sc-61537]

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 99.31034% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.92%. Comparing base (0ed7aee) to head (7d75032).

Files Patch % Lines
frontend/catalyst/from_plxpr.py 99.31% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #837 +/- ## ========================================== + Coverage 97.89% 97.92% +0.02% ========================================== Files 74 75 +1 Lines 10403 10548 +145 Branches 1173 1216 +43 ========================================== + Hits 10184 10329 +145 + Misses 173 172 -1 - Partials 46 47 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dime10 commented 2 months ago

Thanks for your comments @albi3ro, let me know once you are finished with them and I'll give it a final look :)