Get the constraints matrix from a SDP relaxation

hello everyone :slight_smile:
I am using Julia, and I am programming some SDP. For this, I use JuMP to prepare the problem, then Hypatia to solve it. But, after the constraints are cleaned (by Hypatia), I would like to get the matrix of all constraints of the solver.

My setup looks like this:

model = Model( Hypatia.Optimizer)
@variable( model , ... )
@constraint( model , ... )
@objective( model , ... )

optimize!(model)
# 1243 of 2511 primal equality constraints are dependent
# get the matrix of the processed constraints

I found this object : backend(model).optimizer.model.optimizer.solver.
but after there are so many variables, I don’t know which variable is the one I am looking for ! I don’t know neither if it is in the list !
Is there a way to retrieve the constraint matrix that Hypatia uses internally?
Thanks a lot :slight_smile:
Gustave

I’m not sure if there is an easy way to get this from Hypatia.

You can get the Hypatia.Optimizer object with unsafe_backend(model). It has the .solver field.

Perhaps take a look at the fields of unsafe_backend(model).solver.model. But I don’t think there’s an easy way to convert this back to JuMP.

Finally I get the raw constraints, then I process them by myself. Are you interessed in the code ? ChatGPT helped me a bit :slight_smile:
Thanks for your answer :slight_smile:

1 Like

Only if the code is simple. It might be useful to someone else in the future :smile: