The svdl() routine of the IterativeSolvers.jl package is giving me completely wrong errors, even for a 4X4 identity matrix. Am I doing something wrong ?
julia> using IterativeSolvers;
julia> using LinearAlgebra;
julia> K= Diagonal(ones(4));
julia> X,L = IterativeSolvers.svdl(K,nsv=3,vecs=:both);
julia> display(X.S);
3-element Array{Float64,1}:
8.097516300046776
6.159726694870877
5.198283129557383
julia> A=X.U * Diagonal(X.S)*X.Vt
4×4 Array{Float64,2}:
0.14693 -0.40968 -0.683797 -0.220515
-0.40968 1.1423 1.90661 0.614855
-0.683797 1.90661 3.18233 1.02626
-0.220515 0.614855 1.02626 0.330953
julia>
As you see, the singular values are all wrong and the factorization does not lead to the original matrix.