-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Context:** For the `Rot` gate, the angles can cancel in a non-trivial way (e.g. Rot(φ,0,-φ) = RZ(φ) RY(0) RZ(-φ) = RZ(0) = I). Unlike `single_qubit_fusion`, this was not being handled correctly and only the trivial case where all angles are zero was being checked. **Description of the Change:** - Create a boolean flag `angles_cancel` that determines whether the operator is the identity and can be ignored in the transformed tape. - Added a test to cover the use case. **Benefits:** Correct behaviour. **Possible Drawbacks:** None identified. **Related GitHub Issues:** Fixes #7010 [sc-85327] --------- Co-authored-by: David Wierichs <[email protected]> Co-authored-by: Christina Lee <[email protected]>
- Loading branch information
1 parent
a0f6f71
commit 4690439
Showing
3 changed files
with
23 additions
and
1 deletion.
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