# Real valued SDP and complex-valued SDP

Hi,
I encountered a strange problem in using cvx to solve the following standard SDP.

\min_{\mathbf{X}} \mathrm{trace}\{\mathbf{AX}\}\\ \mathrm{st.} \\ \mathrm{diag}\{\mathbf{X}\}=\mathbf{1}.\\ \mathbf{X}\;\mathrm{is\;positive\;semidefinite}

\mathbf{A} is positive semidefinite, and \mathbf{A} and \mathbf{X} are both complex.

In my first toy example, the solver gives one result which completely ignores the imaginary part. The solution is Z=[1,-1; -1, 1], and the objective function is 1.82.

close all
clear all
clc
j=sqrt(-1);
A=[1.01, 0.1+0.1j; 0.1-0.1j, 1.01];

L=chol(A); % A=L'*L
cvx_begin sdp
variable Z(2,2) Hermitian;
Z_R=real(Z);
Z_I=imag(Z);
minimize trace(L*Z*L')
subject to
for n=1:2
Z(n,n)==1;
end
Z==semidefinite(2);
cvx_end


In my second toy example, the solution now has imaginary parts. The solution is
Z=[1.0000 , -0.7071 - 0.7071i; -0.7071 + 0.7071i, 1.0000], and the objective function is 1.73.

close all
clear all
clc
j=sqrt(-1);
A=[1.01, 0.1+0.1j; 0.1-0.1j, 1.01];

A_R=real(A);
A_I=imag(A);
A_tilde=[A_R, -A_I; A_I, A_R];

cvx_begin
variable Z_R(2,2) symmetric;
variable Z_I(2,2) skew_symmetric;
expression Z_tilde(4,4);
Z_tilde=[Z_R, -Z_I; Z_I, Z_R];
minimize trace(A_tilde*Z_tilde)
subject to
for n=1:2
Z_R(n,n)==1;
end
Z_tilde==semidefinite(4);
cvx_end
Z=Z_R+j*Z_I;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I am very confused about the results. Aren’t these two formulations equivalent? Why do they generate different solutions? Can anyone help me out? Thank you.

semidefinite(n) generates a real semidefinite variable. That means that in your first example, Z is being forced to be real. That is probably not what you intended. I suspect that you want to specify ‘hermitian_semidefinite(n)’ in the first problem.

Thank you very much! Everything now works perfectly as it should. Thanks again for your time and patience.