10

What is the point of the Symmetric type in the LinearAlgebra package of Julia? It seems like it is equivalent to the type Hermitian for real matrices (although: is this true?). If that is true, then the only case for which Symmetric is not redundant with Hermitian is for complex matrices, and it would be surprising to want to have a symmetric as opposed to Hermitian complex matrix (maybe I am mistaken on that though).

I ask this question in part because I sometimes find myself doing casework like this: if I have a real matrix, then use Symmetric; if complex, then Hermitian. It seems though that I could save work by just always using Hermitian. Will I be missing out on performance or otherwise if I do this?

(Also, bonus question that may be related: why is there no HermTridiagonal type in addition to SymTridiagonal? I could use the former. Plus, it seems more useful than SymTridiagonal in consideration of the above.)

2
  • 2
    Given that this is a bit of an open-ended question it might be better asked at discourse.julialang.org Commented Jun 4, 2020 at 19:07
  • 3
    At the suggestion of @SimonByrne I did cross-post the question at discourse.julialang.org/t/… which has helpful discussion. Commented Jun 5, 2020 at 21:15

1 Answer 1

1

To copy the answer from the linked discourse thread (via @stevengj):

Always use Hermitian. For real elements, there is no penalty compared to Symmetric.

There aren’t any specialized routines for complex Symmetric matrices that I know of. My feeling is that it was probably a mistake to have a separate Symmetric type in LinearAlgebra, but it is hard to remove at this point.

Sign up to request clarification or add additional context in comments.

1 Comment

The right answer would probably be to alias Symmetric to Hermitian{<:Real}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.