-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
BasisRotation
jit compatible (#6779)
**Context:** PR #6019 only fixes `BasisRotation` when using backprop on `default.qubit`. It is not jit compatible on any other device. This is because `unitary_matrix` was being considered a hyperparameter, not a piece of data. So we could not detect that the matrix was a tracer and we were in jitting mode, and we could not convert the matrix back into numpy data. **Description of the Change:** Make `unitary_matrix` a piece of data instead of a hyperparameter. This allows us to detect when it is being jitted. As a by-product, I also made it valid pytree. By making `unitary_matrix` a piece of data, we were able to get rid of the custom comparison method in `qml.equal`. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-51603] Fixes #6004
- Loading branch information
Showing
5 changed files
with
13 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters