least eigenvalue in python least eigenvalue in python numpy numpy

least eigenvalue in python


Your toy problem happens to be a difficult case for finding the largest eigenvalue via iterative methods, as you have several eigenvalues clustered around the largest one.

If you replace

a = np.random.normal(0,1,(p,p))

by

a = np.random.rand(p, p)

you get very different performance from the scipy.sparse solver.

The answer you are looking for is: the correct method to use depends on the problem you have at hand, and cannot be determined by using toy examples, unless the eigenvalue and sparsity structure and the size of the toy example resembles the actual problem you are trying to solve.