Examples and Validation¶
This chapter lists runnable entry points that exercise the three method families.
Recommended Example Sequence¶
examples/Example01.pyfor SDP hierarchy flow.examples/GPExample.pyfor geometric relaxation flow.examples/SONCExample.pyandexamples/SONCExample33.pyfor SONC flow.
API Quick Reference¶
Script |
Primary classes |
Solver dependency |
|---|---|---|
|
|
SDP solver (for example |
|
|
|
|
|
|
|
|
|
SDP Example¶
Run:
python examples/Example01.py
Expected behavior:
Initializes an
SDPRelaxationsobject with symbolic relations.Solves an SDP lower-bound problem via selected solver.
Prints solver summary and objective values.
Geometric Programming Example¶
Run:
python examples/GPExample.py
Expected behavior:
Builds an
OptimizationProblemfrom semigroup-algebra expressions.Constructs a
GPRelaxationsmodel.Prints transformation matrix information and GP solution details.
SONC Examples¶
Run:
python examples/SONCExample.py
python examples/SONCExample33.py
Expected behavior:
Builds constrained SONC models from semigroup-algebra expressions.
Prints a lower bound when solver/model setup succeeds.
Reports runtime solver status if GP solving is not available in the current environment.
Example 3.3 Traceability¶
The script examples/SONCExample33.py is aligned with the Section 3.3 benchmark
used in the repository and is paired with checks in tests/test_sonc_section3.py.
Regression Validation¶
Run the test suite from the repository root:
python -m unittest discover tests/
This is the recommended consistency check after modifying optimization modules or documentation examples.