# CVX Invalid quadratic form(s): not a square

Hi, can you help me for the following question?

When I use CVX to solve the following problem, I encounter the following question:

``````R_min=1;
M=1;
K=1;
Nt=4;
eta=1;
psi_s=0.001;
psi_e_k=0.001;
P_In_m=0.01;
P_th=1;
sigma_s=10^(-5);
sigma_e=10^(-5);
sigma_p_s=10^(-7);
N=1000;
power=1;
h=wgn(Nt,1, power,'linear','complex');
g=wgn(Nt,1, power,'linear','complex');
xi_e_k=0.1*mean((abs(g)).^2);
q=wgn(Nt,1, power,'linear','complex');
xi_p_m=0.1*mean((abs(q)).^2);

beta=1.0001;
cvx_begin SDP
variable W(4,4)  complex semidefinite;
variable Si(4,4) complex semidefinite;
variable rho(1)  nonnegative;
variable omega(1)  nonnegative;
variable a(1) nonnegative;
variable lambda(1) nonnegative;
minimize(trace(W+Si));
subject to
[omega*eye(Nt)-(W-(beta-1)*Si) -(W-(beta-1)*Si)*g;-g'*(W-(beta-1)*Si) (beta-1)*sigma_e-g'*(W-(beta-1)*Si)*g-omega*xi_e_k]==semidefinite(Nt+1);
[a*eye(Nt)+(W+Si)  (W+Si)*g; g'*(W+Si) g'*(W+Si)*g+sigma_e-psi_e_k*(eta^(-1))-a*xi_e_k]==semidefinite(Nt+1);
[lambda*eye(Nt)-(W+Si) -(W+Si)*q; -q'*(W+Si) P_In_m-q'*(W+Si)*q-lambda*xi_p_m]==semidefinite(Nt+1);
rho*trace(W+(1-(2^R_min)*beta)*Si)+(1-(2^R_min)*beta)*(rho*sigma_s+sigma_p_s)>=0
(1-rho)*eta*(trace((W+Si)*h*h')+sigma_s)>=psi_s;
trace(W+Si)<=Pth;
0<rho<1;
cvx_end
``````

The constraints:

``````(1-rho)*eta*(trace((W+Si)*h*h')+sigma_s)>=psi_s;
trace(W+Si)<=Pth;
``````

Error using . (line 262)*
Disciplined convex programming error:
** Invalid quadratic form(s): not a square.**

can you help me?

Thanks

Thanks, I have solved the problem with your help.

Thanks very much