# Eigenvectors of a symmetric tensor and a matrix

**URL:** <https://discourse.julialang.org/t/eigenvectors-of-a-symmetric-tensor-and-a-matrix/77604>\
**Category:** Numerics\
**Tags:** linearalgebra, eigenvalues\
**Created:** [March 8, 2022, 6:59pm UTC](https://discourse.julialang.org/t/eigenvectors-of-a-symmetric-tensor-and-a-matrix/77604 "2022-03-08T18:59:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrootLoops](https://avatars.discourse-cdn.com/v4/letter/f/c4cdca/32.png) [@FrootLoops](https://discourse.julialang.org/u/FrootLoops)\
**Post date:** [March 8, 2022, 6:59pm UTC](https://discourse.julialang.org/t/eigenvectors-of-a-symmetric-tensor-and-a-matrix/77604/1 "2022-03-08T18:59:41Z")

</div>

Hi, I have a problem calculating the eigenvectors of a matrix/tensor. Maybe someone can explain why the outputs differ from each other.

```julia
using LinearAlgebra, Tensors

A = [-24.978551803697826 -51.42238499537693 0.0; -51.42238499537693 -408.35244213187974 0.0; 0.0 0.0 701.2149143452202]
B = SymmetricTensor{2,3}(A)

@show eigvecs(A)
@show eigvecs(B)

```

The output I get is the following:

```julia
eigvecs(A) = [0.1306710066830574 0.9914257854284588 0.0; 0.9914257854284588 -0.13067100668305742 0.0; 0.0 0.0 1.0]
eigvecs(B) = [NaN NaN NaN; NaN NaN NaN; NaN NaN NaN]

```

Is there some problems using eigvecs on a tensor?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [March 8, 2022, 7:51pm UTC](https://discourse.julialang.org/t/eigenvectors-of-a-symmetric-tensor-and-a-matrix/77604/2 "2022-03-08T19:51:25Z")

</div>

This is [Ferrite-FEM/Tensors.jl#166](https://github.com/Ferrite-FEM/Tensors.jl/issues/166), which is fixed by [Ferrite-FEM/Tensors.jl#168](https://github.com/Ferrite-FEM/Tensors.jl/pull/168). This fix is available in Tensor version 1.9.0, so I guess you have an older version of Tensors.jl installed?

---

<div class="post-metadata">

**Author:** ![FrootLoops](https://avatars.discourse-cdn.com/v4/letter/f/c4cdca/32.png) [@FrootLoops](https://discourse.julialang.org/u/FrootLoops)\
**Post date:** [March 8, 2022, 8:09pm UTC](https://discourse.julialang.org/t/eigenvectors-of-a-symmetric-tensor-and-a-matrix/77604/3 "2022-03-08T20:09:35Z")

</div>

That was the problem. Thank you!
