Skip to content

Can't compute eigenvalues of Hermitian Diagonal matrix for generic types #139

@araujoms

Description

@araujoms

As the title says, the following code fails:

using LinearAlgebra
using GenericLinearAlgebra
m = Hermitian(Diagonal(randn(BigFloat,2)))
eigvals(m)

This is not related to BigFloat, it also fails for Double64 and Float128. I think the underlying issue is the same as JuliaLang/LinearAlgebra.jl#1056, the lack of a universal fallback.

To make life even stranger, after GenericLinearAlgebra is loaded this code starts failing even for Float64. That is,

using LinearAlgebra
m = Hermitian(Diagonal(randn(Float64,2)))
eigvals(m)

works fine, but

using LinearAlgebra
using GenericLinearAlgebra
m = Hermitian(Diagonal(randn(Float64,2)))
eigvals(m)

fails.

I had previously reported this issue under JuliaLang/LinearAlgebra.jl#1070 under the misconception that GenericLinearAlgebra was a standard library, but @aravindh-krishnamoorthy noted that it isn't, and this issue is not caused by LinearAlgebra.

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