Quadratic objective SDP


I want to solve the following problem using either JuMP or Convex:

\min_x \quad x^TPx+2q^Tx+q^TPq\\ \text{s.t.} \quad \text{mat}\{x\} \in \mathcal{S}_+^n ,

where x \in \mathbb{R}^{n^2} is the vectorized decision variable that is supposed to be positive semidefinite in matrix form \text{mat}\{x\} =X \in \mathcal{S}_+^n and P and q are problem data.

My question is: How can I handle a quadratic objective for a problem with a sdp constraint?

I know that the problem can be transformed into epigraph form like this:

\min_{x,t} \quad t\\ \text{s.t.} \quad ||P^{\frac{1}{2}}x+P^{-\frac{1}{2}}q||_2 \leq t,\\ \quad \text{mat}\{x\} \in \mathcal{S}_+^n.

This gives me a problem with a SOCP and a SDP constraint. What’s the best way to describe a problem like this using either JuMP or Convex? Is there any clever way to impose a sdp constraint on a vectorized decision variable?

Thank you!


In JuMP, you can do

n = 3
using JuMP
m = Model()
@variable m X[1:n, 1:n] SDP
x = vec(X) # stacks the columns in a big vector