Giter Club home page Giter Club logo

Comments (5)

Jutho avatar Jutho commented on June 1, 2024

It seems you were entering geneigsolve((A, I), ...) with A some Tridiagonal matrix and I the LinearAlgebra.UniformScaling object. The problem is that the latter is not recognized as a matrix (literally, because UniformScaling <: AbstractMatrix is false), but I can fix that. However, alternatively, if you would want to use the identity matrix in geneigsolve (you are better of using eigsolve in that case, but anyway, for testing purposes), you could also do so by using geneigsolve((A, identity), ...). Here, identity is a standard Julia function which just returns its argument.

from krylovkit.jl.

MatsuBasho avatar MatsuBasho commented on June 1, 2024

Thank you for your reply, I wanted to test geneigsolve in the most simplest case (with B = I) in order to understand it before really using it. That being said, I think that there are an issue with Tridiagonal matrix. When I define A and M by:

julia> diagM = [1.0 for 1 in 1:100];

julia> diagM = [1.0 for i in 1:100];

julia> M = SymTridiagonal(diagM, subdiagM);

julia> subdiagA = [-0.5 for i in 1:99];

julia> A = SymTridiagonal(diagM, subdiagA);

and when I try geneigsolve((A,M), 3, :SR), I get:

ERROR: MethodError: no method matching cholesky(::Hermitian{Float64,SymTridiagonal{Float64,Array{Float64,1}}}; check=false)
Closest candidates are:
cholesky(::Union{Hermitian{Complex{T},SparseArrays.SparseMatrixCSC{Complex{T},Int64}}, Hermitian{T,SparseArrays.SparseMatrixCSC{T,Int64}}, Symmetric{T,SparseArrays.SparseMatrixCSC{T,Int64}}, SparseArrays.SparseMatrixCSC{T,Ti} where Ti<:Integer, SparseArrays.SparseMatrixCSC{Complex{T},Ti} where Ti<:Integer}; kws...) where T<:Real at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/SuiteSparse/src/cholmod.jl:1458
cholesky(::Union{StridedArray{T, 2} where T, Union{Hermitian{var"#s823",var"#s822"}, Hermitian{Complex{var"#s823"},var"#s822"}, Symmetric{var"#s823",var"#s822"}} where var"#s822"<:(StridedArray{T, 2} where T) where var"#s823"<:Real}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/cholesky.jl:344 got unsupported keyword argument "check"
cholesky(::Union{StridedArray{T, 2} where T, Union{Hermitian{var"#s821",var"#s820"}, Hermitian{Complex{var"#s821"},var"#s820"}, Symmetric{var"#s821",var"#s820"}} where var"#s820"<:(StridedArray{T, 2} where T) where var"#s821"<:Real}, ::Val{false}; check) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/cholesky.jl:344
...
Stacktrace:
[1] isposdef(::SymTridiagonal{Float64,Array{Float64,1}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/dense.jl:91
[2] geneigselector(::Tuple{SymTridiagonal{Float64,Array{Float64,1}},SymTridiagonal{Float64,Array{Float64,1}}}, ::Type{T} where T) at /Users/etiennebernard/.julia/packages/KrylovKit/OLgKs/src/eigsolve/geneigsolve.jl:164
[3] #geneigsolve#64 at /Users/etiennebernard/.julia/packages/KrylovKit/OLgKs/src/eigsolve/geneigsolve.jl:153 [inlined]
[4] geneigsolve at /Users/etiennebernard/.julia/packages/KrylovKit/OLgKs/src/eigsolve/geneigsolve.jl:146 [inlined]
[5] #geneigsolve#60 at /Users/etiennebernard/.julia/packages/KrylovKit/OLgKs/src/eigsolve/geneigsolve.jl:133 [inlined]
[6] geneigsolve at /Users/etiennebernard/.julia/packages/KrylovKit/OLgKs/src/eigsolve/geneigsolve.jl:130 [inlined] (repeats 2 times)
[7] top-level scope at REPL[29]:1

Thank you in advance.

from krylovkit.jl.

MatsuBasho avatar MatsuBasho commented on June 1, 2024

I have found out ! With convert(Array, A), the bug is fixed....

from krylovkit.jl.

Jutho avatar Jutho commented on June 1, 2024

This seems to be a bug in Julia, namely isposdef does not seem to be working on SymTridiagonal matrices. I would advise to report this as a bug/issue on Julia's github page.

That being said, if you are confident that the M matrix is positive definite, you can bypass this check with geneigsolve((A,M), ...; isposdef = true)

from krylovkit.jl.

Jutho avatar Jutho commented on June 1, 2024

I think this is solved; feel free to reopen if not.

from krylovkit.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.