Skip to content

Requesting specializations for operations on Hermitian matrices #58221

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
kbarros opened this issue Apr 24, 2025 · 3 comments
Closed

Requesting specializations for operations on Hermitian matrices #58221

kbarros opened this issue Apr 24, 2025 · 3 comments
Labels
duplicate Indicates similar issues or pull requests linear algebra Linear algebra

Comments

@kbarros
Copy link

kbarros commented Apr 24, 2025

Is it possible that the following could be made to work?

using LinearAlgebra
A = hermitianpart(randn(3,3)) # Hermitian{Float64, Matrix{Float64}}

A .+= Diagonal([1, 2, 3]) # ArgumentError: Cannot set a non-diagonal index in a Hermitian matrix
A .*= 2                   # Same

For now, this seems like a work-around:

A.data .+= Diagonal([1, 2, 3])
A.data .*= 2
@kbarros
Copy link
Author

kbarros commented Apr 24, 2025

@nsajko nsajko added the linear algebra Linear algebra label Apr 25, 2025
@kbarros
Copy link
Author

kbarros commented Apr 25, 2025

Yup, those previous issues cover it, thank you.

@kbarros kbarros closed this as completed Apr 25, 2025
@nsajko nsajko added the duplicate Indicates similar issues or pull requests label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Indicates similar issues or pull requests linear algebra Linear algebra
Projects
None yet
Development

No branches or pull requests

2 participants