Using division in CVX

hr=abs((randn+1i*randn)/sqrt(2))^2;
hd=abs((randn+1i*randn)/sqrt(2))^2;
G=abs((randn+1i*randn)/sqrt(2))^2;
cvx_begin 
variables P1 P2
maximize P1*G+(hr*P1*hd*P2)/(hr*P1+hd*P2+1)
subject to
P1+P2==2;
P1>=0;
P2>=0;
cvx_end

Disciplined convex programming error:
Invalid quadratic form(s): not a square.
maximize P1G+(hrP1hdP2)/(hrP1+hdP2+1)
Question: This is a concave function. Why can’t we solve it directly?

The objective function is not a concave function.

Adapt the approach in section 4.3.2 “Linear-fractional programming” of https://web.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf

You are right. The objective function is not concave. Through the calculation of Hessian matrix, the positive and negative of the matrix are uncertain. Is there any good way to turn it into a convex optimization problem?

Follow the advice in my previous post.

Thanks a lot! I will see previous Post to find the problem solutions.