[SciPy-dev] [SciPy-user] scipy.linalg.eig() returns transposed eigenvector matrix
Pearu Peterson
pearu at scipy.org
Tue Nov 15 07:47:38 CST 2005
On Tue, 15 Nov 2005, Alan G Isaac wrote:
> On Tue, 15 Nov 2005, Pearu Peterson apparently wrote:
>> I am not convinced that getting eigenvectors one-by-one is
>> the most common case of la.eig usage. Sometimes one needs
>> to operate with the whole matrix of eigenvectors and then
>> the mathematically "correct" representation of the
>> eigenmatrix would be more convinient.
>
> Even though you put "correct" in quotes,
> and even though I do not have a strong position on this,
> I'd like to caution against the "correct"ness argument
> (assuming I have understood it).
I used "correct" solely because it is a matter of definition but
I think column-wise view is also widely used.
The reason why Numeric returns eigenvectors row-wise is because the
default underlying eigensolver function is in C. In scipy.linalg.eig the
eigensolver can be either in C or Fortran and the data storage order of
the returned eigenmatrix is optimally choosed and there is little
optimization argument of returning vectors row-wise. So, we can choose
convention that would be in mathematical notation most convinient.
> Row vectors are perfectly valid left-eigenvectors.
> http://en.wikipedia.org/wiki/Eigenvector
> We are concerned with the case where left and right
> eigenvectors have the same (normalized) elements,
> so we are just trying to pick a convention.
Sure. For getting also left-eigenvectors one should call scipy.linalg.eig
with left=True argument. See
scipy.linalg.eig.__doc__
for more information.
> Like you I expect my eigenvectors to be columns,
> and I think about them as right eigenvectors.
> But others have different expectations apparently.
> The problem in this case is perhaps choosing a transparent
> notation.
I think if eig is properly documented and users will read the
documentation, there will be no problem.
Pearu
More information about the Scipy-dev
mailing list