Convex optimization with cvxopt in python with complex coefficients

I am trying to solve the problem of convex optimization, where the coefficients can be complicated. The native implementation in cvxopt QP does not seem to support this. I always get the following error:

TypeError: 'q' must be a single column 'd' matrix

Here is a sample code.

Q = 2*cvxopt.matrix([ [2, .5], [.5, 1] ])
p = cvxopt.matrix([(1.0+1.0j), (1.0+2.0j)])
G = cvxopt.matrix([[-1.0,0.0],[0.0,-1.0]])
h = cvxopt.matrix([0.0,0.0])
A = cvxopt.matrix([1.0, 1.0], (1,2))
b = cvxopt.matrix(1.0)
sol=cvxopt.solvers.qp(Q, p, G, h, A, b)

Could there be a workaround to solve this problem? Thanks

+4
source share

Source: https://habr.com/ru/post/1614303/