[SciPy-dev] Comments on API for Matlab's eigs equivalent (computing a few eigenvalues only)

Warren Weckesser warren.weckesser@enthought....
Thu Feb 4 18:43:46 CST 2010

Anne Archibald wrote:
> On 4 February 2010 15:01, Rob Clewley <rob.clewley@gmail.com> wrote:
>> On Thu, Feb 4, 2010 at 2:31 PM, David Warde-Farley <dwf@cs.toronto.edu> wrote:
>>> On 4-Feb-10, at 3:12 AM, Dag Sverre Seljebotn wrote:
>>>> I feel there's also a certain convention of listing the largest
>>>> eigenvalues first; "let \lambda_i be the eigenvalues...assume
>>>> \lambda_2
>>>> < \lambda_1 ...".
>>> +1, though I've seen them listed from smallest to largest as well.
>>> David
>> I'm +1 too, but are these going to be ordered by norm of the
>> eigenvalue if they are complex, or by the real part only? I suggest by
>> norm, and the docstring needs to make the choice clear. This
>> functionality has to be consistent for all uses of eig()!
> I have to say using the norm for complex eigenvalues is asking for
> trouble, since it puts -2 between 1 and 3. Not that this is relevant
> for a symmetric (Hermitian) eigensolver, which will always have real
> eigenvalues.
> Anne

David C,

You said this was for symmetric matrices, but do you envision later 
allowing nonsymmetric matrices?

If not, then perhaps the name of the function should be 'eigsh', 
following the precedent set by numpy.linalg and scipy.linalg.

On the other hand, if the intent is to eventually handle nonsymmetric 
matrices, then it would be nice to provide an API that is as flexible as 
(but definitetly not the same as) Matlab's eigs function:


In particular, the choice of ordering by magnitude or by real part is 


> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev

More information about the SciPy-Dev mailing list