-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Lightning GPU Rot adjoint bug and enable Rot in toml (#1004)
### Before submitting Please complete the following checklist when submitting a PR: - [X] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the [`tests`](../tests) directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [ ] Ensure that the test suite passes, by running `make test`. - [X] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [X] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** Previously the implementation of Rot and CRot gates (e.g. `Rot(a, b, c)`) with adjoint in LGPU ended up multiplying `Rot(-a, -b, -c)` instead of `Rot(-c, -b, -a)`. The error was not found in tests since the C++ tests used the wrong adjoint rotation matrix, and since `Adjoint(Rot)` and `Adjoint(CRot)` were not in the frozenset, they were not executed in the Python tests. The error is found when adding the invertible capability for Rot and CRot and [the following test](https://github.com/PennyLaneAI/pennylane-lightning/blob/45a67d495552ca9aca3c05467b16b1b6d2e1d4ab/tests/test_apply.py#L1362) fails. **Description of the Change:** This PR fixes the implementation and C++ tests. The toml file is also updated to enable `Adjoint(Rot)` and `Adjoint(CRot)` from Python. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-78931] --------- Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
- Loading branch information
1 parent
c7846c3
commit d37e638
Showing
6 changed files
with
13 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ | |
Version number (major.minor.patch[-label]) | ||
""" | ||
|
||
__version__ = "0.40.0-dev15" | ||
__version__ = "0.40.0-dev16" |
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