@variable(m, x[1:n]>=0)
@variable(m, X[1:n,1:n], Symmetric)
@constraint(m, X_xx_cons, [1 x'; x X] in PSDCone() )
@objective(m, Min, tr(Q'*X)+dot(b,x))
optimize!(m)
A = dual(X_xx_cons)
and after solving it, the dual variable A is an upper triangular matrix. How can I recover the dual variable of constraint X_xx_cons that is a positive semidefinite matrix ? ( Is it because of symmetry, the off diagonal of A is two times what it supposed to be?) Thank you.
One follow up question, in JuMP, are there alternative ways to express constraint X-x*x^top \succeq 0? I have tried the following but it does not work, is it because JuMP only allows affine expression in PSDCone()?
n = 3
b = rand(n)
Q = [1 0.5 0; 0.5 1 0.5; 0 0.5 1]
model = Model(Mosek.Optimizer)
@variable(model, x[1:n] >= 0)
@variable(model, X[1:n, 1:n], Symmetric)
c = @constraint(model, X-x*x' in PSDCone() )
@objective(model, Min, LinearAlgebra.tr(Q * X) + b' * x)
optimize!(model)
ERROR: MathOptInterface.UnsupportedConstraint{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}: `MathOptInterface.ScalarQuadraticFunction{Float64}`-in-`MathOptInterface.LessThan{Float64}` constraint is not supported by the model: Unable to transform a quadratic constraint into a second-order cone constraint because the quadratic constraint is not strongly convex.
Convex constraints that are not strongly convex (i.e., the matrix is positive semidefinite but not positive definite) are not supported yet.
Note that a quadratic equality constraint is non-convex.
It’s actually the solver that doesn’t support this, and JuMP can’t reformulate the problem into something that the solver supports because X - x * x' is non convex.