# Linear and Logarithmic Constraint in Semidefinite Programming

I am trying to minimize the largest component of a vector $$x = [x_1, x_2, x_3, x_4]$$, where $$x_1 \ge x_2 ... \ge x_4$$, such that it satisfies a set of linear inequalities $$A, b$$ in the following way:

$$Ax \le b.$$

Furthermore, I want that, the Shannon entropy of the vector $$x$$ satisfies the following:

$$-\sum_i x_i \log_2(x_i) = q,$$ for some constant $$q$$.

I can write the following for the first constraint:

cvx_begin sdp

variable x(4, 1)

minimize x(1)
subject to
A * x <= b

cvx_end


However, when I try to include the second constraint, like: quantum_entr(diag(x)) == q.

I get the following error:

Invalid constraint: {concave} == {real constant}


Is there a way to mix these two types of constraints in a semi-definite program? Thanks!

• Semidefinite programs have only linear and semidefinite constraints. I don't see any semidefinite constraints so I'm not quite sure why this is tagged as an SDP. Also cvx has a function for the shannon entropy entr(). Commented Oct 26, 2021 at 21:12
• I see, thanks Rammus. Is there a way around this? Commented Oct 26, 2021 at 21:18
• Secondly the error you are getting from CVX is telling you that a constraint $f(x) = c$ where $f$ is a concave function is not a valid constraint. It violates the DCP ruleset. Basically your problem is not guaranteed to be a convex optimization problem (and it probably isn't), so cvx can't help you. You can't have in general a convex/concave function equality constraint. For example, consider a constraint $x^2 = 1$, then the feasible set is $x = \{-1, +1\}$ which is not a convex set. Note however that $x^2 \leq 1$ does lead a convex set. Commented Oct 26, 2021 at 21:22
• You can relax your problem to $- \sum_i x_i \log x_i \geq q$ if you want to make it convex. Commented Oct 26, 2021 at 21:27
• Thanks a lot, Rammus. Let me try this. Commented Oct 26, 2021 at 21:28