SumOfSquares.jl icon indicating copy to clipboard operation
SumOfSquares.jl copied to clipboard

Compatibility issue between SymbolicWedderburn with SumsOfSquares

Open kneshat opened this issue 1 year ago • 6 comments

Symmetry reduction does not work properly while doing SOS optimization. Here is a minimal example, which is similar to an example in the SumsOfSquares document. Here, I used poly = sum(x) + sum(x.^4) instead of poly = sum(x) + sum(x.^2)

import MutableArithmetics as MA
using MultivariatePolynomials
using MultivariateBases
using DynamicPolynomials
@polyvar x[1:3]
poly = sum(x) + sum(x.^4)
using PermutationGroups
G = PermGroup([perm"(1,2,3)",perm"(1,2)"])
import CSDP
solver = CSDP.Optimizer
model = Model(solver)
@variable(model, t)
@objective(model, Max, t)
pattern = Symmetry.Pattern(G, Symmetry.VariablePermutation())
con_ref = @constraint model poly - t in SOSCone() symmetry = pattern
optimize!(model)
value(t)

@kalmarek has checked the problem and said "Indeed this seems to be the problem with SumOfSquares.jl formulation, as SymbolicWedderburn.jl correctly reduces the optimization problem"

For more info: https://discourse.julialang.org/t/symmetry-reduction-in-sumsofsquares/115727

kneshat avatar Jun 21 '24 00:06 kneshat

Thanks, once https://github.com/jump-dev/SumOfSquares.jl/pull/355 is merged, I'll rework the symmetry reduction part and take a look that this example

blegat avatar Jun 21 '24 07:06 blegat

@Khashayar-Neshat until then, if all you want is to solve the optimization problem and get the optimal value you may use sos_problem (or a modification of it). The actual model is created here

kalmarek avatar Jun 22 '24 11:06 kalmarek

@blegat is there any change regarding this issue? I saw #355 was merged.

kneshat avatar Jul 26 '24 02:07 kneshat

Things were on hold while I was away for JuMP-dev and ISMP but we're working on it. We need to figure out what's the best way to do this now with the new StarAlgebras

blegat avatar Jul 30 '24 08:07 blegat

Do you happen to have any new updates? I am still not able to use symmetry reduction in SumOfSquares properly.

kneshat avatar Apr 16 '25 00:04 kneshat

We're finishing StarAlgebras right now https://github.com/JuliaAlgebra/StarAlgebras.jl/issues/63 Then we should be able to make a new release of SumOfSquares. I will then rework the symmetry reduction in SumOfSquares

blegat avatar Apr 16 '25 07:04 blegat