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

Cannot square an infinite Diagonal? #38

Open
MikaelSlevinsky opened this issue Jun 10, 2021 · 5 comments
Open

Cannot square an infinite Diagonal? #38

MikaelSlevinsky opened this issue Jun 10, 2021 · 5 comments

Comments

@MikaelSlevinsky
Copy link
Member

julia> using HarmonicOrthogonalPolynomials

julia> S = SphericalHarmonic()
SphericalHarmonic{ComplexF64}

julia> ∂θ = AngularMomentum(axes(S, 1))
AngularMomentum{Float64, QuasiArrays.Inclusion{SphericalCoordinate{Float64}, DomainSets.FixedUnitSphere{StaticArrays.SVector{3, Float64}}}}

julia> A = S \ (∂θ * S)
ℵ₀×ℵ₀ LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}} with indices OneToInf()×OneToInf():
 0.0+0.0im                                                                                                 
           0.0+0.0im                                                                                        
                     -0.0-1.0im                                                                             
                                0.0+1.0im                                                                   
                                          0.0+0.0im                                                         
                                                    -0.0-1.0im                                             
                                                               0.0+1.0im                                    
                                                                         -0.0-2.0im                         
                                                                                    0.0+2.0im               
                                                                                              0.0+0.0im     
                                                                                                          
                                                                                                           
                                                                                                           
                                                                                                           
                                                                                                           
                                                                                                          
                                                                                                           
                                                                                                           
                                                                                                           
                                                                                                           
                                                                                                          
                                                                                                           
                                                                                                           
                                                                                                           
                                                                                                                  

julia> A2 = S \ (∂θ^2 * S)
ℵ₀×ℵ₀ LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}}}} with indices OneToInf()×OneToInf():
 0.0+0.0im                                                                                                    
           0.0+0.0im                                                                                           
                     -1.0+0.0im                                                                                
                                -1.0+0.0im                                                                     
                                           0.0+0.0im                                                           
                                                     -1.0+0.0im                                               
                                                                -1.0+0.0im                                     
                                                                           -4.0+0.0im                          
                                                                                      -4.0+0.0im               
                                                                                                 0.0+0.0im     
                                                                                                             
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                             
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                             
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                                     

julia> A*A
ℵ₀×ℵ₀ LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}}}} with indices OneToInf()×OneToInf():
 0.0+0.0im                                                                                                    
           0.0+0.0im                                                                                           
                     -1.0+0.0im                                                                                
                                -1.0+0.0im                                                                     
                                           0.0+0.0im                                                           
                                                     -1.0+0.0im                                               
                                                                -1.0+0.0im                                     
                                                                           -4.0+0.0im                          
                                                                                      -4.0+0.0im               
                                                                                                 0.0+0.0im     
                                                                                                             
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                             
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                             
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                                     

julia> A^2
ERROR: MethodError: Cannot `convert` an object of type LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}} to an object of type LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}}}
Closest candidates are:
  convert(::Type{T}, ::Intervals.AnchoredInterval{P, T, L, R} where {L<:Intervals.Bounded, R<:Intervals.Bounded}) where {P, T} at /Users/mikael/.julia/packages/Intervals/ua9cq/src/anchoredinterval.jl:181
  convert(::Type{T}, ::Intervals.Interval{T, L, R} where {L<:Intervals.Bound, R<:Intervals.Bound}) where T at /Users/mikael/.julia/packages/Intervals/ua9cq/src/interval.jl:253
  convert(::Type{T}, ::QuasiArrays.QuasiIteratorsMD.QuasiCartesianIndex{1, II} where II<:Tuple) where T at /Users/mikael/.julia/packages/QuasiArrays/bxqu9/src/multidimensional.jl:131
  ...
Stacktrace:
 [1] LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}}}}(diag::LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}})
   @ LinearAlgebra /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/diagonal.jl:10
 [2] convert(T::Type{LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}}}}}, m::LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}})
   @ LinearAlgebra /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/special.jl:53
 [3] to_power_type(x::LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}})
   @ Base ./intfuncs.jl:240
 [4] power_by_squaring(x_::LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}}, p::Int64)
   @ Base ./intfuncs.jl:255
 [5] ^(A::LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}}, p::Int64)
   @ LinearAlgebra /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/dense.jl:442
 [6] macro expansion
   @ ./none:0 [inlined]
 [7] literal_pow(f::typeof(^), x::LinearAlgebra.Diagonal{ComplexF64, LazyArrays.BroadcastVector{ComplexF64, typeof(*), Tuple{Complex{Bool}, LazyArrays.BroadcastVector{Float64, Type{Float64}, Tuple{LazyArrays.BroadcastVector{Int64, typeof(div), Tuple{LazyArrays.BroadcastVector{Int64, typeof(*), Tuple{LazyArrays.BroadcastVector{Int64, typeof(^), Tuple{Int64, LazyArrays.BroadcastVector{Int64, typeof(-), Tuple{BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}, Int64}}}}, BlockArrays.BlockVector{Int64, LazyArrays.BroadcastVector{Base.OneTo{Int64}, Type{Base.OneTo}, Tuple{InfiniteArrays.InfStepRange{Int64, Int64}}}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, InfiniteArrays.InfStepRange{Int64, Int64}}}}}}}, Int64}}}}}}}, #unused#::Val{2})
   @ Base ./none:0
 [8] top-level scope
   @ REPL[12]:1

julia> 
@MikaelSlevinsky
Copy link
Member Author

As a side-issue, the infinite Diagonal doesn't show the block structure.

@MikaelSlevinsky
Copy link
Member Author

@dlfivefifty (I guess you should just watch your own repository?)

@dlfivefifty
Copy link
Member

Looks like a missing convert for Diagonal. We can add it to ArrayLayouts.jl for all LayoutVector

@dlfivefifty
Copy link
Member

Can you try adding

Base.convert(::Type{<:Diagonal{<:Any,AV}}, D::Diagonal) where AV<:LayoutVector = Diagonal(convert(AV, D.diag))

These things should be in Base as well but are not

julia> convert(Diagonal{Float64,Vector{Float64}}, Diagonal(1:5))
ERROR: MethodError: no method matching Vector{Float64}(::Diagonal{Int64, UnitRange{Int64}})
Closest candidates are:
  Array{T, N}(::AbstractArray{S, N}) where {T, N, S} at array.jl:540
  Vector{T}() where T at boot.jl:467
  Vector{T}(::SuiteSparse.CHOLMOD.Dense{T}) where T at /Users/solver/Projects/julia-1.6/usr/share/julia/stdlib/v1.6/SuiteSparse/src/cholmod.jl:991
  ...
Stacktrace:
 [1] convert(#unused#::Type{Vector{Float64}}, a::Diagonal{Int64, UnitRange{Int64}})
   @ Base ./array.jl:532
 [2] Diagonal{Float64, Vector{Float64}}(diag::Diagonal{Int64, UnitRange{Int64}})
   @ LinearAlgebra ~/Projects/julia-1.6/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/diagonal.jl:10
 [3] convert(T::Type{Diagonal{Float64, Vector{Float64}}}, m::Diagonal{Int64, UnitRange{Int64}})
   @ LinearAlgebra ~/Projects/julia-1.6/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/special.jl:53
 [4] top-level scope
   @ REPL[3]:1

@dlfivefifty
Copy link
Member

It's actually a known issue: JuliaLang/LinearAlgebra.jl#564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants