# This linear matrix inequality appears to be unsymmetric

Hi,

I’m trying to implement the following code and I get the following warning for each of the inequality constraints of the CVX:
This linear matrix inequality appears to be unsymmetric. This is
very likely an error that will produce unexpected results. Please check
the LMI; and, if necessary, re-enter the model.

I would really appreciate if anybody has a solution for this.

The Matalb code is:

`````` w=[0.15 -0.45];
theta=sin([20  -30]/180*pi)*pi;
alpha=[1 1]*(1+1j)/sqrt(2);
K=length(alpha);
N=64;
Mt=8;
Mr=8;
A=exp(1j*(0:Mr-1).'*theta);
B=diag(alpha);
At=exp(1j*dt*(0:Mt-1).'*theta);
D=exp(1j*(0:N-1).'*w);
Atd=1j*At*dt.*(0:Mt-1).';
Dd=1j*D.*(0:N-1).';
IN=eye(N);
cvx_begin sdp
variable  C(Mt,Mt,N)  hermitian;
for k=1:N
diag(C(:,:,k))== 1;
C(:,:,k) == semidefinite(Mt,Mt)
end
Ct=zeros(N*Mr, N*Mr);
for k=1:N
Ct=Ct+kron(C(:,:,k),IN(:,k)*IN(:,k).');
end

VHV=KR(At,D)'*Ct*KR(At,D);
VHVtheta=KR(At,D)'*Ct*KR(Atd,D);
VthetaHVtheta=KR(Atd,D)'*Ct*KR(Atd,D);
VHVw=KR(At,D)'*Ct*KR(At,Dd);
VthetaHVw=KR(Atd,D)'*Ct*KR(At,Dd);
VwHVw=KR(At,Dd)'*Ct*KR(At,Dd);
VthetaHV=KR(Atd,D)'*Ct*KR(At,D);

FF22=(A'*A).*(B'*VwHVw*B);
FF23=(A'*A).*(B'*VHVw');
FF33=(A'*A).*(VHV);

expression F(4*K,4*K)
F=[real(FF11)    real(FF12)    real(FF13) -imag(FF13);...
real(FF12).'  real(FF22)    real(FF23) -imag(FF23);...
real(FF13).'  real(FF23).'  real(FF33) -imag(FF33);...
-imag(FF13).' -imag(FF23).' -imag(FF33).' real(FF33)];

minimize trace_inv(F)
cvx_end``````

You haven’t provided a reproducible problem because not all the input data has been provided (dt, KR, and whatever else).

Nevertheless, this error should not occur for the only LMI I see in the program:
`C(:,:,k) == semidefinite(Mt,Mt)`
You could actually just use `variable C(Mt,Mt,N) hermitian semidefinite` instead.

The warning message could be coming from `trace_inv(F)`. `F` needs to be symmetric. I’ll let you carefully check to see why it apparently is not. Are the block diagonal entries in F all symmetric? (they need to be) - I’ll let you check. Hopefully you can diagnose now that you’ve been tipped off to the possible cause.

help trace_inv

trace_inv Trace of the inverse of a PSD matrix.
For square matrix X, trace_inv(X) is TRACE(INV(X)) if X is Hermitian
or symmetric and positive definite; and +Inf otherwise.

``````  An error results if X is not a square matrix.

Disciplined convex programming information:
trace_inv is convex and nonmonotonic (at least with respect to
elementwise comparison), so its argument must be affine.``````