Skip to content

Commit

Permalink
add from_plxpr conversion function (#837)
Browse files Browse the repository at this point in the history
**Context:**

This PR ports the [pennylane PR
#5883](PennyLaneAI/pennylane#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]

---------

Co-authored-by: David Wierichs <[email protected]>
Co-authored-by: David Ittah <[email protected]>
  • Loading branch information
3 people authored Aug 7, 2024
1 parent 0ed7aee commit 429f107
Show file tree
Hide file tree
Showing 5 changed files with 926 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .dep-versions
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ llvm=3a8316216807d64a586b971f51695e23883331f7
enzyme=v0.0.130

# Always remove custom PL/LQ versions before release.
pennylane=0.38.0.dev4
pennylane=0.38.0.dev11
5 changes: 5 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@
[(#931)](https://github.com/PennyLaneAI/catalyst/pull/931)
[(#995)](https://github.com/PennyLaneAI/catalyst/pull/995)

* Adds `catalyst.from_plxpr.from_plxpr` for converting a PennyLane variant jaxpr into a
Catalyst variant jaxpr.
[(#837)](https://github.com/PennyLaneAI/catalyst/pull/837)

<h3>Breaking changes</h3>

* Return values of qjit-compiled functions that were previously `numpy.ndarray` are now of type
Expand Down Expand Up @@ -417,6 +421,7 @@ This release contains contributions from (in alphabetical order):
Alessandro Cosentino,
Lillian M. A. Frederiksen,
Josh Izaac,
Christina Lee,
Kunwar Maheep Singh,
Mehrdad Malekmohammadi,
Romain Moyard,
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ lxml_html_clean
--extra-index-url https://test.pypi.org/simple/
pennylane-lightning-kokkos==0.37.0
pennylane-lightning==0.37.0
pennylane==0.38.0.dev4
pennylane==0.38.0.dev11
Loading

0 comments on commit 429f107

Please sign in to comment.