Eigenvectors from eigenvalues a numpy implementation
Nov 14, 2019
Recently a very nice article appeared on QuantaMagazine, that relates the eigenvalues of a matrix with its eigenvectors.
The paper is explained in detail in the following arxiv paper
Here I provided a very simple and initial numpy implementation of this method, that is able to return the squared norm of the eigenvectors of any hermitian matrix
You can test this wonderful computational trick against the result of the eigenvectors from numpy
You can check that the result is pretty good, with a nice numerical precision.
I want to extend this function to the application of the numpy.linalg.eigvalsh function, the order of the eigenpairs has to be considered though in this case.
It’s not simply replacing np.linalg.eig with np.linalg.eigh because while eigh returns the eigenpairs sorted by the magnitude of the eigenvalues, eig does not.
A simple illustration that shows the meaning of matrix minors and eigenvalues, as in our case: