Relative Content

Tag Archive for cscipycythonnumerical-methodslapack

Inaccurate Eigenvectors from LAPACK’s ZHEEVR routine

I was trying to replace Scipy’s eigh routine in my cython code with C-level LAPACK. Essentially I want to compute eigenvectors corresponding to the largest and smallest eigenvalues of a hermitian matrix of dimension around 50×50. I made a small 3×3 example to make sure I get the same result as from eigh, which internally uses the ZHEEVR routine it seems. Scipy provides C-level versions of the LAPACK routines to import in cython, which I am using. I think I got the syntax and so on right, since one of the eigenvectors and all the eigenvalues are exactly the same for both eigh and ZHEEVR. However, the other eigenvectors from ZHEEVR are inaccurate. In fact, I don’t obtain a correct decomposition.