Skip to content
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

AbstractQ literal_pow (Q^2) missing #1060

Closed
dlfivefifty opened this issue Apr 7, 2024 · 0 comments · Fixed by JuliaLang/julia#54010
Closed

AbstractQ literal_pow (Q^2) missing #1060

dlfivefifty opened this issue Apr 7, 2024 · 0 comments · Fixed by JuliaLang/julia#54010
Labels
regression 1.10 Regression in the 1.10 release

Comments

@dlfivefifty
Copy link
Contributor

Base.literal_pow should be overloaded so that Q^2 works, i.e., we want the following to not error:

julia> Q = qr(randn(5,5)).Q
5×5 LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}, Matrix{Float64}}

julia> Q*Q
5×5 Matrix{Float64}:
 -0.908458   0.15328    0.171023   0.346546    0.0431982
 -0.0574299  0.850477  -0.260641  -0.419498    0.171693
  0.0887003  0.307879   0.330109   0.0439806  -0.886813
  0.381531   0.369071   0.5402     0.521318    0.393233
  0.134058   0.148969  -0.70854    0.655912   -0.166092

julia> Q^2
ERROR: MethodError: no method matching ^(::LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}, Matrix{Float64}}, ::Int64)

Closest candidates are:
  ^(::Regex, ::Integer)
   @ Base regex.jl:863
  ^(::Missing, ::Integer)
   @ Base missing.jl:165
  ^(::Missing, ::Number)
   @ Base missing.jl:123
  ...

Stacktrace:
 [1] literal_pow(f::typeof(^), x::LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}, Matrix{Float64}}, ::Val{2})
   @ Base ./intfuncs.jl:351
 [2] top-level scope
   @ REPL[177]:1
@mbauman mbauman added the regression 1.10 Regression in the 1.10 release label Apr 12, 2024
@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression 1.10 Regression in the 1.10 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants