Skip to content

eltype of Symmetric or Hermitian matrix of matrices is AbstractMatrix #1071

@araujoms

Description

@araujoms

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 JuliaLang/julia#53186 from working on Symmetric matrices of matrices, and requires the less elegant syntax used in JuliaLang/julia#54413.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions