# Dual variable associated with a positive semidefinite constraint is not symmetric

I have the following problem:

`````` cvx_begin sdp
variable X(n,n);
dual variable Lambda;
dual variable gamma;

maximize trace(A*X)
X >= 0 : Lambda;
X(:) >= 0 : gamma;
(other conditions)
cvx_end
``````

The optimal value of the dual variable Lambda turns out to be not symmetric. It is blatantly so, not just within numerical errors. Shouldn’t the dual variable associated with a PSD constraint be itself PSD (and hence symmetric)?

Yes, it should be symmetric. What happens if you make `X` symmetric?

I would recommend filing a bug report to support@cvxr.com, but you’ll need to supply a full example model to reproduce the problem.

Thanks, adding symmetric fixed the issue.

OK, that’s good to know. It shouldn’t matter, but for some reason it does.

Sir please recommend me some good material to study about dual variables regarding lagrangian duality in cvx.

CVX calls primal-dual solvers. Upon solution, CVX has available the optimal dual values returned by the solver, which after any required inverse transformation to transform the problem provided by CVX to the solver back to the problem as input by the user, CVX populates the value of CVX-declared dual variables. That is all CVX is doing. If CVX were not transforming the problem at all before providing it to to the solver, CVX would be merely placing the optimall dual values returned by the solver into the dual variables declared in CVX.

If you want to better understand Lagrangian duality, at least in the context of convex optimization, then read and work the exercises in “Convex Optimization” by Boyd and Vandenberghe, http://web.stanford.edu/~boyd/cvxbook/