# Convex approximation of an expression

I am trying to transform an expression given by

$$\operatorname{trace} \left( {\bf{X} } \right) + \left( \sum_{n=1}^N \mathcal{R}(x_n) \right)$$ into convex from where $$\mathbf{x}$$ is complex in nature, size (1,N).

• is that real part? What is the relation between $X$ and $x_n$? No one can help you id we don't' know what the expression is, including unstated relations between the symbols. Nov 7 at 21:01
• @Rodrigo de Azevedo you shared a related answer to above question, can you reshare ? 2 days ago

No approximation is needed if you wish to minimize the expression. For maximization, see the material after "Edit".

Due to cyclic permutation invariance of trace, $$\text{trace}(X) = \text{trace}(xx^H) = \text{trace}(x^Hx) = x^Hx$$ the latter two of which will be accepted by CVX, CVXPY, CVXR, and similar convex optimization tools.

Presuming you want to minimize the expression, the CVX code is:

cvx_begin
variable x(N) complex
minimize(x'*x + sum(real(x)))
cvx_end


If you wish to maximize the expression, that would be a non-convex problem. Per your comment, you do wish to maximize, so I am adding the contents of my first answer, which I had deleted.

EDIT: OP wants to maximize, per comment. So here is what can be done in that case.

A convex SDP relaxation can be used which will provide an upper bound on the optimal objective value of the original maximization problem.

Specifically, $$X = xx^H$$ is relaxed to $$X \succeq xx^H$$.

Here is CVX code for this.

cvx_begin sdp
variable X(N,N) hermitian
variable x(N) complex
maximize(trace(X) + sum(real(x)))
[X x;x' 1] >= 0

If the solution $$X$$ is rank one, the solution to the relaxed problem is optimal for the original problem. Otherwise, the optimal objective value of the relaxed problem only constitutes an upper bound for the optimal objective value of the original maximization problem.
• Using x by itself (as $x^Hx$( without X for the non-convex maximization problem; it is s non-convex; you can solve that, but not by convex optimization. if you do wish to use convex optimization, x by itself could be anything;l it is the relation to X which matters. and gives it any possible meaning. Nov 19 at 17:48
• x'*x <= a/b + sum(real(x)) )or whatever that last term is really meant to be. Dec 4 at 20:12
• $V$ is an expression built up out of variables. The relation between them is provided by the semidefinite constraint [X x;x' 1] >= 0. However, that is a relaxation of$X = xx^H$ and doesn't guarantee the solution will satisfy that equality, i.e., a rank one solution. 2 days ago