Currently you must embed complex variables in real variables, as shown here:
Could cvxopt adds complex variables directly now?
That's a good idea, but the main obstacle to adding complex variables is rewriting all the atoms to handle the complex case. It's not difficult, just time consuming.
The quantum information theory is complex, where SDP is very useful. It will be great if cvxopt supports the complex case.
@Edenharder In the meantime, you could try picos, which seems to support a bit more of the tools you need. In my opinion, it is not as beautiful as cvxpy, but maybe it will help for your case.
@sschnug I'll try. Thanks!
I second the wish for complex variables, it would be very helpful for SDPs in quantum information theory. In the meantime (for reference), I'm using the code
constraints = [
A_R == A_R.T,
A_I == -A_I.T,
cvxpy.vstack( cvxpy.hstack(A_R, -A_I), cvxpy.hstack(A_I, A_R) ) >> 0
to represent a positive semidefinite constraint on a complex Hermitian matrix A = A_R + 1j*A_I. This is because A>>0 if and only if [[Re(A), -Im(A)], [Im(A), Re(A)]] >> 0. Is there a better way to do this?
A = A_R + 1j*A_I
[[Re(A), -Im(A)], [Im(A), Re(A)]] >> 0
There isn't really a better way. You could create A_R as a Symmetric variable. That would reduce the number of variables. There's no anti-symmetric variable right now though. You could hack https://github.com/cvxgrp/cvxpy/blob/master/cvxpy/expressions/variables/symmetric.py to add anti-symmetric variables.
@phfaist @SteveDiamond Thanks! I make use of
A>>0 if and only if [[Re(A), -Im(A)], [Im(A), Re(A)]] >> 0
currently, but it's not beautiful and convenient to do this transformation for each question.
@SteveDiamond Ok, thanks for the tip!