How to ensure orthogonality of eigenvectors

question

#1

I have a Hermitian matrix A. Due to numerical errors, (A'-A)/2 is around 10^-17 and eig returns nonorthogonal eigenvectors. I don’t see a eigh function (from numpy) counterpart in julia. How can I ensure orthogonality of eigenvectors of A?


#2

eig(Hermitian(A))


#3

Thank you. Although it is a little bit inconvenient when A has imaginary part in its diagonal axis due to floating point error.


#4

You can rewrite the matrix by keeping only the upper part and copy this upper part to the lower part. This will be exactly symmetric.


#5

See https://github.com/JuliaLang/julia/pull/17367