-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
Fix querying dual of symmetric equality constraints #3797
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3797 +/- ##
==========================================
+ Coverage 98.39% 98.40% +0.01%
==========================================
Files 44 44
Lines 5907 5956 +49
==========================================
+ Hits 5812 5861 +49
Misses 95 95 ☔ View full report in Codecov by Sentry. |
Okay, this looks like the problem. We never had any tests for this. |
You can use |
I don't think so, or at least, not for Or we need a new matrix shape just for these Matrix-in-Zeros constraints. |
Yes, maybe we need to do that. I'm in favor |
Name suggestions for the primal and dual shapes?
|
Okay, instead of adding more shapes, I've added |
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 agree a keyword argument is simpler
I'm afraid this PR introduced a bug: before if I tried to constrain using JuMP
using LinearAlgebra
import Hypatia
import Clarabel
import Ket
import Random
function dual_test(d)
Random.seed!(1)
ρ = Ket.random_state(Float64, d^2, 1)
model = Model()
@variable(model, σ[1:d^2, 1:d^2] in PSDCone())
@variable(model, λ)
noisy_state = Hermitian(ρ + λ * I(d^2))
@constraint(model, witness_constraint, σ == noisy_state)
@objective(model, Min, λ)
@constraint(model, Ket.partial_transpose(σ, 2, [d, d]) in PSDCone())
set_optimizer(model, Hypatia.Optimizer)
#set_optimizer(model, Clarabel.Optimizer)
optimize!(model)
W = dual(witness_constraint)
return W
end |
Oops, can you open an issue so that we can track this ? |
No, now it silently succeeds 😄 |
Closes #3796
I need to think about whether there is a better option. I don't think we should just fix the default
reshape_vector
because we don't need to modify anything for the primal? Just the dual?