How does numpy.linalg.eig decide on the order in which the eigenvalues ​​are returned?

When I use numpy.linalg.eig

like

eValues, eVectors = numpy.linalg.eig(someMatrix)

      

the eValues ​​returned are in almost descending order.

How does numpy.linalg.eig determine the order in which eigenvalues ​​are returned?

+3


source to share


1 answer


Numpy makes no guarantees regarding this -

from docstring :



Returns
-------
w : (..., M) array
    The eigenvalues, each repeated according to its multiplicity.
    The eigenvalues are not necessarily ordered. The resulting
    array will be always be of complex type. When `a` is real
    the resulting eigenvalues will be real (0 imaginary part) or
    occur in conjugate pairs

      

Numpy delegates to LAPACK for this calculation, so if there is a sequential ordering, you should consider its implementation details and not rely on it.

+3


source







All Articles