It seems you need scipy.linalg.eigh() to solve this generalized eigenvalue problem:
from scipy.linalg import eigh eigvals, eigvecs = eigh(A, B, eigvals_only=False)
You will see that eigvecs is a complex ndarray , so maybe you need to use eigvecs.real ...
In the same module, you have eigvalsh() , which will probably work faster for your case, but it does not return eigenvectors.
source share