JuliaHomotopyContinuation / HomotopyContinuation.jl

A Julia package for solving systems of polynomials via homotopy continuation.
https://www.JuliaHomotopyContinuation.org
MIT License
175 stars 30 forks source link

Non-real solution incorrectly certified as real #563

Closed saschatimme closed 5 months ago

saschatimme commented 5 months ago

Discussed in https://github.com/JuliaHomotopyContinuation/HomotopyContinuation.jl/discussions/562

Originally posted by **oskarhenriksson** January 16, 2024 Hi! My student Mikkel Dons Demsig and I are a bit puzzled by the following example, where `certify` incorrectly claims that a solution is real: ``` using HomotopyContinuation @var x F = System([x-(3+1e-14*im)]) result = solve(F) vector_of_solutions = solutions(result) certification_result = certify(F,vector_of_solutions) certificate = first(certificates(certification_result)) ```` In fact, it turns out that both `is_real(certificate)` and `is_complex(certificate)` return true, so `certification_result` is displayed in the following (somewhat funny!) way: ``` CertificationResult =================== • 1 solution candidates given • 1 certified solution intervals (1 real, 1 complex) • 1 distinct certified solution intervals (1 real, 1 complex) ``` How is this happening? It seems like the relevant function is `ε_inflation_krawczyk`, but I don't see how the [realness check](https://github.com/JuliaHomotopyContinuation/HomotopyContinuation.jl/blob/d187030767a11b09aab5b41cd00bb718845e444a/src/certification.jl#L1155C9-L1155C9) with `isinterior` could accidentally give an incorrect true when the imaginary part is small.