I am calculating eigenvectors in Matlab and Numpy, but getting different results. I was under the impression there was only one set of eigenvectors for a given matrix, however both of these outputs seem valid.
Here is my matlab code:
m = [ 1.4675 + 0.0000i 0.1669 + 1.2654i;
0.1669 - 1.2654i 1.3085 + 0.0000i]
[eig_vec,eig_val] = eig(m)
eig_val contains:
eig_val =
0.1092 0
0 2.6668
eig_vec contains:
eig_vec =
0.0896 + 0.6789i 0.0953 + 0.7225i
-0.7288 + 0.0000i 0.6848 + 0.0000i
Here is my python code:
m = np.array([[1.46753694+0.j, 0.16692111+1.26535838j],
[0.16692111-1.26535838j, 1.30851770+0.j]])
eig_val,eig_vec = linalg.eigh(m)
eig_val contains:
array([ 0.10923247, 2.66682217])
eig_vec contains:
array([[-0.68477170+0.j , -0.72875765+0.j ],
[ 0.09530915-0.72249836j, -0.08955653+0.67889021j]])
Can anyone explain why these outputs are different, it seems like each the two different sets of eigenvectors are rotated versions of each other. Is one set more correct that the other?