5.4.2. Examples of SDP Problems

Two examples of SDP problems, semidefinite programming problems with only one block and with many blocks of variables, are considered in this section. The code of different languages is presented to show how to use MindOpt to model and optimize these two problems.

5.4.2.1. SDP Example 1

\[\begin{split}\begin{align*} \max\quad & \langle \mathbf{C},\mathbf{X} \rangle \\ \text { s.t. }\quad & \langle \mathbf{A},\mathbf{X} \rangle = 1 \\ & \mathbf{X} \succeq 0\\ \end{align*}\end{split}\]

where,

\[\begin{split}\mathbf{C} = \begin{bmatrix} -3 & 0 & 1 \\ 0 & -2 & 0 \\ 1 & 0 & -3 \end{bmatrix},\end{split}\]

and

\[\begin{split}\mathbf{A} = \begin{bmatrix} 3 &0 & 1 \\ 0 & 4 & 0 \\ 1 & 0 &5 \end{bmatrix}.\end{split}\]

5.4.2.2. SDP Example 2

\[\begin{split}\max\quad & \langle \mathbf{C}_0,\mathbf{X}_0 \rangle +\langle \mathbf{C}_1,\mathbf{X}_1 \rangle \\ \text { s.t. }\quad & \langle \mathbf{A}_{00},\mathbf{X}_0 \rangle + x_0 = 1 \\ & \langle \mathbf{A}_{11},\mathbf{X}_1 \rangle + x_1 = 2 \\ & \mathbf{X}_0, \mathbf{X}_1\succeq 0\\ & x_0, x_1 \geq 0\end{split}\]

where,

  • \[\begin{split}\begin{align*} \mathbf{C}_0 = \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix} \end{align*},\end{split}\]
  • \[\begin{split}\begin{align*} \mathbf{C}_1 = \begin{bmatrix} 3 & 0 & 1 \\ 0 & 2 & 0 \\ 1 & 0 & 3 \end{bmatrix} \end{align*},\end{split}\]
  • \[\begin{split}\begin{align*} \mathbf{A}_{00} = \begin{bmatrix} 3 & 1 \\ 1 & 3 \end{bmatrix} \end{align*},\end{split}\]
  • \[\begin{split}\begin{align*} \mathbf{A}_{11} = \begin{bmatrix} 3 &0 & 1 \\ 0 & 4 & 0 \\ 1 & 0 &5 \end{bmatrix} \end{align*}.\end{split}\]