Skip to content

Commit

Permalink
Check only for Hermitian and not Symmetric in matrix exponentiation (J…
Browse files Browse the repository at this point in the history
…uliaLang#55349)

For real matrices, a `Hermitian` eigenvalue problem would be equivalent
to a `Symmetric` one, and for complex matrices, there is no special
complex symmetric eigensolver (it errors at present, and complex
symmetric matrices might not be diagonalizable). I think the
`ishermitian` branch should suffice here. Removing the symmetric branch
makes the return type simpler to infer.
  • Loading branch information
jishnub authored Aug 3, 2024
1 parent 124e0a7 commit a1714ca
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions stdlib/LinearAlgebra/src/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,6 @@ function (^)(A::AbstractMatrix{T}, p::Real) where T
isinteger(p) && return integerpow(A, p)

# If possible, use diagonalization
if issymmetric(A)
return (Symmetric(A)^p)
end
if ishermitian(A)
return (Hermitian(A)^p)
end
Expand Down

0 comments on commit a1714ca

Please sign in to comment.