I haven’t looked very carefully at what you’ve done, but fix all of this first. Read Why isn't CVX accepting my model? READ THIS FIRST! .Read the CVX Uers’ Guide. And learn some convex optimization and SDP theory by reading and solving exercises in at least the first 5 chapters of https://web.stanford.edu/~boyd/cvxbook/ .
You can declare V as complex semidefinite, and then not need the ==semidefinite
real(diag(V) <= 1
is simpler and a little faster than using the for loop.
If you are doing a semidefinite relaxation V >= v*v', that should be entered as
[V v;v' 1] == semidefinite(size(V,1)+1)
without ever forming v*v'. The semidefinite constraint is used instead of V = v*v', not in addition to it.
You will need to declare v as a complex vector. if v is the exponential of something else, and that’s what goes in the semidefinite relaxation constraint, that would not be accepted by CVX die to not being affine - but I’m still confused what you’re doing, so I’ll let you straigthen everything out. There may be plenty of other stuff which is wrong and doesn’t make sense.