# Eigenvectors differ between julia and Wolfram/Delphi

**URL:** <https://discourse.julialang.org/t/eigenvectors-differ-between-julia-and-wolfram-delphi/117532>\
**Category:** Numerics\
**Tags:** question, linearalgebra\
**Created:** [July 26, 2024, 10:03pm UTC](https://discourse.julialang.org/t/eigenvectors-differ-between-julia-and-wolfram-delphi/117532 "2024-07-26T22:03:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacques1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jacques1/32/45780_2.png) [@jacques1](https://discourse.julialang.org/u/jacques1)\
**Post date:** [July 26, 2024, 10:03pm UTC](https://discourse.julialang.org/t/eigenvectors-differ-between-julia-and-wolfram-delphi/117532/1 "2024-07-26T22:03:04Z")

</div>

I am trying to find the eigenvectors of a matrix:

```julia
t = [124.70244538509718 -120.72494594206698; -120.72494594206698 122.53090477427045]

```

Using eigvecs from linear algebra, I get

```julia
 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:

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

```

returns [Wolfram](https://www.wolframalpha.com/input?i2d=true&i=normalize%5C%2840%29eigenvectors+%7B%7B124.70244538509718%2C-120.72494594206698%7D%2C%7B-120.72494594206698%2C122.53090477427045%7D%7D%5C%2841%29)

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

---

<div class="post-metadata">

**Author:** ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)\
**Post date:** [July 26, 2024, 10:58pm UTC](https://discourse.julialang.org/t/eigenvectors-differ-between-julia-and-wolfram-delphi/117532/2 "2024-07-26T22:58:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [July 26, 2024, 11:58pm UTC](https://discourse.julialang.org/t/eigenvectors-differ-between-julia-and-wolfram-delphi/117532/3 "2024-07-26T23:58:31Z")

</div>

> [@jacques1](#):
>
> This disagrees with the value a colleague gets in Delphi, as well as with Mathematics/WolframAlpha computes:

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.
