Error while solving OP with constraint

I am using the following code to solve an OP:-

n = 16;
variable y(4,4)
minimize(norm(A * y( : ) - B))
subject to:
sqrt(diag(y))*sqrt(diag(y))’ == y

I am getting the following error:-
Disciplined convex programming error:
Cannot perform the operation {concave}*{concave}

I think the way I have specified the constraint isn’t correct. Is there some syntax fault? (I have used this constraint so that my matrix y has rank 1.)
Thank you in advance.

Okay I get it now. But I have noticed that even if I remove the constraint and define y as a vector instead of a matrix, the vector y that I obtain after using cvx is different than the one that i get by using y=A\ B in MATLAB, i.e by using backslash operator I obtain vector y with complex numbers as elements while as after cvx i get only real part of y. Which one should I need to consider as my solution?