\begin{gathered} \hat{Z} = \operatorname{argmax}\left\{ \langle A, Z \rangle : Z \in {\mathscr{C}}_K \right\} \\ \qquad \mbox{with } {\mathscr{C}}_K = \{Z \in {\mathbb{R}}^{n \times n} : Z^{T} = Z, Z \succeq 0, \operatorname{tr}(Z) = K, Z {\mathbf{0}}_{n} = {\mathbf{0}}_{n}, Z {\geqslant}0 \},  \end{gathered}$$ 