Matlab cvx : Invalid quadratic form(s): not a square
But the result I want is a matrix, v*v’,where v’ is the ranspose matrix of v, sum_square caculate a value.
Reformulate
trace(Z'*H*v*v'*H'*Z)
as
square_pos(norm(v'*H'*Z,'fro'))
I don’t think you will need to bother with the real.
It will be real, according to math. Just do the Conjugate transpose of the formula in this picture, it will stay the same.
The output of norm will be real, with no possibility of roundoff level imaginary term. On the other hand, a Hermitian semidefinite quadratic form could potentially have a roundoff level imaginary term (which CVX might “object” to), especially if there are multiple non-parenthesized multiplications, even though in exact arithmetic, the imaginary component would be exactly zero.
If you have an expression which is real, except for roundoff level imaginary term, you can apply real to it. Or you can do something like X = W*V, u'*X'*X*u instead of u'*V'*W'*W*V*u or just u'*(W*V)'*(W*V)*u
But why are u'*H*v and v'*H'*u real (even if they were computed in exact arithmetic(, and therefore, why is MSE real?
Because if we conjugate transpose MSE, we can find the result eqaul to itself. if a+bi=(a+bi)’,b=0
(u’Hv)’=v’H’u, Their imaginary parts are offset when they are added。a+bi+a-bi=2a,so MSE is real. Is that right?


