pennylane
pennylane copied to clipboard
Use native pytrees with jax interface
[sc-42956]
Part of the motivation between binding pennylane objects (operators, measurements, and tapes) as pytrees was the opportunity to improve how we bind derivatives to jax.
Now that all pennylane operators are registered as valid pytrees, we can use that to alter how we bind derivatives to jax.
The benefits of this change are:
- Simplified code
The downsides are:
Sometimes operators are not valid pytrees for some reason, or are not able to store tangents in place of the original data. Either of those conditions will break the machine learning interface.
Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md
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.
@albi3ro, what is the status of this PR? The story in Shortcut is in the 0.36 backlog epic.
@albi3ro, what is the status of this PR? The story in Shortcut is in the 0.36 backlog epic.
Now unblocked since the projector PR is in.
Nice! Is there more to do here (aside from resolving merge conflicts)? Can we open it up for review?
And this PR isn't replaced by https://github.com/PennyLaneAI/pennylane/pull/5701?
@albi3ro do we still need this PR?