optimizer with Hermitian sdpvars

26 views
Skip to first unread message

Alastair Abbott

unread,
Nov 21, 2019, 5:26:54 AM11/21/19
to YALMIP
Hi, 

As it stands, it seems that optimizer doesn't work with Hermitian parameters. As a trivial example:

a = sdpvar(2,2,'hermitian','complex');

optimizer([], trace(a), sdpsettings('solver','mosek'), a, trace(a))


which produces the error

Error using optimizer (line 98)
All parameter arguments have to be simple variables (i.e., not expressions such a+b or 1+a)

I find this a bit cryptic, but I guess the problem is the relation between the complex parts of the upper/lower parts of the matrix.

Is there a way to get around this or to support Hermitian parameters?

Best regards and thanks in advance,
Alastair.

Johan Löfberg

unread,
Nov 21, 2019, 12:32:33 PM11/21/19
to YALMIP
Nope, not possible. You would have to hack around that by using the unique elements in the real and complex part as the parameters

a = sdpvar(n,n,'hermitian','complex');

indR
=find(triu(ones(n)));
indI =find(triu(ones(n),1));

a_r
=real(a(indR));
a_i =imag(a(indI));



Reply all
Reply to author
Forward
0 new messages