# How to formulate a convex expression to minimize the difference between Frobenius norm of a positive semidefinite matrix and a positive value

So what I am trying to do is to minimize the distance between the Frobenius norm of a PSD matrix and a real positive value, which can be formulated as $$\min \left|\|\textbf{P}\|_F - J\right|^2$$ where $$\textbf{P}$$ is the PSD matrix to be optimized and $$J$$ is a real positive constant. Then the problem here is that the whole minimization will fail the disciplined convex programming rule, and I want to know whether we can formulate this idea to be a convex formulation and accepted by CVX. Is it possible to do that?

Edit: $$\textbf{P}\in \mathbb{C}^{J \times J}$$.

• Can you diagonalize the matrix beforehand? Then you can just work on the eigenvalues with a positivity constraint and massively reduce your dimensionality Commented Nov 21, 2023 at 16:31
• You don't have a convex objective function being minimized, so it won't be possible to formulate this in DCP. Commented Nov 21, 2023 at 21:08
• @whpowell96 Really thanks for the comment. It is a good option, but for my specific problem, the PSD matrix that to be optimized has nontrivial off-diagonal entries, so I don't think I can directly diagonalize here. Commented Nov 22, 2023 at 1:25
• @BrianBorchers Really thanks for the comment. Yes, unfortunately it's a nonconvex problem here. I was just trying my luck, maybe there are some tricks to approximate this nonconvex problem to convex that I just don't know. Right now, it seems I should try some nonconvex solver. Commented Nov 22, 2023 at 1:30
• What does it mean to "optimize" your matrix? You want to find the closest PSD matrix to some initial $P$ that satisfies $\|P\| = J$? It's not clear what properties an optimal solution to your problem should have Commented Nov 22, 2023 at 14:46

One solution to the problem is to choose $$P$$ as the diagonal matrix with diagonal entries equal to $$J/\sqrt{n}$$. Its Frobenius norm is $$J$$ and it is symmetric and positive definite.

• I suppose the real question is what extra conditions $P$ must satisfy to make this nontrivial. Should it be minimally distant from the some initial $P_0$? Otherwise you can just always choose a trivial solution. Commented Nov 21, 2023 at 17:25
• Really thanks for the answer. Yes, that will be great, but for my specific problem, I have a PSD with nontrivial offdiagonal entries. So, still thinking whether I can approximate this problem to be convex and solve it. Commented Nov 22, 2023 at 1:41