SOS+SONC Relaxations¶
The module sosonc.py implements the SOS+SONC two-step optimization
framework from Moritz Schick’s PhD thesis (Sums of squares plus sums of
nonnegative circuit polynomials, Universität Konstanz). It provides combined
SOS+SONC lower bounds for unconstrained polynomial optimization, translating
Schick’s MATLAB toolbox to Python and integrating it into the Irene framework.
Theory¶
The SOS+SONC Cone \(\Sigma + C\)¶
Let \(\Sigma_{n,2d}\) denote the cone of sums of squares (SOS) of polynomials in \(n\) variables of degree at most \(2d\), and let \(C_{n,2d}\) denote the cone of sums of nonnegative circuit polynomials (SONC) of the same degree bound. Both cones are proper subsets of the PSD cone, and neither contains the other in general (see Corollary 6.14 of the companion manuscript on mean polynomials).
The Minkowski sum
is a natural certificate family that strictly contains both SOS and SONC. For an unconstrained polynomial optimization problem
the SOS+SONC relaxation computes
Because \(\Sigma \subseteq \Sigma + C\) and \(C \subseteq \Sigma + C\), we always have
Two-Step Preprocessing (Algorithms 4 & 5)¶
Schick’s thesis introduces two complementary strategies that avoid solving the full SDP-plus-exponential-cone feasibility problem.
Algorithm 4 — SOS-first (SOS preprocessing \rightarrow SONC relaxation)
Find \(g^* \in \Sigma_{n,2d}\) minimising a convex distance \(\varphi(f, g^*)\) (e.g., the \(\ell_2\)-norm of the coefficient vector of \(f - g^*\)). The intuition is to “cover” as much of \(f\) as possible with an SOS certificate, leaving a residual that is well-suited for SONC.
Solve the SONC relaxation for the residual \(h = f - g^*\), obtaining \(\mu^* = h_C^* = \sup\{\mu \mid h - \mu \in C\}\).
The combined lower bound is
\[f_{\Sigma+C}^* \geq \mu^*,\]with the decomposition \(f - \mu^* = g^* + (h - \mu^*) \in \Sigma + C\).
Algorithm 5 — SONC-first (SONC preprocessing \rightarrow SOS relaxation)
The roles of SOS and SONC are swapped: first find \(g^* \in C\) minimising \(\psi(f, g^*)\), then solve the SOS relaxation on \(h = f - g^*\).
Computational Complexity¶
Pure SOS: semidefinite programming — \(O(n^{6r})\) in the Lasserre relaxation order \(r\).
Pure SONC: signomial geometric programming — polynomial-time per sequential GP iteration. Very fast for ST-polynomials; insensitive to degree increases.
SOS+SONC (two-step): the cost of one SDP plus one signomial program. The preprocessing overhead is minimal.
When SOS is infeasible (the polynomial is not SOS), the SOS-first two-step falls back to pure SONC, guaranteeing at least the SONC bound. Symmetrically for the SONC-first variant.
Implementation in Irene¶
The central class is SOSONCRelaxations.
- class Irene.sosonc.SOSONCRelaxations(prog: OptimizationProblem, **kwargs)[source]
Combined SOS+SONC relaxation framework.
Implements the algorithms from Schick’s SOS+SONC toolbox:
globalMinSOS– pure SOS relaxation (SDP via Gram matrix)globalMinSONC– pure SONC relaxation (signomial GP)globalMinSOSPSONC– two-step SOS+SONC (Algorithms 4 & 5)
- Parameters:
prog (OptimizationProblem) – An Irene
OptimizationProblemwith an objective set viaprog.Minimize(f). Constraints are optional.error_bound (float) – Numerical zero tolerance (default
1e-10).verbosity (int) – Log level (0 = silent, 1 = verbose; default 1).
solver (str) – SDP solver name forwarded to
SDPRelaxations('cvxopt','csdp','sdpa','dsdp').use_local_solve (bool) – Use signomial GP local solve for the SONC portion (default
True).relaxation_order (int) – Relaxation order for SDP (default
1, i.e., the first Lasserre moment relaxation).
- globalMinSONC() SOSONCRelaxSol[source]
Compute a lower bound using the SONC relaxation.
Solves \(\sup\{\lambda : f - \lambda \in C\}\) via a signomial geometric program using Irene’s
SONCRelaxations.- Return type:
- globalMinSOS() SOSONCRelaxSol[source]
Compute a lower bound using the SOS relaxation.
Solves \(\sup\{\lambda : f - \lambda \in \Sigma\}\) via a Gram-matrix SDP using Irene’s
SDPRelaxations.- Return type:
- globalMinSOSPSONC(first: str = 'sos') SOSONCRelaxSol[source]
Two-step SOS+SONC lower bound (Algorithms 4 & 5).
- Parameters:
first (str) –
'sos'(Algorithm 4: SOS preprocess, then SONC) or'sonc'(Algorithm 5: SONC preprocess, then SOS).- Returns:
Lower bound \(f_{\\Sigma + C}^*\) together with decomposed certificate.
- Return type:
Constructor¶
from Irene.sosonc import SOSONCRelaxations
from Irene.program import OptimizationProblem
engine = SOSONCRelaxations(
prog, # OptimizationProblem instance
error_bound=1e-10,
verbosity=1,
solver='cvxopt', # SDP solver
use_local_solve=True, # signomial GP local solve
relaxation_order=1, # Lasserre relaxation order
)
Detailed Method Reference¶
globalMinSOS()Computes \(\lambda^* = \sup\{\lambda \mid f - \lambda \in \Sigma\}\) by wrapping
SDPRelaxations. Uses a Gram-matrix SDP via the selected solver (CVXOPT, CSDP, SDPA, or DSDP).Returns
SOSONCRelaxSolwith.val,.status,.error_code, and.runtime.globalMinSONC()Computes \(\lambda^* = \sup\{\lambda \mid f - \lambda \in C\}\) by wrapping
SONCRelaxations. Uses signomial geometric programming via GPkit with the CVXOPT backend.Returns
SOSONCRelaxSol.globalMinSOSPSONC()Implements the two-step SOS+SONC lower bound.
first='sos'\rightarrow Algorithm 4 (SOS preprocessing \rightarrow SONC residual)first='sonc'\rightarrow Algorithm 5 (SONC preprocessing \rightarrow SOS residual)
The residual \(h = f - \lambda^*\) is constructed by shifting the constant term of the
SemigroupAlgebraElement. If residual construction fails, the method falls back to \(\max\{\lambda_{\text{SOS}}, \lambda_{\text{SONC}}\}\).
Result Container¶
- class Irene.sosonc.SOSONCRelaxSol[source]
Carries optimisation results for SOS+SONC relaxations.
- val
Optimal \(\lambda^*\), a lower bound on \(f^*\).
- Type:
- method
'sos','sonc','sos-first', or'sonc-first'.- Type:
- f_sos
SOS summand of
f - val(if applicable).- Type:
optional
- f_sonc
SONC summand of
f - val(if applicable).- Type:
optional
- status
'optimal','infeasible', or'error'.- Type:
- error_code
0 = success, 1 = infeasible, 2 = solver error.
- Type:
- runtime
Wall-clock time in seconds.
- Type:
- message
Human-readable status message.
- Type:
Convenience Function¶
- Irene.sosonc.sosonc_bounds(prog: OptimizationProblem, **kwargs) dict[str, float][source]
Compute SOS, SONC, and SOS+SONC lower bounds.
Returns a dict with keys
'sos','sonc','sos_first','sonc_first'.
Returns a dictionary with four keys: 'sos', 'sonc',
'sos_first', 'sonc_first', each mapping to the corresponding
lower bound.
Implementation Pipeline¶
The internal pipeline of globalMinSOSPSONC when called with
first='sos' is:
Solve SOS relaxation on the original problem \rightarrow \(\lambda_{\text{SOS}}\).
Build residual \(h = f - \lambda_{\text{SOS}}\) by cloning the objective’s coefficient-content list and subtracting \(\lambda_{\text{SOS}}\) from the identity monomial’s coefficient.
Construct a new
OptimizationProblemwith \(h\) as the objective and the same constraints (if any).Solve SONC on the residual \rightarrow \(\mu^*\).
Combine \(\lambda_{\text{SOS}} + \mu^*\) as the final lower bound.
Fallback: if any step raises an exception, return \(\max\{\lambda_{\text{SOS}}, \lambda_{\text{SONC}}\}\).
The SONC-first variant is symmetric.
Relation to the Mean Polynomial Hierarchy¶
The SOS+SONC cone \(\Sigma + C\) is a proper subset of the mean
polynomial preprime \(T_{\text{mean}}\) introduced in Sections 6–7
of the companion manuscript (Ghasemi & Kuhlmann, 2026). Consequently,
the SOS+SONC lower bounds from this module are dominated by the
mean-polynomial hierarchy bounds described in
algorithm_mean_polynomial_hierarchy.md.
The natural extension of this module to the full mean-polynomial
hierarchy replaces \(C_{n,2d}\) (SONC) with
\(T_{\text{mean},r}^{(1)}\) (single mean forms) in the signomial
program, and uses \(M_{2,1}\) forms to capture the SOS component
directly without requiring an SDP. This extension is planned for a
future mean_polynomial.py module.
Example¶
from Irene.grouprings import CommutativeSemigroup, SemigroupAlgebra
from Irene.program import OptimizationProblem
from Irene.sosonc import SOSONCRelaxations, sosonc_bounds
# x^4 - x^2 on R (global minimum = -0.25)
sg = CommutativeSemigroup(['x'])
sga = SemigroupAlgebra(sg)
x = sga['x']
prog = OptimizationProblem(sga)
prog.set_objective(x ** 4 - x ** 2)
engine = SOSONCRelaxations(prog, verbosity=0, relaxation_order=2)
result = engine.globalMinSOSPSONC(first='sos')
print(result)
# Compare all four bounds
bounds = sosonc_bounds(prog, verbosity=0)
for method, val in bounds.items():
print(f"{method}: {val:.6f}")
Test Suite¶
The test file tests/test_sosonc.py exercises the module with:
Container validation: default values and string representation of
SOSONCRelaxSol.SOS integration: \(x^2 + y^2\) (minimum 0), \(x^4 - x^2\) (minimum -0.25) with relaxation order 2.
SONC integration: Motzkin polynomial (a known SONC form).
Two-step pipeline: SOS-first and SONC-first on quadratic problems.
Convenience wrapper:
sosonc_boundsreturning all four keys.Error handling: invalid
firstargument rejection.
Run with:
source .venv/bin/activate
python -m pytest tests/test_sosonc.py -v
Further Reading¶
M. Schick, Sums of squares plus sums of nonnegative circuit polynomials, PhD dissertation, Universität Konstanz, 2025. GitHub repository.
M. Dressler, S. Iliman, and T. de Wolff, An Approach to Constrained Polynomial Optimization via Nonnegative Circuit Polynomials and Geometric Programming, Journal of Symbolic Computation 91 (2019), 149–172.
M. Ghasemi and S. Kuhlmann, The Cone Generated by Positive Semidefinite Mean Polynomials, 2026 (companion manuscript, Section 7; preprint arXiv:2608.22739).
For the wider SONC and SOS+SONC literature – including the characterization of nonnegative circuit polynomials, the constrained Positivstellensatz and the duality theory behind optimal SONC bounds – see References.