I'm running into an issue enforcing a particular constraint on the variables of a SemidefiniteOptimization problem (I'm using Mathematica 12.3).

Specifically, it seems that if a matrix $A$ and a vector $u$ are variables, one cannot directly enforce the constraint $A \geq u u^T$:

A = {{a[1, 1], a[1, 2]}, {a[1, 2], a[2, 2]}};
U = {{u[1]}, {u[2]}};
SemidefiniteOptimization[a[1, 1] + 2 a[1, 2] + a[2, 2],
   {VectorGreaterEqual[{A, U.Transpose[U]}, {"SemidefiniteCone", 2}], 
    u[1] - u[2] == 1}, {a[1, 1], a[1, 2], a[2, 2], u[1], u[2]}]

results in an error "SemidefiniteOptimization::ctuc: The curvature (convexity or concavity) of the term {u[1]^2,u[1] u[2]} in the constraint ... could not be determined."

This particular issue can be remedied by an equivalent formulation, notably

$$ A \geq u u^T \quad \text{if and only if} \quad \begin{pmatrix} A & u \\ u^T & 1 \end{pmatrix} \geq 0. \qquad (*) $$ For example,

soln = SemidefiniteOptimization[a[1, 1] + 2 a[1, 2] + a[2, 2],
   {VectorGreaterEqual[{ArrayFlatten[{{A, U}, {Transpose[U],1}}], 0}, {"SemidefiniteCone", 3}], 
   u[1] - u[2] == 1}, {a[1, 1], a[1, 2], a[2, 2], u[1], u[2]}];
(* succeeds *)
Eigenvalues[A - U . Transpose[U] /. soln]
(* {20.2665, -4.84524*10^-10}, i.e., A >= U U^T upto numerical errors *)

In my application, the constraint I want to impose is actually $A \leq uu^T$. Trying the direct method results in a similar error message about being unable to determine the nature of the constraint.

Can anyone provide guidance on how to coax Mathematica's SemidefiniteOptimization routine to be able to enforce this constraint more directly? Any insights from the community here would be much appreciated.

  • $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. $\endgroup$
    – bbgodfrey
    Jul 30, 2021 at 4:24

1 Answer 1


The constraint $A \leq u u^T$ is non-convex in the variables $A$ and $u$. As such, the goal of the posted question is not possible: non-convex constraints cannot be straightforwardly applied to semidefinite programming.

(This is quite obvious to me now, but didn't occur to me on the day of posting this question. I'm posting this answer-in-the-negative in the case it might be helpful to others down the line.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.