scipy.linalg.eig does not normalize eigenvector if B is given (Trac #1308) #1834

Closed
scipy-gitbot opened this Issue Apr 25, 2013 · 4 comments

Comments

Projects
None yet
2 participants

Original ticket http://projects.scipy.org/scipy/ticket/1308 on 2010-10-16 by trac user nicki, assigned to unknown.

Hi all,

the title say it all.

Reproducible with

from scipy.linalg import eig
import numpy as np

A = np.array( [ [0.2, 0.4], [0.4, 2.05] ] )
B = np.array( [ [1.0, 0.0], [0.0, 1.0] ] )
print eig( A, B )

Cheers,
Nico

@WarrenWeckesser wrote on 2010-10-16

Thanks for the report.

You can enclose code in triple curly braces (that is, and) to preserve its formatting. Also, when you file a ticket, don't forget to select the component, if you know what it is.

@pv wrote on 2010-10-16

Here we return what LAPACK gives, and in this case it is "Each eigenvector is scaled so the largest component has abs(real part)+abs(imag. part)=1."

IMO, this can be fixed just by updating the documentation accordingly.

trac user nicki wrote on 2010-10-16

Note that this has some potential for confusion:

eig( A )

normalizes properly, and

eig( A, I )

with I being the identity matrix does not. Obviously this is how LAPACK is designed, but it seems flawed here.

Cheers,
Nico

Owner

pv commented Nov 16, 2013

Changed in gh-3055 to return unit normalized eigenvectors.

@pv pv closed this Nov 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment