Transmit beamforming based on cvx

I write a program about the transmit beamforming by the cvx, but many papers said that the relaxed problem is dual to the original problem, so that the rank of the weight matrix is 1, but my result is not, the next is my codes, is it right?

cvx_begin
    variable W(nTx,nTx,mRx) complex semidefinite;
    sum = 0;
    for i = 1:mRx
        sum = sum + trace(W(:,:,i));
    end
    minimize ( sum );
    subject to  
    for i = 1:mRx
        ip = 0;
        sp = trace(R(:,:,i)*W(:,:,i)); 
        for j = 1:i-1
            ip = ip + trace(R(:,:,i)*W(:,:,j));
        end
        for j = i+1:mRx
            ip = ip + trace(R(:,:,i)*W(:,:,j));
        end
        sp - gamma(i)*ip >= gamma(i)*sigma(i);
        %W(:,:,i) == semidefinite(nTx);
    end
cvx_end

It is a rare case when you can guarantee the relaxed problem obtains the same optimal value as the original nonconvex problem. It happens, but not often. I suspect you are reading the papers’ claims incorrectly. Regardless, this really is not a CVX-specific question, so you should ask the authors.

Thank you mcg!
In my opinin,the operateor “trace” should be “normal” ?
By the way,I copy code to Matalb find it doesn’t work——“Disciplined convex programming error: Cannot minimize a(n) complex affine expression.”

No, it should be trace. And you can probably fix your error with minimize(real(sum)). The trace is real anyway for complex semidefinite variables.

The thing is that rank-1 weight matrix is only one of the available solutions. So even if your code is correct you have to find a way to specify the rank of W.

Right, and rank cannot be bounded or fixed in a convex program.

I have implemented the same problem in CVX and it gives almost always the rank one solution.

I implemented the same problem and the solver gives the rank-1 solution almost always.