Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
araujoms opened this issue Sep 12, 2024 · 1 comment · Fixed by #140
Closed

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

araujoms opened this issue Sep 12, 2024 · 1 comment · Fixed by #140

Comments

@araujoms
Copy link
Contributor

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.

@andreasnoack
Copy link
Member

It should be fixed by #140. Longer term, it would probably be good to avoid the piracy somehow. On the other hand, it's pretty useful (when it doesn't break LinearAlgebra).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants