# Bug detected in Arpack

**URL:** <https://discourse.julialang.org/t/bug-detected-in-arpack/55334>\
**Category:** General Usage\
**Created:** [February 15, 2021, 4:32pm UTC](https://discourse.julialang.org/t/bug-detected-in-arpack/55334 "2021-02-15T16:32:31Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Post date:** [February 15, 2021, 4:32pm UTC](https://discourse.julialang.org/t/bug-detected-in-arpack/55334/1 "2021-02-15T16:32:31Z")

</div>

I can say with certainty that the **Arpack.eigs** has a very serious bug. I am running the following simple code to find the 4 smallest eigenvalues and eigenvectors of a 16X16 symmetric matrix. The file xxx.txt is uploaded [here](https://drive.google.com/file/d/1xFMU5ILqBA98udi86m_kNyro4xCjnBP1/view?usp=sharing).

```julia
using Serialization;
using Arpack;

K = deserialize("xxx.txt");
display(K);
k=4;
(vals, vecs) = Arpack.eigs(K; nev = k, which=:SM);

```

This is the output I get. You will notice that the matrix is pretty harmless.

```julia
16×16 Array{Float64,2}:
  0.659233 -0.195475 -0.0260898 0.0 -0.0917547 -0.234595 0.0 -0.14918 0.0 -0.02051 0.0 0.0 -0.031589 0.0 0.0 0.0
 -0.195475 0.61303 -0.141618 -0.0249161 -0.140206 -0.0322586 0.0 0.0 0.0 -0.11133 0.0 0.0 -0.014688 0.0 -0.0718231 0.0
 -0.0260898 -0.141618 0.853604 0.0 -0.130495 -0.0147248 0.0 0.0 0.0 -0.14347 -0.0275495 0.0 0.0 -0.0106849 0.0 -0.000746843
  0.0 -0.0249161 0.0 0.789886 0.0 0.0 -0.223093 0.0 0.0 0.0 0.0 -0.0826823 0.0 -0.232067 -0.0259092 0.0
 -0.0917547 -0.140206 -0.130495 0.0 0.666155 -0.0479611 0.0 -0.182288 0.0 -0.102586 0.0 0.0 0.0 0.0 0.0 0.0
 -0.234595 -0.0322586 -0.0147248 0.0 -0.0479611 0.714565 0.0 -0.155445 0.0 -0.025811 -0.0136642 0.0 -0.0280463 0.0 -0.0307591 -0.000370425
  0.0 0.0 0.0 -0.223093 0.0 0.0 0.75254 0.0 0.0 0.0 0.0 -0.091713 0.0 -0.257414 0.0 0.0
 -0.14918 0.0 0.0 0.0 -0.182288 -0.155445 0.0 0.687753 -0.124747 -0.0093745 -0.0215335 -0.0798659 -0.106118 0.0 -0.0608073 -0.0740178
  0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.124747 0.731166 -0.062372 -0.0831172 -0.107406 -0.159367 0.0 -0.0885275 -0.118728
 -0.02051 -0.11133 -0.14347 0.0 -0.102586 -0.025811 0.0 -0.0093745 -0.062372 0.748047 -0.185609 0.0 -0.0142867 0.0 0.0 -0.0705392
  0.0 0.0 -0.0275495 0.0 0.0 -0.0136642 0.0 -0.0215335 -0.0831172 -0.185609 0.687992 -0.0446934 -0.0328169 0.0 0.0 -0.210717
  0.0 0.0 0.0 -0.0826823 0.0 0.0 -0.091713 -0.0798659 -0.107406 0.0 -0.0446934 0.797492 -0.0933103 -0.0954023 -0.0550552 -0.168394
 -0.031589 -0.014688 0.0 0.0 0.0 -0.0280463 0.0 -0.106118 -0.159367 -0.0142867 -0.0328169 -0.0933103 0.847823 0.0 -0.0769094 -0.0866605
  0.0 0.0 -0.0106849 -0.232067 0.0 0.0 -0.257414 0.0 0.0 0.0 0.0 -0.0954023 0.0 0.449437 0.0 0.0
  0.0 -0.0718231 0.0 -0.0259092 0.0 -0.0307591 0.0 -0.0608073 -0.0885275 0.0 0.0 -0.0550552 -0.0769094 0.0 0.696568 -0.037958
  0.0 0.0 -0.000746843 0.0 0.0 -0.000370425 0.0 -0.0740178 -0.118728 -0.0705392 -0.210717 -0.168394 -0.0866605 0.0 -0.037958 0.660025
 1ERROR: LoadError: SingularException(16)
Stacktrace:
 [1] checknonsingular at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/factorization.jl:19 [inlined]
 [2] checknonsingular at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/factorization.jl:21 [inlined]
 [3] lu!(::Array{Float64,2}, ::Val{true}; check::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/lu.jl:85
 [4] #lu#136 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/lu.jl:273 [inlined]
 [5] lu at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/lu.jl:272 [inlined] (repeats 2 times)
 [6] factorize(::Array{Float64,2}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/dense.jl:1279
 [7] _eigs(::Array{Float64,2}, ::UniformScaling{Bool}; nev::Int64, ncv::Int64, which::Symbol, tol::Float64, maxiter::Int64, sigma::Nothing, v0::Array{Float64,1}, ritzvec::Bool) at /home/nodi/.julia/packages/Arpack/o35I5/src/Arpack.jl:164
 [8] #eigs#10 at /home/nodi/.julia/packages/Arpack/o35I5/src/Arpack.jl:46 [inlined]
 [9] #eigs#9 at /home/nodi/.julia/packages/Arpack/o35I5/src/Arpack.jl:45 [inlined]
 [10] top-level scope at /home/nodi/Documents/Julia/t.jl:10
 [11] include(::String) at ./client.jl:457
 [12] top-level scope at REPL[13]:1
in expression starting at /home/nodi/Documents/Julia/t.jl:8

```

I **urge the Julia developers to give this problem some serious consideration**. A language meant to do high performance computing should be able to find 4 eigenvalues of a 16X16 symmetric matrix. I could do it myself on pen and paper.

---

_[View the full topic](https://discourse.julialang.org/t/bug-detected-in-arpack/55334)._
