Log( {complex affine} )

Nonconvex
Apr 30, 2022
U

Assume I have a variable v \in \mathbb{C}^{N\times N}, defined as variable v(N,N) complex. Now, when I do log(1+v), in constraint/optimization problem, CVX says,

Disciplined convex programming error:
Illegal operation: log( {complex affine} ).

What is the possible cause of errors?

J

v is comlex affine, which is what you defined.

U
Replying to #2

even if I try with real(LHS)==real(RHS) in the constraint, the problem still exists, any suggestion, how to use log( {complex affine} ).

U
Replying to #2

Does it mean that CVX cannot support log( {complex affine} )?

J
Replying to #4

yes. please read CVX users’ guide

M

Further to @jackfsuia 's point:

help cvx\log

Disciplined convex programming information:
log(X) is concave and nondecreasing in X. When used in CVX
expressions, X must be concave.

Disciplined geometric programming information:
    log(X) is typically not used in geometric programs. Technically it
    possible to do so in certain advanced cases, because monomials and
    posynomials are treated by CVX as log-affine and log-convex
    constructs, respectively. However, such usage is undocumented and
    will not be officially supported.

A complex argument can’t be concave (or convex).

U
Replying to #6

Thanks, I have solved the complex affine issue.

(Although it is not related to the original question) Now it shows, Illegal operation: log( {convex} ).

I am trying to reformulate the constraint, do you think that 5.2.6 Log-sum-exp in https://docs.mosek.com/modeling-cookbook/expo.html would be an alternative?

M

You haven’t shown us the mathematical formulation of the optimization problem you want to solve.

U
Replying to #8

here it goes:

variable v(N,N) complex
variable t

minimize(t);
subject to
log(1+trace(abs(a*v))) >= inv_pos(t-b);

a and b are constant.

J
Replying to #9

log(1+trace(abs(a*v))) is neither convex nor convave, so it can’t be expressed by cvx

U
Replying to #10

By the way, could you please see this? Log( {convex} )

M

The problem in the link is different than yours.

U
Replying to #12

So, in your eyes, is this log(1+a*v) >= inv_pos(t-b) a non-convex?

M

Consider the real scalar case, with a = 1.

log(1+abs(v)) is not concave, as it would need to be in order for that constraint to be convex

The following example shown the non-concavity of log(1+abs(v)).

Let v1 = -1, v2 = 1. v3 = 0.5*(v1+v2).

Then log(1+abs(v3)) = log(1) = 0

0.5*log(1+abs(v1)) + 0.5*log(1+abs(v2)) = log(2) > log(1+abs(v3))

which shows log(1+abs(v)) is not concave.

U
Replying to #14

does it hold even if v is >=0 and \text{rank(v)} = 1?

M

If v is real and >= 0, then abs(v) can be replaced by v, and the LHS would be concave, making the constraint convex. The is because log(affne) is concave.

U
Replying to #16

yes, you are right. So, do you have any suggestion on how to express this?

log(1+a*v) >= inv_pos(t-b)

where v and t are real cvx variable and >=0.

M

CVX should accept that as is.

U
Replying to #18

I got the error as follows:

Error using cvx/log (line xx)
Disciplined convex programming error:
    Illegal operation: log( {convex} ).
M

if a is a double precision real number, and v is a CVX variable, CVX should accept log(1+a*v). It will not accept log(1+a*abs(v)) because abs(v) is convex.