NCTSSOS aims to provide a user-friendly and efficient tool for solving optimization problems with non-commutative/trace/state polynomials, which is based on the structured moment-SOHS hierarchy. To use NCTSSOS in Julia, run
pkg> add https://github.com/wangjie212/NCTSSOS
Documentation |
---|
NCTSSOS has been tested on Ubuntu and Windows.
Taking
using NCTSSOS
using DynamicPolynomials
@ncpolyvar x[1:3]
f = 1 + x[1]^4 + x[2]^4 + x[3]^4 + x[1]*x[2] + x[2]*x[1] + x[2]*x[3] + x[3]*x[2]
opt,data = nctssos_first(f, x, obj="eigen")
To sovle higher steps of the NCTSSOS hierarchy, repeatedly run
opt,data = nctssos_higher!(data)
Options:
obj: "eigen" by default (perform eigenvalue minimization), "trace" (perform trace minimization)
TS: "block" by default (maximal chordal extension), "MD" (approximately smallest chordal extension), false (invalidating term sparsity iterations)
Taking the objective
@ncpolyvar x[1:2]
f = 2 - x[1]^2 + x[1]*x[2]^2*x[1] - x[2]^2
ineq = [4 - x[1]^2 - x[2]^2]
eq = [x[1]*x[2] + x[2]*x[1] - 2]
pop = [f; ineq; eq]
d = 2 # set the relaxation order
opt,data = nctssos_first(pop, x, d, numeq=1, obj="eigen")
To solve higher steps of the NCTSSOS hierarchy, repeatedly run
opt,data = nctssos_higher!(data)
Options:
obj: "eigen" by default (perform eigenvalue minimization), "trace" (perform trace minimization)
TS: "block" by default (maximal chordal extension), "MD" (approximately smallest chordal extension), false (invalidating term sparsity iterations)
To exploit correlative sparsity and term sparsity simultaneously, run
opt,data = cs_nctssos_first(pop, x, d, obj="eigen")
opt,data = cs_nctssos_higher!(data)
Check out /examples/traceopt.jl.
Check out /examples/stateopt.jl for state polynomial optimization over real numbers and /examples/state_complex.jl for state polynomial optimization over complex numbers.
[1] Exploiting Term Sparsity in Noncommutative Polynomial Optimization, 2021.
[2] Sparse polynomial optimization: theory and practice, 2023.
[3] State polynomials: positivity, optimization and nonlinear Bell inequalities, 2023.