-
-
Notifications
You must be signed in to change notification settings - Fork 17
isposdef(E::Eigen)
is incorrect
#1187
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
Comments
I suspect this is a matter of documentation, like saying that A quick search revealed that @RalphAS, @antoine-levitt @KlausC shared interest in this. |
Could you explain why this is not enough? |
It depends on what definition of positive-definiteness you are using.
Up to now, |
In such a case, I feel that this is more than just an issue of documentation. This is because the definition of positive definiteness changes between Line 126 in 3f46f5f
|
You mean A+A', right? Yes, the current behavior is an unfortunate bug, but it's not very clear what to do, except storing symmetry in Eigen, documenting the bug or just deleting the |
Turns out it's such a good idea that @KlausC and me did it two years ago: JuliaLang/julia#48549 JuliaLang/julia#48657. I don't remember the outcome of this but it looks like one or both were ready to merge, in which case we can just merge it and change isposdef to use this? @KlausC ? |
Yes, I agree with that. Given the practical importance of the distinction between hermitian/non-hermitian eigendecompositions (e.g. one can be mappend to SVD while the other can't; the inverse eigenvectors are obtained for free in the hermitian case and require extra calculations in the non-hermitian case etc. etc.) it makes a lot of sense to keep this information in |
Thank you. I'd actually be in favour of deprecating and eventually removing The reasoning is that (a) given an eigen decomposition, it's rather easy for a user to check positive definiteness via |
Why do you say this? It's not much bother adding it to the Eigen structure, and it enables a whole bunch of methods. Look at JuliaLang/julia#48549 |
Thank you for the comment. I just think it's a slippery slope, as shown in the trivial example below: julia> A = [1 1im; conj(eps()+1im) 1];
julia> B = [1 1im; conj(1im) 1];
julia> ishermitian(A)
false
julia> ishermitian(B)
true
julia> EA = eigen(A);
julia> EB = eigen(B);
julia> EA.vectors*EA.vectors' ≈ EB.vectors*EB.vectors'
true
julia> inv(EA.vectors) ≈ EA.vectors'
true
julia> inv(EB.vectors) ≈ EB.vectors'
true On the other hand, maintaining a |
OK, point taken, my proposed change (storing the unitarity information in Eigen) would not solve this because it's not easy to know what to do when the eigenvectors are not unitary. My preference would be to error on isposdef(E::Eigen) when E.unitary_eigenvectors is false (ie, Eigen would only support those methods that make sense and are fast). That's breaking, but it could be done eventually, and it would not break the most common case (doing this on a symmetric/hermitian matrix). The alternative is the current behavior (which is just wrong) or perfoming an expensive cholesky. |
Hi,
The problem is as in the title. In short,
isposdef
method forEigen
factorization is incorrect. It does not check for hermiticity/symmetricity and only looks at the eigenvalues, which is of course not enough.Best!
Version info
The text was updated successfully, but these errors were encountered: