How could one formulate the primal SDP for MaxCut in Mathematica.
I am aware of this tutorial using the dual:
https://www.wolfram.com/language/12/convex-optimization/max-cut-problem.html?product=mathematica
Thank you.
Edit to add further information:
What I tried (there LaplacianMatrix and e are functions from the dual example):
MCSDPPrimalValueAndMinimizer[graph_?GraphQ] := Module[{L = LaplacianMatrix[graph], n}, n = Dimensions[L][[1]]; Return[ SemidefiniteOptimization[-Tr[1/4 L . X], Join[Table[ Tr[e[i, n] . X] == 1, {i, 1, n}], {X \[VectorGreaterEqual] 0}], X \[Element] Matrices[{n, n}, Reals], {"PrimalMinimumValue", "PrimalMinimizer"}]]; ]; However, the values it returns are pretty off even for even order complete graphs --- they should match the optimal values of their maxcuts.