Hi, I’m trying to use the moment_matrix function in SumOfSquares package.
ν3 = moment_matrix(constr)
However, I got the following error:
ArgumentError: ModelLike of type MosekModel does not support accessing the attribute SumOfSquares.MomentMatrixAttribute(1)
Does anyone know why it is the case? Everything was fine when I tried the example provided in the documentation.
Could you provide a more complete example that reproduces the error? My guess is that
constr is not a Sum-of-Squares constraint.
Thanks for your quick reply! The polynomial opt problem that I was trying to optimize is
model = SOSModel(Mosek.Optimizer)
kernel = (transpose(p)*vec(B*x) + c0).^2
expr = subs(kernel, c0=> 1.0 , p =>[0.2, 0.6], x=>[0.4, 0.2, 1.0]);
t1 >= 0
t2 >= 0
S = @set vec(B*[1,1,1])>=0 && vec(B*[1,1,1])>=0 && vec(B*[1,1,1]) + vec(B*[1,1,1])==1
@constraint(model, t1 >= 48.0 - expr, domain=S)
@constraint(model, t2 >= expr - 48.0, domain=S)
@constraint(model, constr, var >= t1+2*t2)
@objective(model, Min, var)
And I’m trying to extract the value of optimal B in this problem.
The Sum-of-Squares constraints here are
c1 = @constraint(model, t1 >= 48.0 - expr, domain=S)
c2 = @constraint(model, t2 >= expr - 48.0, domain=S)
You should do
moment_matrix(c2) and try extracting atoms from these.