-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow taking the adjoint of fractional power operations (#5835)
**Context:** The adjoint of an integer power of an operator is the same power of the adjoint of the operator. For fractional powers, this does not hold because of branch cuts in the power function. **Description of the Change:** This PR explicitly disallows computing the (eager) adjoint of a `Pow` operator with fractional power, and raises an `AdjointUndefinedError` in this case. As a tiny side effect, this PR changes the signature of `Identity.pow` to be compatible with generalized simplification workflows where the keyword argument `z` for the power is passed around explicitly (this popped up in a simplification test of `Pow`) NB: As usual, a lazy `Adjoint(Pow(base, z=0.2))` is still supported, just can't be evaluated/simplified if that would lead to calling the method `adjoint` of `Pow`. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** Fixes #5812 [sc-65297]
- Loading branch information
Showing
4 changed files
with
62 additions
and
6 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