-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Add HermitianPSDCone #3109
Add HermitianPSDCone #3109
Conversation
Codecov ReportBase: 97.65% // Head: 97.68% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #3109 +/- ##
==========================================
+ Coverage 97.65% 97.68% +0.03%
==========================================
Files 33 33
Lines 4383 4442 +59
==========================================
+ Hits 4280 4339 +59
Misses 103 103
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
Is that the model that was tested with ComplexOptInterface ? |
Almost, that model was a non-convex QCQP. To make it an SDP you need to lift the voltage variable products into a matrix put PSD on that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice enough for now. Users might be a bit confused with the real(H[1, 1])
name. It looks like a function call, not the string name. Potentially real_H[1, 1]
and imag_H[1, 1]
? Or re_H[1, 1]
and im_H[1, 1]
?
The advantage with this name is that it corresponds exactly to what you would get by typing |
As discussed on the monthly meeting, we should add a page to the manual in the docs explaining all quirks of the complex support in JuMP.
Potentially also deal with complex equality constraints, but that might be a separate PR, or in the AC-OPF case. |
527fedd
to
9ca399f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably easiest if we leave the docs for a separate PR.
test/variable.jl
Outdated
@test sprint(show, x[1, 1]) == "_[1]" | ||
@test sprint(show, x[1, 2]) == "_[2] + (0.0 + 1.0im) _[4]" | ||
@test sprint(show, x[2, 1]) == "_[2] + (-0.0 - 1.0im) _[4]" | ||
@test sprint(show, x[2, 2]) == "_[3]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the printing. How's this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's better
This is also not quite right, because it returns an affine expression, not the variable. Moreover julia> imag(H[1, 2])
0 real(H[1,2]) + imag(H[1,2])
julia> real(H[1, 2])
real(H[1,2]) + 0 imag(H[1,2]) |
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
8f90a8c
to
a16e521
Compare
Yes, we could smoothen that path in future PRs |
It now throws errors in case the |
This PR makes it possible to create Hermitian PSD matrix of variable.
The point of argument is going to be how to handle the keyword arguments of
@variable
. This PR does the following:binary
is true for any entry, throw an error.fixed_value
,start
,lower_bound
andupper_bound
should correspond to entries of hermitian matrices. We interpret the real (resp. imaginary) part as the corresponding value for the real (resp. imaginary) variable created. IIRC @mlubin was worried that it would be confusing, e.g., thatlower_bound = 1 + 2im
would be interpreted as a lower bound of1
for the real part and a lower bound of2
for the imaginary part. As a related note, @ccoffrin was asking for@constraint(model, x + y * im .<= 1 + 2im)
to be interpreted as@constraint(model, x <= 1)
and@constraint(model, y <= 2)
.integer
means that both the real and imaginary parts areinteger
. Maybe we should just error here ?