Quadratic programming to SDP

convex optimizationoptimizationquadratic programmingsemidefinite-programming

Assume I have an quadratic program of the form:
\begin{align*}
\min&&&\|LA-B\|^2\\
\text{s.t.}&&& \text{Tr}A=1\\
&&&A \succeq 0
\end{align*}

Here $A,B,C,L$ are all $n\times n$ real matrices, while the last term implies the constraint that $A$ is positive semi-definite. The question is how to bring this to the standard SDP form
\begin{align*}
\min&&&\langle C,X\rangle \\
\text{s.t.}&&&\langle Q_i, X \rangle = b_i \\
&&&X \succeq 0
\end{align*}

where $\langle C, X \rangle = \mathrm{Tr}(CX)$. I understand that there is the complement trick by Schur but I struggle to apply it. Not sure how to do it.

More generally, how to bring a quadratic program (one whose objective is a quadratic function) to the standard conic SDP form?

Best Answer

If you want to work in a pure primal standard mixed SDP/SOCP cone you would have to introduce a new object $e = (e_0,e) \in R\times R^{n\times n}$ to represent the SOCP cone and replace the objective with $e_0$ and connect the two cones with the primal equalities $e = \text{vec}(LA-B)$ (which I will not write using inner products as that is absurdly low level).

\begin{align*} \min&&& e_0 \\ \text{s.t.}&&&\text{Tr} A =1 \\ &&&e = \text{vec}(LA-B)\\ &&&A \succeq_{SDP} 0, (e_0,e) \succeq_{SOCP} 0 \end{align*}

It is not certain you want to stay in a pure primal form (as you will be forced to introduce a large number of primal equalities), but instead interpret $A$ as a matrix defined by its elements as decision variables, and then skip also the definition of a cone variable for the SOCP and interpret everything from the dual side. The size of this model would be $n(n+1)/2$ (the number of variables defining elements of symmetric matrix $A$) while the size of the primal model would be $n^2+1$ (the number of equalities)

\begin{align*} \min&&& e_0 \\ \text{s.t.}&&& \text{Tr} A =1 \\ &&&A \succeq_{SDP} 0, \\ &&&(e_0,\text{vec}(LA-B)) \succeq_{SOCP} 0 \end{align*}

You typically do not do all this in practice (and we haven't even started with the really low-level boring stuff with inner products to define the equalities explicitly) but use modelling languages for this. The code would look something like this (here in YALMIP)

A = sdpvar(n)
optimize([A>=0, trace(A)==1],norm(L*A-B))
Related Question