Hi,
I want to solve the following problem:
max x’Ax
s.t |x(i)| == 1; i = 1,…N.
Here, x is an Nx1 complex vector, and A is a PSD matrix.
This problem comes under non-convex problem.
So, the convex relaxation is:
max trace(XA)
s.t diag(X) == 1, X is SDP
This is what I’m doing:
clear;clc
N = 4;
A = randn(N,N)+1j*randn(N,N);
A = A*A’;
A = (A+A’)*0.5;
cvx_begin sdp
variable X(N,N) complex;
maximize real(trace(X*A));
subject to
X > hermitian_semidefinite(N);
diag(X) == ones(N,1);
cvx_end
However, I am getting the following error:
Unable to use a value of type struct as an index.
Error in cvxprob/solve (line 435)
[ x, status, tprec, iters ] = shim.solve( At, b, c, cones, quiet, prec, solv.settings, eargs{:} );
Error in cvx_end (line 88)
solve( prob );
Error in C2_Psi_CvXSolver (line 15)
cvx_end
Can you please help? I am new to CVX.
Thanks and regards
Kali