Closed dwierichs closed 2 weeks ago
Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md
with:
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.67%. Comparing base (
45f8d4a
) to head (cd09001
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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 anAdjointUndefinedError
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 argumentz
for the power is passed around explicitly (this popped up in a simplification test ofPow
)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 methodadjoint
ofPow
.Benefits:
Possible Drawbacks:
Related GitHub Issues: Fixes #5812
[sc-65297]