# Complex Product Inside A Convex Function

So the problem I want to solve has a constraint that does not conform to the requirements. In the below, x,s,\bar{x},\bar{s}\in\mathbb{C}^N, \alpha,\beta\in\mathbb{R}, and A\in\mathbb{C}^{M\times N}

\min_{x,s}{ \left \Vert \left[ \begin{array}{c} x \\ s \end{array} \right] - \left[ \begin{array}{c} \bar{x} \\ \bar{s} \end{array} \right] \right \Vert_2^2 } \;\;\; \mathrm{s.t.} \;\;\; s^H x = 1 \,\,\, \wedge \Vert x \Vert_2 < \alpha \wedge \Vert Ax \Vert_\infty < \beta

The documentation makes clear that the s^H x = 1 constraint is not valid, so I’m trying to get around this by including it in the cost function. Since the sum of two convex functions is again convex, it seems that I should be able to do this:

\min_{x,s}{ \left\lbrace \left \Vert \left[ \begin{array}{c} x \\ s \end{array} \right] - \left[ \begin{array}{c} \bar{x} \\ \bar{s} \end{array} \right] \right \Vert_2^2 + \Vert s^H x - 1 \Vert_2^2 \right\rbrace } \;\;\; \mathrm{s.t.} \;\;\; \Vert x \Vert_2 < \alpha \wedge \Vert Ax \Vert_\infty < \beta

I try to formulate the above in CVX syntax like so:

  cvx_begin
variable x(M) complex
variable s(M) complex
minimize( pow_pos(norm([ x; s ]-[xbar; sbar], 2), 2) + pow_pos(norm( s'*x - 1, 2),2) )
subject to
norm( x, 2 ) <= 10.^(delta/10);
norm( A * x, inf ) <= pmax;
cvx_end


However, I keep getting the following error due to the s'*x part of the cost function:

Disciplined convex programming error:
Invalid quadratic form: product is complex.


I don’t see anything in the DCP rules set that should rule the above out. Moreover, the term norm([] - []) involves a complex term, so it seems like it’s just the product of two complex variables that is not allowed even though it’s part of a real, convex expression. Moreover, if I change the product within the second norm to x'*s*s'*x, I get the same error even though the product is strictly real.

Any help is greatly appreciated.

Yes, the rule against multiplying variables is the relevant DCP rule. In fact, your problem doesn’t just violate the rules, it is not convex. Your claim that it is convex is incorrect—in either form.

@mcg I’m sorry if this is obvious, but how is the sum of 2-norms-squared not convex? ||x||^2 is convex and the sum of convex functions is convex, so I don’t see where the error is.

The product of two variables s_i\cdot x_i, whether they are real or complex, is neither convex nor concave. That ruins the lot. You can’t “bring back” convexity by wrapping it in a convex function.

@mcg Sorry about that. I bet you wish you had a nickel for every time you’ve had to correct someone that their problem was indeed not convex. I’ll try to be more diligent in the future.

For your own sake, please do! CVX is frustrating to use if you don’t have a firm grasp of the rules. It’s a different way of thinking about the task of modeling.