Sir,

I am debugging my code, kindly help

A=rand(2,2)+1i * rand(2,2);

B=5;

cvx_begin

variable x nonnegative;

variable y(2,2) complex semidefinite;

obj= -rel_entr(x, x+B * trace(A * y))/log(2);

maximize obj;

subject to

x <= 1;

trace(A * y) <= 5;

cvx_end

Optim_val=obj;

This code is giving me an error :

Error using cvx/rel_entr (line 71)

Disciplined convex programming error:

Illegal operation: rel_entr( {real affine}, {complex affine} ).

Error in CVX_debug_trace_mul (line 9)

obj=-rel_entr(x,x+B*trace(A*y))/log(2); %x*log2(1+a*Trace(b*y)/x), a and b are constants

In this case :

cvx_begin

variable x(2) nonnegative;

variable t(2) nonnegative

variable y(2,2) semidefinite;

obj=-rel_entr(t(2,1),t(2,1)+B * trace(A * y))/log(2);

maximize obj;

subject to

t(1,1)+t(2,1) <= 1;

x(1,1)+x(2,1)<=trace(A * y);

cvx_end

The code is not giving any error but status is Failed.

In my code, A is a complex double matrix. What can be done in this regard? Kindly do needful.

Thank you.