jump-dev / Convex.jl

A Julia package for disciplined convex programming
https://jump.dev/Convex.jl/stable/
Other
572 stars 123 forks source link

Error Using the Nuclear Norm #701

Closed RoyiAvital closed 2 months ago

RoyiAvital commented 2 months ago

A simple problem:

using Convex;
using ECOS;

numRows = 200; #<! Matrix A
numCols = 4;  #<! Matrix A

mA = rand(numRows, numCols);
λ    = 0.5;

mF = Variable(2, 2);
sConvProb = minimize( Convex.sumsquares(mA * Convex.vec(mF)) + λ * Convex.nuclearnorm(mF) );
solve!(sConvProb, ECOS.Optimizer; silent = true);

I get the error:

ERROR: MathOptInterface.UnsupportedConstraint{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.NormNuclearCone}: `MathOptInterface.VectorAffineFunction{Float64}`-in-`MathOptInterface.NormNuclearCone` constraint is not supported by the model.

On Julia 1.10.4, Convex.jl 0.16.2 on Windows.

odow commented 2 months ago

ECOS does not support problems with the nuclear norm cone. Try a different solver, like Clarabel.jl.

odow commented 2 months ago

Closing because this is expected behavior and not a bug in Convex.jl

RoyiAvital commented 2 months ago

OK, Good to know. So maybe the error should be different? As the current error doesn't give such hint to the user.

odow commented 2 months ago

We should fix the error in https://github.com/jump-dev/MathOptInterface.jl/issues/2528