Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual variables are complex conjugated #1375

Closed
araujoms opened this issue Feb 29, 2024 · 2 comments · Fixed by jump-dev/JuMP.jl#3748
Closed

Dual variables are complex conjugated #1375

araujoms opened this issue Feb 29, 2024 · 2 comments · Fixed by jump-dev/JuMP.jl#3748

Comments

@araujoms
Copy link
Contributor

When I ask YALMIP to give me the dual variables, it gives me instead their complex conjugate. Below is a MWE with an SDP for calculating the least eigenvalue:

function test_duality(d)
    x = randn(d,d) + 1i*randn(d,d);
    x = x + x';
    lambda = sdpvar;
    constraints = [(x + lambda*eye(d) >= 0):'PPT'];
    ops = sdpsettings(sdpsettings,'verbose',1,'solver','sedumi');
    optimize(constraints,lambda,ops)
    lambda = value(lambda);
    W = dual(constraints('PPT'));
    trace(W*x) %wrong answer
    trace(W.'*x) %right answer
end
@johanlofberg
Copy link
Member

Hmm, I'll have a look

@araujoms
Copy link
Contributor Author

araujoms commented Mar 5, 2024

I've investigated a bit, and it seems that YALMIP reports correctly the dual variable that is returned by SeDuMi; it is when YALMIP is reading user input and sending it to SeDuMi in the first place that the complex conjugation must be happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants