InfiniteLinearAlgebra.jl icon indicating copy to clipboard operation
InfiniteLinearAlgebra.jl copied to clipboard

Periodic Schrödinger example errors

Open MasonProtter opened this issue 1 year ago • 0 comments

The example in https://github.com/JuliaLinearAlgebra/InfiniteLinearAlgebra.jl/blob/master/examples/periodicschrodinger.jl is erroring out for me. MWE (same code, just not using Plots)

using InfiniteLinearAlgebra

A = BlockTridiagonal(Vcat([[0. 1.; 0. 0.]],Fill([0. 1.; 0. 0.], ∞)),
                       Vcat([[-1. 1.; 1. 1.]], Fill([-1. 1.; 1. 1.], ∞)),
                       Vcat([[0. 0.; 1. 0.]], Fill([0. 0.; 1. 0.], ∞)))

A[1,1] = 2 

xx = [-0.95:0.05:0.95; 2.25:0.125/4:4.0]
(x -> ql(A-x*I).L[1,1]).(xx)

The final line gives

ERROR: MethodError: no method matching _BlockBandedMatrix(::Vector{Float64}, ::Tuple{Vector{Int64}, Vector{Int64}}, ::Tuple{Int64, Int64})

Closest candidates are:
  _BlockBandedMatrix(::AbstractVector, ::AbstractVector{Int64}, ::AbstractVector{Int64}, ::Tuple{Int64, Int64})
   @ BlockBandedMatrices ~/.julia/packages/BlockBandedMatrices/0t7H0/src/BlockSkylineMatrix.jl:135
  _BlockBandedMatrix(::AbstractVector, ::BlockBandedMatrices.BlockSkylineSizes{Tuple{BlockArrays.BlockedUnitRange{Vector{Int64}}, BlockArrays.BlockedUnitRange{Vector{Int64}}}, Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, BandedMatrices.BandedMatrix{Int64, Matrix{Int64}, Base.OneTo{Int64}}, Vector{Int64}})
   @ BlockBandedMatrices ~/.julia/packages/BlockBandedMatrices/0t7H0/src/BlockSkylineMatrix.jl:132

Stacktrace:
 [1] _blocktripert_ql(A::BlockArrays.BlockMatrix{Float64, Tridiagonal{…}, Tuple{…}}, d::Matrix{Float64}, e::Matrix{Float64})
   @ InfiniteLinearAlgebra ~/.julia/packages/InfiniteLinearAlgebra/pla7L/src/infql.jl:195
 [2] ql(A::BlockArrays.BlockMatrix{Float64, Tridiagonal{…}, Tuple{…}})
   @ InfiniteLinearAlgebra ~/.julia/packages/InfiniteLinearAlgebra/pla7L/src/infql.jl:206
 [3] (::var"#6#7")(x::Float64)
   @ Main ./REPL[9]:1
 [4] _broadcast_getindex_evalf
   @ Base.Broadcast ./broadcast.jl:709 [inlined]
 [5] _broadcast_getindex
   @ Base.Broadcast ./broadcast.jl:682 [inlined]
 [6] getindex
   @ Base.Broadcast ./broadcast.jl:636 [inlined]
 [7] copy
   @ Base.Broadcast ./broadcast.jl:942 [inlined]
 [8] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, var"#6#7", Tuple{Vector{Float64}}})
   @ Base.Broadcast ./broadcast.jl:903
 [9] top-level scope
   @ REPL[9]:1
Some type information was truncated. Use `show(err)` to see complete types.

Here's the versions of stuff I've got:

(jl_C4MN3V) pkg> st --m
Status `/tmp/jl_C4MN3V/Manifest.toml`
  [4c555306] ArrayLayouts v1.4.3
  [aae01518] BandedMatrices v1.2.1
  [8e7c35d0] BlockArrays v0.16.38
  [ffab5731] BlockBandedMatrices v0.12.8
  [1a297f60] FillArrays v1.7.0
  [4858937d] InfiniteArrays v0.13.1
  [cde9dba0] InfiniteLinearAlgebra v0.7.2
  [e1ba4f0e] Infinities v0.1.7
  [5078a376] LazyArrays v1.8.2
  [d7e5e226] LazyBandedMatrices v0.9.3
  [1914dd2f] MacroTools v0.5.11
  [a3b82374] MatrixFactorizations v2.1.0
  [aea7be01] PrecompileTools v1.2.0
  [21216c6a] Preferences v1.4.1
  [f8ebbe35] SemiseparableMatrices v0.3.9
  [90137ffa] StaticArrays v1.7.0
  [1e83bf80] StaticArraysCore v1.4.2
  [0dad84c5] ArgTools v1.1.1
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [f43a241f] Downloads v1.6.0
  [7b1f6079] FileWatching
  [b77e0a4c] InteractiveUtils
  [b27032c2] LibCURL v0.6.4
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [ca575930] NetworkOptions v1.2.0
  [44cfe95a] Pkg v1.10.0
  [de0858da] Printf
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization
  [6462fe0b] Sockets
  [2f01184e] SparseArrays v1.10.0
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [e66e0078] CompilerSupportLibraries_jll v1.0.5+1
  [deac9b47] LibCURL_jll v8.4.0+0
  [e37daf67] LibGit2_jll v1.6.4+0
  [29816b5a] LibSSH2_jll v1.11.0+1
  [c8ffd9c3] MbedTLS_jll v2.28.2+1
  [14a3606d] MozillaCACerts_jll v2023.1.10
  [4536629a] OpenBLAS_jll v0.3.23+2
  [bea87d4a] SuiteSparse_jll v7.2.1+1
  [83775a58] Zlib_jll v1.2.13+1
  [8e850b90] libblastrampoline_jll v5.8.0+1
  [8e850ede] nghttp2_jll v1.52.0+1
  [3f19e933] p7zip_jll v17.4.0+2

and

julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa29 (2023-11-14 08:46 UTC)

Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 12 × AMD Ryzen 5 5600X 6-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 6 on 12 virtual cores
Environment:
  JULIA_NUM_THREADS = 6
  JULIA_IMAGE_THREADS = 1

MasonProtter avatar Nov 21 '23 11:11 MasonProtter