-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make GlobalPhase not differentiable (#5620)
**Context:** When using the following state preparation methods (`AmplitudeEmbedding`, `StatePrep`, `MottonenStatePreparation`) with `jit` and `grad`, the error `ValueError: need at least one array to stack` was encountered. **Description of the Change:** All state preparation strategies used `GlobalPhase` under the hood, which caused the above error. After this PR, `GlobalPhase` may not be differentiable anymore, as its `grad_method` is set to `None`. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** It fixes #5541 --------- Co-authored-by: David Wierichs <david.wierichs@xanadu.ai> Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
- Loading branch information
1 parent
20eed81
commit 6e122ae
Showing
6 changed files
with
48 additions
and
10 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
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