# Algorithms & their complexity behind \`LinearAlgebra.eigvals\`

**URL:** <https://discourse.julialang.org/t/algorithms-their-complexity-behind-linearalgebra-eigvals/91089>\
**Category:** Numerics\
**Tags:** question\
**Created:** [December 1, 2022, 12:20pm UTC](https://discourse.julialang.org/t/algorithms-their-complexity-behind-linearalgebra-eigvals/91089 "2022-12-01T12:20:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanDoe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dandoe/32/52717_2.png) [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Post date:** [December 1, 2022, 12:20pm UTC](https://discourse.julialang.org/t/algorithms-their-complexity-behind-linearalgebra-eigvals/91089/1 "2022-12-01T12:20:10Z")

</div>

What algorithm(s) does [`LinearAlgebra.eigvals`](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.eigvals) employ for a general, i.e., non-symmetric, non-triangular matrix?

---

<div class="post-metadata">

**Author:** ![juthohaegeman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juthohaegeman/32/8620_2.png) [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Post date:** [December 1, 2022, 12:43pm UTC](https://discourse.julialang.org/t/algorithms-their-complexity-behind-linearalgebra-eigvals/91089/2 "2022-12-01T12:43:00Z")

</div>

The Schur decomposition of a general matrix (the specific algorithm being known as QR iteration), as provided by LAPACK.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [December 1, 2022, 12:43pm UTC](https://discourse.julialang.org/t/algorithms-their-complexity-behind-linearalgebra-eigvals/91089/3 "2022-12-01T12:43:26Z")

</div>

It calls `LAPACK.geevx!` under the hood, i.e. [LAPACK: dgeevx](https://netlib.org/lapack/explore-html/d9/d8e/group__double_g_eeigen_ga4e35e1d4e9b63ba9eef4ba8aff3debae.html) (assuming `Float64` precision).

BTW, I recommend `@descend eigvals(A)` from [Cthulhu.jl](https://github.com/JuliaDebug/Cthulhu.jl) to descend down the call tree and investigate things like this. This will lead you to [these lines](https://github.com/JuliaLang/julia/blob/master/stdlib/LinearAlgebra/src/eigen.jl#L304-L308).
