# Working examples for SemidefiniteOptimization

It appears to me that for some types of invocation, SemidefiniteOptimization is not working for matrices larger that 2x2.

An example from help that works

a0 = {{0, 1}, {1, 0}};
a1 = {{1, 0}, {0, 0}};
a2 = {{0, 0}, {0, 1}};

SemidefiniteOptimization[2 x1 + 3 x2,
VectorGreaterEqual[{a0 + a1*x1 + a2*x2, 0}, {"SemidefiniteCone", 2}], {x1, x2}]
(* {x1 -> 1.22474, x2 -> 0.816497} *)


An alternative syntax is also available and working:

SemidefiniteOptimization[{2, 3}, {a0, a1, a2}]
(* {1.22474, 0.816497} *)


I now try to extend this to a trivially equivalent problem using 3x3 matrices. It returns unevaluated:

b0 = {{0, 1, 0}, {1, 0, 0}, {0, 0, 1}};
b1 = {{1, 0, 0}, {0, 0, 0}, {0, 0, 0}};
b2 = {{0, 0, 0}, {0, 1, 0}, {0, 0, 0}};
SemidefiniteOptimization[2 x1 + 3 x2,
VectorGreaterEqual[{b0 + b1*x1 + b2*x2, 0}, "SemidefiniteCone", 2}],
{x1, x2, x3}]


In the alternative syntax, the expected result is returned

SemidefiniteOptimization[{2, 3}, {b0, b1, b2}]
(* {1.22474, 0.816497} *)


Is this assessment correct, or am I missing something?

Fixing the syntax error in the second argument

SemidefiniteOptimization[2 x1 + 3 x2,
VectorGreaterEqual[{b0 + b1*x1 + b2*x2, 0}, {"SemidefiniteCone", 3}],
{x1, x2}]


{x1 -> 1.22474, x2 -> 0.816497}

which matches the result from the alternative syntax:

SemidefiniteOptimization[{2, 3}, {b0, b1, b2}]


{1.22474, 0.816497}

• It is a little frustrating that Mathematica does not give warnings when given complex expressions that are syntactic nonsense. – mikado Aug 9 at 18:30