 # Convex constraint

(Mariam) #1

I am new to the cvx part of programming. While using the CVX tool I have placed a constraint as `trace(A*B*A^H)<=1`, the error message I am getting is

Invalid constraint: {complex affine} <= {real constant}
Error in <= (line 21)
b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘[]’ ), x, y, ‘<=’ );
Can someone help me out on the correct way to do this programming.

(Mark L. Stone) #3

http://cvxr.com/cvx/doc/dcp.html#constraints

One or both sides of an equality constraint may be complex; inequality constraints, on the other hand, must be real.

Without seeing your code and data, I can’t make a definitive diagnosis. But it must be the case that `trace(A*B*A^H)` has some imaginary component, even though it may be just due to roundoff. First of all, there is no such thing in MATLAB or CVX as `^H` to denote hemnitian transpose. So I will assume that you actually used `A`'. Has `B` been declared to be hemnitian? If not, then `trace(A*B*A')` will not be real.

If you actually did use `trace(A*B*A^H)`, then presumably `H` was previously set in your MATLAB session to be some real or complex number, and `A*H` would be the matrix `A` raised to the power `H`, which surely is not what you want.

If `B` is declared hernitian and `trace(A*B*A') <= 1` produces an error message, then roundoff level imaginary component and the error can be eliminated using `real(trace(A*B*A')) <= 1`