JuMP Empty Constraint when using SumOfSquares


I’m trying to find some sum of squares representation for some polynomials, but I have been receiving some errors. Here is a shortened version of this code that gives this error:

using TypedPolynomials
using Combinatorics
using CSDP
using SumOfSquares

@polyvar a b
@polyvar x[1:2]

q = (a *x[1]+b*x[2])^2
Derb = subs(differentiate(q, b), a=> 1, b => -1)

solver = optimizer_with_attributes(CSDP.Optimizer)
model = SOSModel(solver)
@variable(model, c)
@constraint(model, cref, Derb in SOSCone())
@objective(model, Min, 0)

This gives the error

ERROR: LoadError: ArgumentError: Empty constraint MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}[MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}(1), MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}(2)]: MathOptInterface.ScalarAffineFunction{Float64}(MathOptInterface.ScalarAffineTerm{Float64}[], 0.0)-in-MathOptInterface.EqualTo{Float64}(2.0). Not supported by CSDP.

What is the issue here? The actual polynomials I would like to prove are SOS are somewhat more complicated than this, but are also the derivatives of some other polynomials, with some variables then fixed to specific values.

Thanks - Kevin

1 Like

It looks like the issue is that SumOfSquares is trying to add a constraint like 0 == 2

@blegat is this expected?

This is because the Newton Polytope makes it trivial that this polynomial is not SOS. The degree in x1 is odd so it will be negative either at Info or -Inf

Yes, in the more complicated examples, something similar was happening. I would expect that this would immediately output “infeasible”, instead of this error. I will put in an issue on github.

This is an issue with CSDP then. A probable work-around is to use a different solver, like Mosek or SCS.

Yes, this is an issues with CSDP and it works with other solvers. I know this bug for a while but I’m not sure what’s the right fix without adding a lot of extra complexity either in CSDP or SumOfSquares. It’s usually a sign of incorrect modeling so I’ve always found the error actually helpful