julia icon indicating copy to clipboard operation
julia copied to clipboard

eltype of Symmetric or Hermitian matrix of matrices is AbstractMatrix

Open araujoms opened this issue 1 year ago • 9 comments

MWE:

using LinearAlgebra
m = Symmetric(fill(ones(2,2), 2, 2))
eltype(m)
n = Hermitian(fill(ones(2,2), 2, 2))
eltype(n)

On the other hand, if we do this with UpperTriangular or LowerTriangular the eltype is Matrix{Float64}, as expected.

It's not a burning issue, but prevents the faster kronecker product introduced in #53186 from working on Symmetric matrices of matrices, and requires the less elegant syntax used in #54413.

I've tried to understand the problem, but it seems to come directly from the constructor so I'm stuck.

araujoms avatar May 14 '24 16:05 araujoms