[SciPy-dev] [SciPy-user] scipy.linalg.eig() returns transposed eigenvector matrix

Pearu Peterson pearu at scipy.org
Mon Nov 14 02:48:54 CST 2005



On Sun, 13 Nov 2005, Travis Oliphant wrote:

> Robert Dick wrote:
>
>> scipy.linalg.eig() returns transposed eigenvector matrix

This is a matter of definition. scipy.linalg.eig and 
scipy.basic.linalg.eig return correct results according to their 
documentation. Just scipy.linalg.eig assumes that eigenvectors are 
returned column-wise, i.e.

   a * vr[:,i] = w[i] * vr[:,i]

holds. While scipy.basic.linalg.eig, that is copied from Numeric, assumes 
that eigenvectors are returned row-wise, i.e

   a * vr[i] = w[i] * vr[i]

holds.

Note that matlab returns eigenvectors column-wise, similar to 
scipy.linalg.eig, and that is how the matrix of eigenvectors is also 
usually defined.

I think it is unfortunate that Numeric eig returns eigenvectors row-wise, 
it is not a mathematically convenient definition that it uses.

Pearu




More information about the Scipy-dev mailing list