[SciPy-User] Eigenvectors of sparse symmetric matrix

Hao Xiong hao@biostat.ucsf....
Mon Oct 25 10:13:10 CDT 2010

I am on 64-bit Linux. I will try float32.

Don't know if this matters but the data originally are integers, 0, 1, 
and 2.
They are the encoding of genotypes.


On 10/24/2010 08:26 PM, Lutz Maibaum wrote:
> 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)
> Best,
>    Lutz

More information about the SciPy-User mailing list