File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -866,24 +866,14 @@ function ^(A::Hermitian, p::Integer)
866866 else
867867 retmat = Base. power_by_squaring (A, p)
868868 end
869- for i in diagind (retmat, IndexStyle (retmat))
870- retmat[i] = real (retmat[i])
871- end
872869 return Hermitian (retmat)
873870end
874871function ^ (A:: Hermitian{T} , p:: Real ) where T
875872 isinteger (p) && return integerpow (A, p)
876873 F = eigen (A)
877874 if all (λ -> λ ≥ 0 , F. values)
878875 retmat = (F. vectors * Diagonal ((F. values). ^ p)) * F. vectors'
879- if T <: Real
880- return Hermitian (retmat)
881- else
882- for i in diagind (retmat, IndexStyle (retmat))
883- retmat[i] = real (retmat[i])
884- end
885- return Hermitian (retmat)
886- end
876+ return Hermitian (retmat)
887877 else
888878 retmat = (F. vectors * Diagonal ((complex .(F. values).^ p))) * F. vectors'
889879 if T <: Real
You can’t perform that action at this time.
0 commit comments