Help needed to better formulate a convex optimization problem in CVX

I am interested in using CVX to solve a quadratically constrained program which has just arisen in my work. I think I have got CVX to solve the optimization problem correctly, after following the quickstart guide. However,
CVX is spending too much time (about 100 seconds) analyzing the constraints of the problem before passing it onto MOSEK, which requires only 8 seconds to solve the program.

I would like to know a better way to rewrite my problem in the CVX framework so that MOSEK can be called immediately after declaring the program.

My optimization problem has the following 2T+1 unknowns, where T, a constant, is ~16000:
$$\beta = (\lambda_{r1}, \ldots, \lambda_{rT}, \lambda_{s1}, \ldots, \lambda_{sT}, z)$$

My optimization problem is

                      min z

subject to
A_r \lambda_r − A_s\lambda_s = b_r
A_s \lambda_r + A_r \lambda_s = b_s
0 \leq z
and

\forall 1\leq j \leq T

\lambda_{rj}^2 + \lambda_{sj}^2 - z \leq 0
| \lambda_{rj} | \leq 1 and | \lambda_{sj} | \leq 1

In the above program, A_r and A_s are pre-computed dense constant matrices of dimensions 2 \times T and b_r and b_s are constant vectors of size 2\times 1.

I am not sure if this is helpful, but the quadratic constraints can be written as β^t P_j β −z ≤ 0, where P_j is a (2T + 1) matrix of zeroes with its (j,j) th and (T +j,T +j) th entry being 1, which means that the P_j matrix is positive semidefinite. Since all these quadratic constraints are
sparse, can we rewrite the code below to “directly” indicate to CVX the
structure of the problem?

The CVX code that I am using (and would like to speed up) is as follows.

cvx_solver mosek
cvx_begin 
    variable lambda_r(T)
    variable lambda_s(T)
    variable z
    
    minimize( z )
    
    subject to
       
        -1*ones(T,1) <= lambda_r <= ones(T,1);
        -1*ones(T,1) <= lambda_s <= ones(T,1);
                  0  <= z;
         A_r*lambda_r - A_s*lambda_s == b_r;
         A_s*lambda_r + A_r*lambda_s == b_s;
                           
         lambda_r.^2 + lambda_s.^2 - z*ones(T,1) <= 0;
cvx_end

I am using CVX Version 2.1 on a Windows 7 machine.

Actually, it looks like your model is naturally expressed with complex values, where \lambda \triangleq \lambda_r + i \lambda_s. I would suggest something like this:

cvx_begin
    variables lambda(T) complex
    minimize( norm(lambda,Inf) )
    norm([real(lambda);imag(lambda)],Inf) <= 1;
    ( A_r + 1j * A_s ) * lambda == b_r + 1j * b_s;
cvx_end

Even if you don’t adopt this change completely, some notes about your model:

  • You never need to use the ones(T,1) trick as you have in your code. CVX does scalar-to-vector broadcasting just like MATLAB does; so, for instance, lambda_r <= 1 generates T inequalities automatically.
  • There’s no need to linearize the objective yourself. Let CVX handle things like that.
  • z >= 0 is redundant, as other constraints ensure it is nonnegative.

I’m not sure if this will help, but give it a shot.