How do i use the rel_entr fucntion correctly?

x*log(1+b/x) = -rel_entr(x,x+b)
so
-x*log(1+b/x) = rel_entr(x,x+b)
That explains all the phenomena you observed. Your 'switched" objective function was actually solving the problem you really wanted to solve.

You may also wish to read the beginning of CVXQUAD: How to use CVXQUAD's Pade Approximant instead of CVX's unreliable Successive Approximation for GP mode, log, exp, entr, rel_entr, kl_div, log_det, det_rootn, exponential cone. CVXQUAD's Quantum (Matrix) Entropy & Matrix Log related functions . for more reliable solution.

2 Likes