Equality Constraints with zero


#1

Hello,

I have the following:

variable B(M,M) hermitian semidefinite
and
A is an M X N complex matrix, N < M (A is a constant matrix)

The constraint A’BA == 0 throws the error
"Error using * Inner matrix dimensions must agree."

On the other hand, the following constraints are OK:
A’BA == 1e-200
A’B == 0
BA == 0
trace(A’BA) == 0
log_det(A’BA) >= a (a is some positive constant)

Any idea why CVX does not like the first constraint?

CVX Version 2.1, Build 1116
Matlab 2016b

Thanks


(Mark L. Stone) #2

It works for me, i.e., with no error message. Note: use of 1e-200 (use either 0 or a much larger number) may not be such a great idea, if you were trying to use it for real, which I guess you are not.

Please provide a complete reproducible example starting from a clean MATLAB session. And use the Preformatted text for your code so that there will be no doubt that what is shown is what you ran.

This executes without error message. Try copy and pasting it into a clean MATLAB session.

M=5; N=3; A=rand(M,N)+1i*randn(M,N);
cvx_begin
variable B(M,M) hermitian semidefinite
A'*B*A == 0
cvx_end

#3

Thank you for your response!
Your code is working fine.
However, the following one (Note the log_det(.)):

    M = 10;
    N = 3;
    A = randn(M,N) + 1i*randn(M,N);

    cvx_begin
    cvx_solver Mosek
    variable B(M,M) hermitian semidefinite

    subject to
    A'*B*A == 0;
    log_det(eye(M)+B) >= 2;    % I added eye(M) to make the argument full rank
    cvx_end

throws the following error (after a clean start of Matlab)

Error using  * 
Inner matrix dimensions must agree.

Error in cvxprob/eliminate (line 137)
            P       = P * cvx_invert_structure( xR );

Error in cvxprob/solve (line 18)
[ At, cones, sgn, Q, P, dualized ] = eliminate( prob, true, shim.dualize );

Error in cvx_end (line 88)
        solve( prob );

Error in untitled (line 15)
cvx_end

However, after running the code for a second time (without restarting Matlab), it gives the error

Undefined function or variable 'last_act'.

Error in cvxprob/solve (line 348)
            if ~found && last_solved == solved && last_act == nact,

Error in cvx_end (line 88)
        solve( prob );

Error in untitled (line 15)
cvx_end

I omitted the “Successive approximation” warning from both error messages.


(Mark L. Stone) #4

Perhaps that’s a bug in CVX 2.1.

In CVX 3.0 beta, I get

Homogeneous problem detected; solution determined analytically.
Status: Solved
Optimal value (cvx_optval): +0

with the solution B being the matrix of all zeros, which does not satisfy log_det(eye(M)+B) >= 2
CVX3.0 beta is known to have bugs, and this appears to be one (or more).

You will have to wait for someone else to come along who can further investigate.


#5

Do you mean that, with CVX 3 (beta), you get the all-zero solution and it does ignore the log_det() constraint?


(Mark L. Stone) #6

Yes, that’s what I mean.


#7

OK, thanks for the heads up!
For now, I will stick to CVX 2.1 and replace 0 with a small constant.