Using Julia to solve semidefinite programming problem that has vector solutions

Hi everyone! I need to use Julia to solve a SDP. What would you suggest to use to solve the SDP?

I tried Convex and JuMP with ProxSDP, I couldn’t get it to work.

Hi @cheng_chen.

You can make it easier to help by reading the first post of PSA: make it easier to help you.

For a list of solvers that support SDP, check Installation Guide · JuMP.

ProxSDP should work. What was the error you encountered?

Otherwise, you could try a solver like SCS:

import Pkg; Pkg.add("SCS")
using JuMP, SCS
model = Model(SCS.Optimizer)
@variable(model, X[1:2, 1:2], PSD)

Hello @odow,

thank you for your reply!
My code looks like this:

@odow the error is :

Your objective is a matrix. You probably want to use convert it to a scalar using sum(X) or LinearAlgebra.tr(X).

There are also some issues with your constraints. (You need to use vectorized algebra: Constraints · JuMP).

Here are some PSD examples that might be helpful:
https://jump.dev/JuMP.jl/dev/examples/cluster/
https://jump.dev/JuMP.jl/dev/examples/min_distortion/

I would encourage you to re-read the PSA I linked. Instead of posting screenshots, post code that people can copy-paste. You should also provide all data needed to run the code.

2 Likes

Thank you!
I am sorry, it’s my first time posting. I will make sure that I follow the guidelines in the future

1 Like

No problem. Please post back if you still have trouble after reviewing the examples and the documentation.

1 Like