Open chriscoey opened 5 years ago
It seems that the algebraic set is empty, it is defined by
-0.961538zr₁² - 0.961538zi₁² == 3.5 && -4.80769zr₁² - 4.80769zi₁² == -3.5
which is rewritten into
1 == 0
When when taking the polynomial modulo the ideal there is no term left.
I agree that the fix would be to fix the newton polytope computation for empty monomial vector. We should both add a test of newton polytope for empty monomial vector and a test with empty algebraic set.
thanks @blegat. if the ideal is empty should there be an error or a warning or something? should the WSOS constraint just be relaxed/dropped? what should the newton polytope function return for an empty monomial vector?
It should return an empty monomial vector. Then it will create a 0x0 PSD matrix: https://github.com/JuliaOpt/SumOfSquares.jl/blob/fdb6adbd87e17e777b7f6abdb124bc8ddaef01fb/src/psd2x2.jl#L3 which is bridged into adding no constraint: https://github.com/JuliaOpt/SumOfSquares.jl/blob/fdb6adbd87e17e777b7f6abdb124bc8ddaef01fb/src/empty_bridge.jl#L1-L8 so it is equivalent to ignoring the constraint. It makes sense since every polynomial is nonnegative over an empty set.
OK I can have a try at fixing this. Thanks
I was getting the same error (slightly different error trace now) with a single equality constraint, e.g.:
model = SOSModel(with_optimizer(Mosek.Optimizer))
@variable(model, gamma)
@constraint(model, y - gamma >= 0, domain = @set(y == 1))
@objective(model, Max, gamma)
optimize!(model)
is that expected?
running this code (replace Hypatia with your favorite SDP solver; sorry I could not figure out how to make the example more minimal) on Julia 1.3 master and JuMP 0.19, I get the following error, which seems to come from DynamicPolynomials due to an empty set of monomials getting passed from
_sub_half_newton_polytope
: