Dealing with complex matrix, vector. CVX returns error msg

(Taewoong Lee) #1

Hi all,

I normally solve the below equation manually(eigenvalue problem) (using MATLAB).
Now I would like to use cvx, for further flexibility.

The equation which I am dealing with is as the below:

What I want to get is the optimal w_{opt} based on

Maximize w^HAw subject to k = w^HBw

where, k is scalar constant, w is complex vector, A, B are Hermitian matrix which means positive semidefinite. The size of A, B are both N \times N usually N < 50 .
I have read this The DCP ruleset. The DCP ruleset mentions that “a convex scalar quadratic form”.
Then, can’t this be solvable through cvx?

I typed in cvx as the below, cvx returns the error message.

>> A = "pre-calculated Hermitian matrix";, B = pre-calculated "Hermitian matrix";
>> cvx_begin sdp
>> variables wopt(10) complex

>> maximize( quad_form(wopt, A) )
Error using type
Too many output arguments.

Error in cvx_pushobj (line 64)
        cvx_dcp_error( type, 'unary', cvx_fastref( x, ~vx ) );

Error in maximize (line 15)
cvx_pushobj( 'maximize', x );

>> maximize( wopt'*A*wopt)
Error using  *  (line 155)
Disciplined convex programming error:
   Invalid quadratic form: not real.

>> quad_form(wopt,A)
ans = cvx: positive convex
>> quad_form(wopt,B)
ans = cvx: positive convex

I’ve tried the example, “closest_toeplitz_psd.m”, it works but the above does not work.

It seems that it is hard to find the relative topics with this, I post this.

Thank you in advance!

(Mark L. Stone) #2

I don’t know why the error is occurring, but you can reformulate, as discussed in .

Your constraint k = w'*B*w is non-convex and will not be accepted by CVX.

Note that you should have declared

variable wopt(10) complex

By usingvariables rather than variable you actually declared the real vector wopt and the real scalar complex

(Taewoong Lee) #3

Thank you for your answer!
I will try to re-formulate the above things. :slight_smile:

(Taewoong Lee) #4

Hi Mark,

After reading the link, I re-formulated the quadratic form using trace.
It seems that it worked, let me attached what I did.
It gives the same result with the eigenvalue problem.
$$ w^H Aw = \text{ trace}(w^H Aw) = \text{ trace}(Aww^H) \equiv \text{ trace}(AW) \text{,} $$

I converted the above equation into trace form.

    variable W(N,N) hermitian
    subject to
        trace(B*W) <= k;
    W == semidefinite(N,N);

However, I need to solve the eigenvalue problem about W.
Is there another way to get the w from W without using eigenvalue problem method?

Besides, the below also helped a lot. :slight_smile:

(Mark L. Stone) #5

I will leave it to Michael Grant (mcg) to offer you any further guidance on this.

(Michael C. Grant) #6

At this point is seems like we’re talking about general convex optimization modeling issues, better suited for a more general forum like Math StackExchange.

(Taewoong Lee) #7

Thank you Michael, I will post this issue on the Math StackExchange. :slight_smile: