You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to use SHermitianCompact to speed up some interpolation and linear algebra, but I find it quite a difficult type to work with because it doesn't actually guarantee its values are Hermitian. The simplest example is multiplying a SHermitianCompact matrix by a complex number, which will generically result in a non-Hermitian matrix.
julia>using StaticArrays, LinearAlgebra
julia> y =rand(SHermitianCompact{3,Float64,6});
julia> x =rand(ComplexF64);
julia>norm(y*x -SMatrix(y)*x)
2.1996254891748803
julia>using Pkg
julia> Pkg.status("StaticArrays")
Status `/local/home/lxvm/projects/autobz/Project.toml`
[90137ffa] StaticArrays v1.9.5
A summary of the problems I've encountered include:
(As shown above) multiplication of a SHermitianCompact by a complex number should promote to a SMatrix
The diagonal of a SHermitianCompact should always be real-valued, so that the ishermitian method, which is hard-coded to return true, is correct
The issymmetric method should be true when the element type is real, and otherwise there should be a numerical check
I think I can correct all of the above without changing the storage layout of SHermitianCompact in a small PR. Do the proposed changes seem reasonable and am I missing any others?
The text was updated successfully, but these errors were encountered:
I've been trying to use
SHermitianCompact
to speed up some interpolation and linear algebra, but I find it quite a difficult type to work with because it doesn't actually guarantee its values are Hermitian. The simplest example is multiplying aSHermitianCompact
matrix by a complex number, which will generically result in a non-Hermitian matrix.A summary of the problems I've encountered include:
SHermitianCompact
by a complex number should promote to aSMatrix
SHermitianCompact
should always be real-valued, so that theishermitian
method, which is hard-coded to return true, is correctissymmetric
method should be true when the element type is real, and otherwise there should be a numerical checkI think I can correct all of the above without changing the storage layout of
SHermitianCompact
in a small PR. Do the proposed changes seem reasonable and am I missing any others?The text was updated successfully, but these errors were encountered: