Skip to content
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

isposdef(E::Eigen) is incorrect #1187

Open
sztal opened this issue Jan 29, 2025 · 1 comment
Open

isposdef(E::Eigen) is incorrect #1187

sztal opened this issue Jan 29, 2025 · 1 comment

Comments

@sztal
Copy link

sztal commented Jan 29, 2025

Hi,

The problem is as in the title. In short, isposdef method for Eigen factorization is incorrect. It does not check for hermiticity/symmetricity and only looks at the eigenvalues, which is of course not enough.

using LinearAlgebra
T = UpperTriangular(rand(3, 3) .+ 1)
isposdef(T)  # False
isposdef(eigen(T))  # True

Best!

Version info

Julia Version 1.11.3
Commit d63adeda50d (2025-01-21 19:42 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 9 5900HX with Radeon Graphics
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)
Environment:
  JULIA_PROJECT = @.
  JULIA_PKG_PRESERVE_TIERED_INSTALLED = true
  JULIA_REVISE = manual
@dkarrasch
Copy link
Member

I suspect this is a matter of documentation, like saying that isposdef(E::Eigen) only checks for real and positive eigenvalues, assuming that E is the eigendecomposition of a self-adjoint matrix ("RealHermOrSymComplexHerm"). I don't know how one would check for symmetry: any such check would be subject to floating point inaccuracies, so likely V'V is not the identity, and/or V'Diagonal(evals)*V is not symmetric/Hermitian. I vaguely remember, however, that there was some effort to store that piece of information (whether E is the eigendecomposition of a self-adjoint matrix).

A quick search revealed that @RalphAS, @antoine-levitt @KlausC shared interest in this.

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

No branches or pull requests

2 participants