Skip to content

Commit 86d13ab

Browse files
jishnublazarusA
authored andcommitted
Check only for Hermitian and not Symmetric in matrix exponentiation (JuliaLang#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.
1 parent 8ab522f commit 86d13ab

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

stdlib/LinearAlgebra/src/dense.jl

-3
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,6 @@ function (^)(A::AbstractMatrix{T}, p::Real) where T
565565
isinteger(p) && return integerpow(A, p)
566566

567567
# If possible, use diagonalization
568-
if issymmetric(A)
569-
return (Symmetric(A)^p)
570-
end
571568
if ishermitian(A)
572569
return (Hermitian(A)^p)
573570
end

0 commit comments

Comments
 (0)