[SciPy-User] Eigenvectors of sparse symmetric matrix

Pauli Virtanen pav@iki...
Mon Oct 25 17:27:20 CDT 2010

Mon, 25 Oct 2010 13:35:21 -0700, Lutz Maibaum wrote:
> I think I am seeing the same problem as Hao. I have uploaded a sample
> matrix exhibiting this problem:
>     http://stanford.edu/~maibaum/matrix.mtx.gz

Thanks! Not sure if I can reproduce the issue yet (it's been running an 
hour, and the end is not in sight :)

> I think this is essentially a convergence issue. Calling the eigensolver
> with an extra argument tol=1e-4 will give reasonable results.

The wrappers are currently written to print a warning if the iteration 
does not converge, and I do not see yet why that doesn't happen.

> 1. The sparse eigensolvers take a "maxiter" argument, which defaults to
> None. I would have expected this to mean that there is no cap on the
> amount of iterations. Looking at the code, it seems like it is set to 10
> times the size of the matrix by default. Is this correct?

Correct. ARPACK wants some limit, so something has to be given. I don't 
know if 10*n is the correct choice, though.

> 2. The eigensolver also takes an optional tolerance argument, which
> defaults to 0. This seems like an odd choice for an iterative numerical
> algorithm. The ARPACK manual mentions that the default tolerance is set
> to the machine precision, is this what a tolerance of 0 means? This
> might explain why I don't get reasonable results using 64 bit floats,
> because the precision is just too high.

Yes, the default 0 means machine epsilon, same as in ARPACK (where it's 
also a 'default'). Documentation is lacking, though.

> 3. Is there any way for the calling function to know whether convergence
> was achieved, or whether the eigensolver returned because the maxiter
> iterations were performed? Something like a "NotConverged" exception,
> maybe?

It will be changed to raise an exception in Scipy 0.9 on non-convergence, 
with the obtained partial result stuffed in the exception.

As it is now, it only raises a warning if it does not convergence. But 
no, there is currently no good programmatic way of catching this.

Pauli Virtanen

More information about the SciPy-User mailing list