In Matlab, I have two 142 x 142 Hermitian complex matrices A and B, which are verified by
isequal(A,A')
ans =
1
isequal(B,B')
ans =
1
and
A-A'=(all exact zeros)
B-B'=(all exact zeros)
I tried to solve the generalized eigenvalue problem AV = BV*D by
[V,D] = eig(A, B);
and I expected for two things:
Real eigenvalues, V
Eigenvectors are orthogonal. That is, V'BV is an identity matrix.
However, I got COMPLEX eigenvalues and V'BV has nonzero value everywhere. Besides, things didn't change if I use the qz algorithm. Where can possibly go wrong? I have got stuck in this bottleneck for weeks. Any help is highly appreciated!
A
andB
then I can fully test my code and post an answer. Anyway, I agree with @TroyHaskin that the imaginary part is a small number which comes from the computation ofeig
. Tryeps(max(abs(A(:)))
to see to what order of magnitude will the result be in exact, aka below which number you can safely declare they are merely errors and just throw them away. – Yvon