How does numpy.linalg.eig decide on the order in which the eigenvalues are returned?
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 to share