julia
julia copied to clipboard
eltype of Symmetric or Hermitian matrix of matrices is AbstractMatrix
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.