Eigenvectors differ between julia and Wolfram/Delphi

I am trying to find the eigenvectors of a matrix:

t = [124.70244538509718 -120.72494594206698; -120.72494594206698 122.53090477427045]

Using eigvecs from linear algebra, I get

 eigvecs(t)
2×2 Matrix{Float64}:
 -0.70392   -0.710279
 -0.710279   0.70392

This disagrees with the value a colleague gets in Delphi, as well as with Mathematics/WolframAlpha computes:

normalize(eigenvectors {{124.70244538509718,-120.72494594206698},{-120.72494594206698,122.53090477427045}})

returns Wolfram

I am not super clear why this is happening. Any advice?

Can you be more specific about what’s wrong? Note that generally eigenvectors have somewhat arbitrary sign and order. If you multiply an eigenvector by -1 (or any scalar really), it’s still an eigenvector. The order is usually determined by and agrees with how the eigenvalues are sorted, e.g. by magnitude or real part. Some applications/packages sort eigenvalues, but you have to look at the documentation to find out whether and how.

4 Likes

WolframAlpha is returning equivalent eigenvectors to Julia’s, just in the opposite order and with the opposite signs. As @apo383 noted, they are both valid answers — there is no universal convention for the ordering and the overall scaling of eigenvectors.

9 Likes