forked from PennyLaneAI/pennylane
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new op math in generator of GlobalPhase and Controlled (PennyLane…
…AI#5194) **Context:** The `Tensor` and `Hamiltonian` does not work with `Identity` on no wires, causing issues with `ControlledGlobalPhase` when the `GlobalPhase` acts on no wires. **Description of the Change:** 1. Use `prod` and `s_prod` in place of straight multiplication in the `generator` of `Controlled` and `GlobalPhase` 2. The generator of `GlobalPhase` now contains an identity that acts on the same wires as the `GlobalPhase`. **Benefits:** BugFix **Related GitHub Issues:** PennyLaneAI#4578 **Related Shortcut Story:** [sc-44933]
- Loading branch information
1 parent
bf1eb53
commit 5f20ca3
Showing
4 changed files
with
33 additions
and
31 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