# [Scipy-tickets] [SciPy] #1469: arpack eigensolver returns incorrect eigenvector

SciPy Trac scipy-tickets@scipy....
Thu Jun 30 16:30:56 CDT 2011

```#1469: arpack eigensolver returns incorrect eigenvector
---------------------------------+------------------------------------------
Reporter:  ElliotKaplan         |       Owner:  wnbell
Type:  defect               |      Status:  new
Priority:  normal               |   Milestone:  Unscheduled
Component:  scipy.sparse.linalg  |     Version:  0.9.0
Keywords:                       |
---------------------------------+------------------------------------------
I'm feeding arpack.eigs a sparse, diagonal matrix. The test case is just a
diffusion operator, and it looks as if there is a sign error somewhere in
the arpack code. The code below generates the attached output image (x
axis is index, yaxis is value). The red line is the output from
arpack.eigs, the black line is the output of linalg.eig operating on the
dense matrix, and the blue line is the output of arpack.eigs for a
modified diffusion operator.

CODE:

from numpy import *
import scipy.sparse as sparse
import scipy.linalg as linalg
import scipy.sparse.linalg.eigen.arpack as arpack
import pylab as p

diff1 = sparse.spdiags([ones(100.)*(-2), ones(100.), ones(100.)],
[0,1,-1],100,100)
diff2 = sparse.spdiags([ones(100.)*(2), ones(100.), ones(100.)],
[0,1,-1],100,100)

[eval1, evec1] = arpack.eigs(diff1)
[eval2, evec2] = arpack.eigs(diff2)

[eval3, evec3] = linalg.eig(diff1.todense())

p.plot(evec1[:,0], 'r', evec2[:,0], 'b', evec3[:,0], 'k')
p.show()

--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1469>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
```