[SciPy-User] Eigenvectors of sparse symmetric matrix

Lutz Maibaum lutz.maibaum@gmail....
Sun Oct 24 22:26:24 CDT 2010

On Oct 24, 2010, at 6:42 PM, Hao Xiong wrote:
> I am trying to compute the eigenvectors corresponding to the d+1 smallest
> eigenvalues of A=W.T*W. I started with W as a dense matrix and then
> W = sparse.csr_matrix(W)
> A = W.dot(W) # W.T * W
> W,V = eigen_symmetric(A,d+1, which='SM')
> The biggest problem is that the algorithm fails to converge and I get
> all zeros as eigenvectors for a testing dataset. Using dense SVD I
> got the expected results.

What operating system are you using? The sparse eigensolvers have some issues on 64-bit OS-X (see http://projects.scipy.org/scipy/ticket/1220). 

I am currently having similar issues. Oddly enough, I get reasonable results if I convert the matrix from the native float64 to the float32 data type. If you are on a 64 bit system, could you try that and let me know if it changes anything? For example, define A as

  A = W.dot(W).astype(numpy.float32)



More information about the SciPy-User mailing list