# Why CVX 2.1 code cannot work in CVX 3.0？

(zy) #1

My CVX code is as follows:

``````function  etaa = OMA_itera_SumRate(BETAA, Gammaa, Phii, etaa_former, M, K, N, Pd)
cauy_former = etaa_former.^0.5;
Rate_former = OMA_conven_DL_CF_Rate( BETAA,Gammaa,Phii,etaa_former,M,K,N,Pd ) ;
SINR_former = 2.^Rate_former - 1;

a = zeros(K,1); % nominator of SINR
for k=1:K
a(k) = ( sum( cauy_former(:,k) .* (Gammaa(:,k).^0.5) ))^2;
end
b = a ./ SINR_former; % denominator of SINR

%% CVX
cvx_begin

variable t(K)
variable rou(K,K)
variable V(M) nonnegative
variable cauy(M,K)

sb1_left =  cvx(zeros(K,1));
sb1_right = cvx(zeros(K,1));
sb2_left =  cvx(zeros(M,1));
sb3_left =  cvx(zeros(K,K));

%% subject 1
for k=1:K
I = eye(K);
I(:,k)=[];
vk1 = (Phii'*Phii(:,k).*rou(:,k)).'*I;
vk2 = 1/(N^0.5) * ((BETAA(:,k).^(1/2)).*V).';
vk3 = 1/(Pd^0.5 * N);

W = [vk1 vk2 vk3];  %行向量

sb1_left(k) = SINR_former(k) / ( 1+SINR_former(k) ) / b(k) * sum(W .* W);

sb1_right(k) = log( 1 + SINR_former(k)) + SINR_former(k) / ( 1+SINR_former(k) ) *  ...
( 2 - sqrt(a(k)) * inv_pos( 2 * sum( cauy(:,k) .* (Gammaa(:,k).^0.5) )  - sqrt(a(k)) ) ) - t(k);
end

%% -----------------------------subject 2

for m=1:M
sb2_left(m) = norm(  cauy(m,:).' );
end

%% -----------------------------subject 3

for k=1:K
for kk=[1:k-1,k+1:K]
sb3_left(kk,k) = sum( (Gammaa(:,kk).^0.5) ./ BETAA(:,kk) .* cauy(:,kk) .* BETAA(:,k) );
end
end

maximize 1/log(2) * sum(t(:))

%% -----------------------------subject------------------------------
subject to

for k=1:K
sb1_left(k) - sb1_right(k) <= 0;
end

for m=1:M
sb2_left(m) - V(m) <=  0 ;
end

for k=1:K
for kk=[1:k-1,k+1:K]
sb3_left(kk,k) - rou(kk,k) <= 0;
end
end

for m=1:M  % 总功率约束
0 <= V(m) <= 1/sqrt(N);
end

for m=1:M
for k=1:K
-cauy(m,k) <= 0;
end
end

for k=1:K  % 引入的分母大于0
sum( cauy_former(:,k) .* (Gammaa(:,k).^0.5) ) - 2 * sum( cauy(:,k) .* (Gammaa(:,k).^0.5) ) <= 0;
end

cvx_end
etaa = cauy.^2;

end
``````

Since my code needs a few iterations to converge. I only give one iteration result:
When using CVX 3.0 and SDPT3:

``````Calling SDPT3 4.0: 5734 variables, 2478 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------

num. of constraints = 2478
dim. of socp   var  = 4374,   num. of socp blk  = 1218
dim. of linear var  = 1340
dim. of free   var  = 20
*** convert ublk to linear blk
********************************************************************************************
SDPT3: homogeneous self-dual path-following algorithms
********************************************************************************************
version  predcorr  gam  expon
NT      1      0.000   1
it pstep dstep pinfeas dinfeas  gap     mean(obj)    cputime    kap   tau    theta
--------------------------------------------------------------------------------------------
0|0.000|0.000|1.3e+03|6.2e+02|5.7e+17| 1.691623e+14| 0:0:00|5.7e+18|1.0e+00|1.0e+00| spchol
SMW too ill-conditioned, switch to LU factor, 2.5e+35.
switch to LU factor splu  1   1
1|0.000|0.000|1.3e+03|6.2e+02|5.7e+17| 1.643769e+14| 0:0:00|5.7e+18|1.0e+00|1.0e+00| splu  1   1
2|0.000|0.000|1.3e+03|6.2e+02|5.7e+17| 1.561949e+14| 0:0:00|5.7e+18|1.0e+00|1.0e+00| splu  1   1
3|0.000|0.000|1.3e+03|6.2e+02|5.7e+17| 1.228457e+14| 0:0:01|5.7e+18|1.0e+00|1.0e+00| splu  1   1
4|0.001|0.001|1.3e+03|6.2e+02|5.7e+17| 1.817396e+13| 0:0:01|5.6e+18|1.0e+00|1.0e+00| splu  1   1
5|0.004|0.004|1.3e+03|6.2e+02|5.8e+17|-2.958569e+14| 0:0:01|5.6e+18|1.0e+00|1.0e+00| splu  1   1
6|0.012|0.012|1.3e+03|6.2e+02|6.1e+17|-1.269515e+15| 0:0:01|5.6e+18|9.9e-01|9.9e-01| splu  1   1
7|0.036|0.036|1.3e+03|6.1e+02|6.9e+17|-4.058228e+15| 0:0:01|5.5e+18|9.8e-01|9.7e-01| splu  1   1
8|0.116|0.116|1.2e+03|5.9e+02|9.2e+17|-1.233647e+16| 0:0:01|5.0e+18|9.4e-01|9.0e-01| splu  1   1
9|0.314|0.314|1.0e+03|5.0e+02|1.3e+18|-3.109399e+16| 0:0:01|3.9e+18|8.6e-01|7.0e-01| splu  1   1
10|0.677|0.677|5.4e+02|2.6e+02|1.2e+18|-4.830574e+16| 0:0:01|1.7e+18|7.6e-01|3.2e-01| splu  1   1
11|0.955|0.955|3.7e+01|1.8e+01|1.2e+17|-6.825671e+15| 0:0:01|5.3e+16|7.7e-01|2.2e-02| splu  1   1
12|0.866|0.866|4.8e+00|2.3e+00|1.5e+16| 8.504199e+14| 0:0:01|1.0e+15|8.6e-01|3.2e-03| splu  1   1
13|0.867|0.867|6.4e-01|3.1e-01|1.8e+15| 3.426609e+14| 0:0:01|2.0e+13|9.6e-01|4.8e-04| splu  1   1
14|0.901|0.901|6.2e-02|3.0e-02|1.7e+14| 3.783320e+13| 0:0:02|1.0e+12|1.0e+00|4.9e-05| splu  1   1
15|0.863|0.863|1.7e-02|8.1e-03|6.2e+13| 1.295577e+13| 0:0:02|1.8e+11|1.0e+00|1.3e-05| splu  1   1
16|1.000|1.000|2.6e-03|1.7e-03|1.2e+13| 2.476994e+12| 0:0:02|1.3e+10|1.0e+00|2.0e-06| splu  1   1
17|0.932|0.932|2.1e-04|1.2e-03|1.0e+12| 1.992965e+11| 0:0:02|2.9e+09|1.0e+00|1.6e-07| splu  1   1
18|0.914|0.914|3.1e-05|9.1e-04|1.5e+11| 3.042284e+10| 0:0:02|4.2e+08|9.9e-01|2.4e-08| splu  1   1
19|0.976|0.976|2.9e-06|8.0e-04|1.4e+10| 2.925110e+09| 0:0:02|3.7e+07|9.9e-01|2.3e-09| splu  1   1
20|0.977|0.977|7.3e-08|7.1e-04|3.5e+08| 7.059321e+07| 0:0:02|3.2e+06|9.9e-01|5.6e-11| splu  1   1
21|0.801|0.801|2.8e-08|2.0e-04|1.4e+08| 2.709181e+07| 0:0:02|7.6e+05|9.7e-01|2.1e-11| splu  1   1
22|0.520|0.520|1.9e-08|9.9e-05|9.4e+07| 1.775422e+07| 0:0:03|3.9e+05|9.5e-01|1.4e-11| splu  1   1
23|0.467|0.467|2.0e-08|5.4e-05|6.5e+07| 1.195336e+07| 0:0:03|2.2e+05|9.4e-01|9.2e-12| splu  1   1
24|0.555|0.555|4.2e-08|2.4e-05|4.4e+07| 7.771764e+06| 0:0:03|1.1e+05|9.2e-01|5.9e-12| splu  1   1
25|0.467|0.467|1.1e-07|1.3e-05|3.1e+07| 5.337909e+06| 0:0:03|6.3e+04|9.1e-01|4.0e-12| splu  1   1
26|0.834|0.834|3.7e-07|2.2e-06|1.2e+07| 2.161637e+06| 0:0:03|1.5e+04|8.9e-01|1.6e-12| splu  1   1
27|0.771|0.771|9.6e-08|5.1e-07|4.3e+06| 7.458550e+05| 0:0:04|5.1e+03|8.9e-01|5.5e-13| splu  1   1
28|0.652|0.652|3.5e-08|1.8e-07|2.2e+06| 3.672824e+05| 0:0:04|2.2e+03|8.9e-01|2.7e-13| splu  1   1
29|0.924|0.924|2.8e-09|1.8e-08|2.9e+05| 4.452459e+04| 0:0:04|4.8e+02|8.9e-01|3.4e-14| splu  1   1
30|0.984|0.984|1.9e-09|4.5e-10|5.2e+03| 6.009354e+02| 0:0:04|5.1e+01|8.9e-01|5.6e-16| splu  1   1
31|0.885|0.885|2.5e-08|7.7e-11|6.6e+02| 3.630579e+01| 0:0:04|6.5e+00|9.0e-01|6.6e-17| splu  1   2
32|0.343|0.343|3.2e-07|7.3e-11|5.7e+02| 2.783975e+01| 0:0:04|4.3e+00|8.9e-01|5.4e-17| splu  2   2
33|0.572|0.572|3.7e-07|5.2e-11|3.7e+02| 1.024168e+01| 0:0:04|1.9e+00|8.9e-01|3.5e-17| splu  2   2
34|0.574|0.574|6.5e-07|3.2e-11|2.5e+02| 4.709546e-01| 0:0:05|8.5e-01|8.9e-01|2.3e-17| splu  2   2
35|0.733|0.733|1.0e-06|2.6e-11|1.3e+02|-8.352167e+00| 0:0:05|2.6e-01|8.9e-01|1.3e-17| splu  2   3
36|0.692|0.692|2.7e-06|2.2e-11|7.1e+01|-1.298662e+01| 0:0:05|9.4e-02|8.8e-01|7.0e-18| splu  3   4
37|0.656|0.656|1.8e-06|2.3e-11|4.0e+01|-1.532888e+01| 0:0:05|4.0e-02|8.8e-01|3.8e-18| splu  3   4
38|0.826|0.826|3.5e-07|2.3e-11|1.6e+01|-1.685203e+01| 0:0:05|1.2e-02|8.8e-01|1.7e-18| splu  4   3
39|0.842|0.842|1.2e-05|1.8e-11|6.5e+00|-1.741724e+01| 0:0:06|4.0e-03|8.8e-01|6.8e-19| splu  5   5
40|0.886|0.886|3.9e-05|1.8e-11|2.4e+00|-1.771171e+01| 0:0:06|1.4e-03|8.8e-01|2.6e-19| splu  5   7
41|0.934|0.934|5.1e-05|2.4e-11|8.5e-01|-1.791364e+01| 0:0:06|4.3e-04|8.8e-01|9.5e-20| splu ^ 8   8
42|0.953|0.953|5.2e-05|2.2e-11|2.1e-01|-1.816252e+01| 0:0:06|1.4e-04|8.8e-01|2.3e-20| splu  8  13
stop: X, Z not both positive definite
43|0.158|0.506|5.2e-05|2.2e-11|2.1e-01|-1.816252e+01| 0:0:06|1.4e-04|8.8e-01|2.3e-20|
-------------------------------------------------------------------
number of iterations   = 43
primal objective value = -1.85013768e+01
dual   objective value = -1.78236583e+01
gap := trace(XZ)       = 2.06e-01
relative gap           = 1.07e-02
actual relative gap    = -1.82e-02
rel. primal infeas     = 5.22e-05
rel. dual   infeas     = 2.24e-11
norm(X), norm(y), norm(Z) = 3.3e+12, 5.0e+05, 5.0e+05
norm(A), norm(b), norm(C) = 1.5e+03, 3.3e+12, 1.8e+01
Total CPU time (secs)  = 6.47
CPU time per iteration = 0.15
termination code       = -3
DIMACS: 5.2e-05  0.0e+00  2.2e-11  0.0e+00  -1.8e-02  5.5e-03
-------------------------------------------------------------------

------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN
``````

However, when I use CVX 2.1 and SDPT3 solver:

``````Calling SDPT3 4.0: 5752 variables, 2436 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------

num. of constraints = 2436
dim. of sdp    var  = 2376,   num. of sdp  blk  = 1188
dim. of socp   var  = 840,   num. of socp blk  = 40
dim. of linear var  = 1348
*******************************************************************
SDPT3: Infeasible path-following algorithms
*******************************************************************
version  predcorr  gam  expon  scale_data
HKM      1      0.000   1        0
it pstep dstep pinfeas dinfeas  gap      prim-obj      dual-obj    cputime
-------------------------------------------------------------------
0|0.000|0.000|1.2e+02|4.0e+01|4.9e+17| 8.104497e+14  0.000000e+00| 0:0:00| spchol  2  2
1|0.145|0.049|9.9e+01|3.8e+01|5.2e+17| 2.715423e+15 -7.314595e+14| 0:0:01| spchol  2  2
2|0.948|0.578|5.1e+00|1.6e+01|2.1e+17| 8.007610e+15 -5.024198e+15| 0:0:01| spchol  2  2
3|0.948|0.987|2.7e-01|3.2e-01|9.7e+15| 5.346625e+15 -5.253429e+14| 0:0:01| spchol  2  2
4|0.537|1.000|1.2e-01|6.3e-02|4.4e+15| 3.060982e+15 -6.128998e+14| 0:0:01| spchol  2  2
5|0.964|1.000|4.5e-03|3.1e-02|3.5e+14| 2.409214e+14 -7.318205e+13| 0:0:01| spchol  2  2
6|0.927|0.986|3.3e-04|1.7e-02|2.3e+13| 1.891615e+13 -6.967979e+11| 0:0:01| spchol  2  2
7|0.758|1.000|7.9e-05|7.9e-03|1.0e+13| 7.412725e+12 -1.761701e+12| 0:0:01| spchol  2  2
8|0.983|0.985|1.4e-06|4.0e-03|2.0e+11| 1.356173e+11  1.406349e+11| 0:0:01| spchol  2  2
9|0.634|1.000|5.0e-07|2.0e-03|9.0e+10| 6.569678e+10  7.182319e+10| 0:0:01| spchol  2  2
10|0.914|1.000|4.3e-08|9.8e-04|3.0e+10| 1.971580e+10  3.474824e+10| 0:0:01| spchol  2  2
11|0.902|0.986|4.2e-09|5.0e-04|2.3e+09| 1.911298e+09  2.171653e+10| 0:0:02| spchol  2  2
12|0.749|1.000|1.0e-09|2.4e-04|1.3e+09| 8.981232e+08  1.046914e+10| 0:0:02| spchol  2  2
13|0.952|0.984|5.1e-11|1.2e-04|5.7e+07| 4.472972e+07  5.462067e+09| 0:0:02| spchol  2  2
14|0.731|1.000|1.4e-11|6.1e-05|3.3e+07| 2.269493e+07  2.683394e+09| 0:0:02| spchol  2  2
15|0.921|0.993|1.1e-12|3.1e-05|2.5e+06| 2.054479e+06  1.354173e+09| 0:0:02| spchol  2  2
16|0.843|1.000|9.8e-13|1.5e-05|1.2e+06| 8.408977e+05  6.724280e+08| 0:0:02| spchol  2  2
17|0.883|1.000|3.2e-13|7.6e-06|1.7e+05| 1.396003e+05  3.363512e+08| 0:0:02| spchol  2  2
18|0.959|1.000|2.4e-12|3.8e-06|2.4e+04| 1.709653e+04  1.681815e+08| 0:0:02| spchol  2  2
19|0.963|0.983|5.3e-12|1.9e-06|8.5e+02| 6.321196e+02  8.552738e+07| 0:0:02| spchol  2  2
20|0.730|1.000|8.5e-11|1.8e-12|4.1e+02| 2.549828e+02 -1.127586e+02| 0:0:02| spchol  2  2
21|0.505|0.585|4.2e-11|1.1e-07|3.5e+02| 1.820902e+02  4.921447e+06| 0:0:02| spchol  2  2
22|0.943|0.956|1.0e-11|4.9e-09|1.5e+02| 6.426815e+01  2.141988e+05| 0:0:02|
lack of progress in infeas
-------------------------------------------------------------------
number of iterations   = 22
primal objective value =  6.32119593e+02
dual   objective value =  8.55273781e+07
gap := trace(XZ)       = 8.51e+02
relative gap           = 9.95e-06
actual relative gap    = -1.00e+00
rel. primal infeas (scaled problem)   = 5.31e-12
rel. dual     "        "       "      = 1.94e-06
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual     "        "       "      = 0.00e+00
norm(X), norm(y), norm(Z) = 3.0e+12, 8.1e+05, 8.1e+05
norm(A), norm(b), norm(C) = 5.9e+01, 3.0e+12, 3.6e+01
Total CPU time (secs)  = 2.31
CPU time per iteration = 0.11
termination code       =  0
DIMACS: 6.0e-11  0.0e+00  3.5e-05  0.0e+00  -1.0e+00  9.9e-06
-------------------------------------------------------------------

------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +8.55274e+07
``````

What it is so and how to deal with this?

In addition, since the scale of the problem is large, I also considered the SCS solver for CVX 3.0. However, it still doesnot work:

``````Calling SCS 2.0.2: 5746 variables, 2482 equality constraints
For improved efficiency, SCS is solving the dual problem.
------------------------------------------------------------
WARN: A->p (column pointers) not strictly increasing, column 0 empty
ERROR: A->p (column pointers) decreasing
invalid linear system input data
ERROR: Validation returned failure
Failure:could not initialize work
------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN``````

(Mark L. Stone) #2

CVX 3.0beta has numerous serious bugs. Therefore, we can’t be confident the solver is being provided the correct problem formulation by CVX 3.0beta. There are numerous example of problems run under CVX 3.0beta in which the solver and CVX declared optimality, but the solution clearly violated one or more constraints in the problem (I’m not talking about solutions which are within solver tolerance of being feasible). Use ECOS under CVX3.0beta only if you like failure or getting the wrong answer.

I have no idea whether that is happening in your case.

Use CVX 3.0beta at your own peril.

(zy) #3

Thanks Stone. I have been using CVX 2.1 all the time. However, the large scale of my problem takes a long time to determine, even one day. Hence I installed SCS solver. The SCS solver only is accepted by CVX 3.0. Thanks for your advice.

(Mark L. Stone) #4

You should expewct SCS to be much slower than second order solvers such as Mosek, SDPT3, and SeDuMii. The only reasons to use SCS would be1) if you don;t have enough memory to run a second order solve, i.e., a large problem or 2) to use native exponential cone capability of SCS.

What are the iterations you are referring to?

(zy) #5

Thanks for your answer. You are right, my program involves log(cvx_expression). It is hard to find a global optimal solution since it is nonconvex. I used the sequential convex approximation (SCA) to find a sub-optimal solution. It needs a few iteration to converge. I have already installed CVXQUAD, and the result is obtained by using CVXQUAD.

(Mark L. Stone) #6

Note: CVX 3.0beta is not really recommended to anyone due to its numerous bugs. It is strongly recommended to not use CVXQUAD with CVX 3.0beta. Please use CVX 2.1 instead.

Even if it ran correctly, SCS will be much slower than SDPT3 or SeDuMi.

(zy) #7

You mentiond the output, I also think it is weird. However, When I run this program multiple times, there will always be a large output. Please see:

``````Calling SDPT3 4.0: 3112 variables, 1284 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------

num. of constraints = 1284
dim. of sdp    var  = 1216,   num. of sdp  blk  = 608
dim. of socp   var  = 520,   num. of socp blk  = 40
dim. of linear var  = 768
*******************************************************************
SDPT3: Infeasible path-following algorithms
*******************************************************************
version  predcorr  gam  expon  scale_data
HKM      1      0.000   1        0
it pstep dstep pinfeas dinfeas  gap      prim-obj      dual-obj    cputime
-------------------------------------------------------------------
0|0.000|0.000|7.6e+01|3.2e+01|8.4e+17| 2.392294e+15  0.000000e+00| 0:0:00| spchol  2  2
1|0.237|0.080|5.8e+01|3.0e+01|9.2e+17| 7.613543e+15 -1.580352e+15| 0:0:00| spchol  2  2
2|0.763|0.708|1.4e+01|8.8e+00|3.5e+17| 1.673233e+16 -1.036945e+16| 0:0:00| spchol  2  2
3|0.944|0.911|7.8e-01|8.9e-01|5.6e+16| 1.614821e+16 -7.587125e+15| 0:0:01| spchol  2  2
4|0.898|0.893|7.9e-02|1.5e-01|9.1e+15| 4.451670e+15 -1.375918e+15| 0:0:01| spchol  2  2
5|0.730|1.000|2.1e-02|3.1e-02|4.7e+15| 2.966150e+15 -1.206454e+15| 0:0:01| spchol  2  2
6|0.949|0.950|1.1e-03|2.1e-02|6.0e+14| 3.794632e+14 -1.723338e+14| 0:0:01| spchol  2  2
7|0.958|1.000|4.6e-05|8.0e-03|1.2e+14| 8.412482e+13 -3.526067e+13| 0:0:01| spchol  2  2
8|0.956|0.952|2.0e-06|4.1e-03|2.6e+13| 1.683833e+13 -7.656260e+12| 0:0:01| spchol  2  2
9|0.878|1.000|2.5e-07|2.0e-03|4.9e+12| 3.787868e+12 -7.802017e+11| 0:0:01| spchol  2  2
10|0.766|0.989|5.8e-08|9.9e-04|2.0e+12| 1.557089e+12 -3.379577e+11| 0:0:01| spchol  2  2
11|0.948|1.000|3.0e-09|4.9e-04|2.5e+11| 1.908371e+11 -1.000599e+10| 0:0:01| spchol  2  2
12|0.902|0.992|2.9e-10|2.5e-04|4.1e+10| 3.242019e+10  1.584304e+10| 0:0:01| spchol  2  2
13|0.776|1.000|6.5e-11|1.2e-04|1.6e+10| 1.218296e+10  8.591759e+09| 0:0:01| spchol  2  2
14|0.950|0.938|3.2e-12|6.5e-05|1.7e+09| 1.147032e+09  5.778794e+09| 0:0:01| spchol  2  2
15|0.816|1.000|6.0e-13|3.1e-05|6.8e+08| 4.942068e+08  2.766821e+09| 0:0:01| spchol  2  2
16|0.924|0.976|4.6e-14|1.6e-05|9.2e+07| 6.925850e+07  1.480842e+09| 0:0:01| spchol  2  2
17|0.860|1.000|2.8e-14|7.6e-06|2.4e+07| 1.816064e+07  7.275704e+08| 0:0:01| spchol  2  2
18|0.877|0.982|3.8e-14|3.9e-06|6.4e+06| 4.863165e+06  3.712833e+08| 0:0:01| spchol  2  2
19|0.912|0.993|9.0e-14|1.9e-06|8.4e+05| 6.803954e+05  1.842802e+08| 0:0:01| spchol  2  2
20|0.954|1.000|8.1e-13|1.9e-07|2.5e+05| 1.771776e+05  1.823998e+07| 0:0:01| spchol  2  2
21|0.952|0.939|1.5e-13|3.0e-08|2.6e+04| 1.703298e+04  2.827859e+06| 0:0:01| spchol  2  2
22|0.959|1.000|2.7e-13|2.4e-09|5.6e+03| 3.779837e+03  1.814047e+05| 0:0:01| spchol  2  2
23|0.953|1.000|5.2e-14|4.0e-09|1.9e+03| 1.186766e+03  1.766519e+04| 0:0:01| spchol  2  2
24|0.949|1.000|1.2e-14|1.8e-08|7.2e+02| 3.847381e+02  1.566441e+03| 0:0:01| spchol  2  2
25|1.000|1.000|2.4e-15|2.1e-12|2.9e+02| 1.208085e+02  4.196885e+01| 0:0:01| spchol  2  2
26|0.984|0.877|6.3e-16|5.4e-13|1.3e+02| 2.444593e+01 -4.928760e+01| 0:0:01| spchol  2  2
27|1.000|0.938|3.1e-16|1.0e-13|5.3e+01|-1.090574e+01 -5.424652e+01| 0:0:01| spchol  2  2
28|1.000|1.000|1.8e-16|2.0e-14|2.0e+01|-2.709181e+01 -4.509241e+01| 0:0:01| spchol  2  2
29|1.000|0.962|1.9e-16|8.2e-15|7.8e+00|-3.334692e+01 -4.036626e+01| 0:0:01| spchol  2  2
30|0.972|1.000|1.6e-16|3.0e-15|3.2e+00|-3.550440e+01 -3.843061e+01| 0:0:02| spchol  2  2
31|1.000|1.000|2.0e-16|1.1e-15|1.1e+00|-3.654109e+01 -3.756140e+01| 0:0:02| spchol  2  2
32|0.967|1.000|1.9e-16|2.9e-16|2.6e-01|-3.694995e+01 -3.718478e+01| 0:0:02| spchol  2  2
33|1.000|1.000|3.2e-16|7.1e-17|8.7e-02|-3.703727e+01 -3.711651e+01| 0:0:02| spchol  2  2
34|0.979|0.973|4.4e-16|1.9e-17|1.5e-02|-3.707098e+01 -3.708469e+01| 0:0:02| spchol  2  2
35|1.000|1.000|6.0e-16|1.0e-17|6.4e-03|-3.707494e+01 -3.708075e+01| 0:0:02| spchol  2  2
36|0.941|0.939|7.4e-16|1.0e-17|7.4e-04|-3.707757e+01 -3.707821e+01| 0:0:02| spchol  2  2
37|1.000|1.000|8.8e-16|1.0e-17|2.4e-04|-3.707778e+01 -3.707800e+01| 0:0:02| spchol  2  2
38|1.000|0.996|1.1e-15|1.1e-17|3.1e-05|-3.707788e+01 -3.707791e+01| 0:0:02|
stop: max(relative gap, infeasibilities) < 1.35e-06
-------------------------------------------------------------------
number of iterations   = 38
primal objective value = -3.70778778e+01
dual   objective value = -3.70779055e+01
gap := trace(XZ)       = 3.06e-05
relative gap           = 4.08e-07
actual relative gap    = 3.70e-07
rel. primal infeas (scaled problem)   = 1.12e-15
rel. dual     "        "       "      = 1.11e-17
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual     "        "       "      = 0.00e+00
norm(X), norm(y), norm(Z) = 1.3e+13, 5.8e+07, 5.8e+07
norm(A), norm(b), norm(C) = 4.5e+01, 1.3e+13, 2.6e+01
Total CPU time (secs)  = 1.78
CPU time per iteration = 0.05
termination code       =  0
DIMACS: 1.1e-14  0.0e+00  1.4e-16  0.0e+00  3.7e-07  4.1e-07
-------------------------------------------------------------------

------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +24.104``````

(Mark L. Stone) #8

I don;t understand what you find weird. What are you trying to bring to my attention?

(zy) #9

Nothing. Thank you for solving my previous confusion, thank you！

(Mark L. Stone) #10

Did your program, exactly as shown, run and produce that output using CVXQUAD? As far as I know, explicit use of log will not result in CVXQUAD’s Pade approximation being used instead of CVX’s successive approximation method. Did you actually run different code, using either `-rel_entr(1,cvx_expression)` or adding a variable and using explicit exponential cone construct?

(zy) #11

Sorry, Mark. You are right. I think CVXQUAD is not worked in my program. I will reinstall CVXQUAD and check the result again.

(Mark L. Stone) #12

Follow the instructions in CVXQUAD: How to use CVXQUAD's Pade Approximant instead of CVX's unreliable Successive Approximation for GP mode, log, exp, entr, rel_entr, kl_div, log_det, det_rootn, exponential cone. CVXQUAD's Quantum (Matrix) Entropy & Matrix Log related functions including the required reformulation of your program, which is quite simple for log.