0
votes

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:

  1. Real eigenvalues, V

  2. 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!

1
What is the value of the imaginary components? If it's small (1E-15 or lower depending), just get rid of them.TroyHaskin
@TroyHaskin Yes, it's about that magnitude. However, I need correct orthogonal eigenvectors for further analysis. That's why I can't just throw the imaginary parts.Jen-Hao Ou
If you can come up with some (random) example of A and B 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 of eig. Try eps(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
Agreed with @Yvon. To proceed further we'll need an MCVE. Although, I'll say again, if the non-zeros from the orthogonality test are "small", there might be nothing you can do.TroyHaskin

1 Answers

0
votes

from matlab document:

[V,D] = eig(A,B) returns diagonal matrix D of generalized eigenvalues and full matrix V whose columns are the corresponding right eigenvectors, so that AV = BV*D.


use following command for more accurate results :

 [V,D]=eig(A,B,'qz')

read the following document carefully about situation where eig function does not return accurate results : Matlab Doc