-
-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
It seems like this should be defined for numbers, since hermitianpart
is just a generalization of the real part (indeed, in some literature it is called the "operator real part"):
julia> hermitianpart(3+4im)
ERROR: MethodError: no method matching hermitianpart(::Complex{Int64})
Should be easy for someone to add a hermitianpart(x::Number) = real(x)
, update the docstring, and add a test.
(This came up in #1437 for generic code on Hermitian(::Diagonal)
. Note that the original PR for hermitianpart
included a ::Number
method, but it was removed by @dkarrasch at the time because the application was unclear, but with the option of adding it back: JuliaLang/julia#31836 (comment))
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers