Hi vr,
When all the eigenvalues are distinct, the sets of eigenvectors v and v2 indeed indeed differ only by some scaling factors. A complication is that for the eigs and eig, the eigenvalues (which I will denote by lambda and not d) are identical but may not be in the same order for eigs and eig. If that's the case, the order of the eigenvectors (columns) of v and v2 will not be the same either. But if you sort the eigenvalues in each case, you can compare the corresponding eigenvectors:
A = rand(5,5)+i*rand(5,5);
B = rand(5,5)+i*rand(5,5);
[v lambda] = eigs(A,B);
[v2 lambda2] = eig(B\A);
[~, ind] = sort(diag(lambda))
v = v(:,ind);
[~, ind2] = sort(diag(lambda2))
v2 = v2(:,ind2);
R = v2./v
R =
0.1464 + 0.7369i -0.0218 - 0.6930i 0.7180 - 0.3831i 0.4606 + 0.7239i 0.6188 - 0.7948i
0.1464 + 0.7369i -0.0218 - 0.6930i 0.7180 - 0.3831i 0.4606 + 0.7239i 0.6188 - 0.7948i
0.1464 + 0.7369i -0.0218 - 0.6930i 0.7180 - 0.3831i 0.4606 + 0.7239i 0.6188 - 0.7948i
0.1464 + 0.7369i -0.0218 - 0.6930i 0.7180 - 0.3831i 0.4606 + 0.7239i 0.6188 - 0.7948i
0.1464 + 0.7369i -0.0218 - 0.6930i 0.7180 - 0.3831i 0.4606 + 0.7239i 0.6188 - 0.7948i
The two sets of eigenvectors are scaled (with a different constant factor for each one). The eig function scales the eigenvectors to norm 1, but it's hard to say what the eigs function is doing.
sum(abs(v).^2)
ans = 1.7717 2.0803 1.5100 1.3584 0.9855
sum(abs(v2).^2)
ans = 1.0000 1.0000 1.0000 1.0000 1.0000
With repeated eigenvalues the situation is more complicated. It's only necessary the the eigenvectors span the same space, so for example for N repeated eigenvalues, each eigenvector of eigs is a linear combination of N eigenvectors of eig.
Best Answer