Encounter error "Invalid quadratic form(s): not a square." when trying to multiply variables

Hello, I have run into the error “Invalid quadratic form(s): not a square.” Here is my code:

1.cvx_begin quiet
2.   variable x
3.    variable y
4.    minimize (x^2+y^2-3*x*y)
5.    subject to
6.        x+y==1
7.cvx_end

8. for i=1:10
9.     cvx_begin quiet
10.     variable x1
11.     variable y1
12.     minimize (x1^2+y1^2-3*x*y-(grad([x;y])'*[x1;y1]+1/2*norm([x1;y1]*[x;y],2)^2))
13.     subject to 
14.         x1+y1==1
15.     cvx_end
16.     x=x1;
17.     y=y1;
18. end

19. fprintf('R=%.4f\n',cvx_optival)
20. fprintf('x=%.4f\n',x)
21. fprintf('y=%.4f\n',y)

error:

>> SCA_eg
Error using times>times_q (line 84)
Disciplined convex programming error:
    Invalid quadratic form(s): not a square.

Error in cvx_binary_op (line 107)

Error in  .*  (line 53)

Error in  *  (line 35)

Error in SCA_eg (line 4)
    minimize (x^2+y^2-3*x*y)

I would greatly appreciate your assistance in resolving this error.

You need to express that as a quadratic forum. If you do that, or just calculate the Hessian of x1^2+y1^2-4*x*y, you will see that the Hessian is indefinite, so that the expression is neither convex nor concave. Therefore it can’t be used in CVX.