[Scipy-tickets] [SciPy] #1159: Wrong eigenvalues generated by scipy.linalg.eigh

SciPy Trac scipy-tickets@scipy....
Tue Apr 20 19:52:37 CDT 2010


#1159: Wrong eigenvalues generated by scipy.linalg.eigh
------------------------------------------------+---------------------------
 Reporter:  ysr                                 |       Owner:  somebody
     Type:  defect                              |      Status:  new     
 Priority:  highest                             |   Milestone:  0.8.0   
Component:  scipy.linalg                        |     Version:  0.7.0   
 Keywords:  eigenvalue, hermitian, eigenvector  |  
------------------------------------------------+---------------------------
 Wrong eigenvalues are generated by the following example. I have to attach
 the example matrix in order to reproduce the error.


 {{{
 import scipy.linalg
 import scipy.io
 L = scipy.io.loadmat('Lmat.mat')['L']
 # let us compute the first (smallest) 5 eigenvectors
 d,v= scipy.linalg.eigh(L,eigvals=(0,4))
 # let us check if the eigenvectors are orthogonal
 scipy.multiply(v[:,0],v[:,1]).sum()
 # answer is zero (to a floating point error). Good!
 # now let us compute the first (smallest) 2 eigenvectors
 d,v= scipy.linalg.eigh(L,eigvals=(0,1))
 # let us check if the eigenvectors are orthogonal
 scipy.multiply(v[:,0],v[:,1]).sum()
 # they are not orthogonal!! the second eigenvector was not calculated
 correctly!
 }}}

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


More information about the Scipy-tickets mailing list