Open magsol opened 4 years ago
Also, use the eigh
function instead of the generic eig
, because you are indeed using a Hermitian/symmetric matrix. As a result--and as you can see from the documentation--the eigenvalues and eigenvectors will already be ordered for you.
https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eigh.html#scipy.linalg.eigh
Don't even need sort_eigens
anymore.
NumPy's linear algebra library is subpar. SciPy's uses LAPACK which is well-verified and excellent.
It works the same way. Just import
scipy.linalg
instead.https://github.com/quinngroup/ornet/blob/eigenspectrum/src/analysis/util.py#L51