JuliaApproximation / HarmonicOrthogonalPolynomials.jl

A Julia package for working with spherical harmonic expansions
MIT License
24 stars 2 forks source link

Cannot square an infinite Diagonal? #38

Open MikaelSlevinsky opened 3 years ago

MikaelSlevinsky commented 3 years ago
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 commented 3 years ago

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

MikaelSlevinsky commented 3 years ago

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

dlfivefifty commented 3 years ago

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

dlfivefifty commented 3 years ago

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 commented 3 years ago

It's actually a known issue: https://github.com/JuliaLang/julia/issues/29054