New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overload Base.literal_pow
for AbstractQ
#54010
Conversation
I changed things to the matrix approach: so only |
@inline Base.literal_pow(::typeof(^), Q::AbstractQ, ::Val{1}) = Q | ||
@inline Base.literal_pow(::typeof(^), Q::AbstractQ, ::Val{-1}) = inv(Q) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@inline Base.literal_pow(::typeof(^), Q::AbstractQ, ::Val{1}) = Q | |
@inline Base.literal_pow(::typeof(^), Q::AbstractQ, ::Val{-1}) = inv(Q) |
Is there a reason for these? The fallback should work just fine here, no?
Ah, ok, I see. This is fallout from #46196, where we lost the |
Hihi, technically, one could make |
|
Ok, then I think this is ready to go, isn't it? |
Looks fine to me! Thanks! |
Fixes #53989.
There's a decision to be made here. What do we want
Q^-1
to return?Q'::AbstractQ
orQ'*I::Matrix
? On Julia v1.9 and older,Q^p
returned the matrix representation for anyp
exceptp=-1
, where it returnedinv(Q)
which was defined to beQ'
. I have returned to this behavior after finding out.