Repository navigation
Add SetProg templates - #38
Merged
Merged
Conversation
SetProgTemplate uses the sets of SetProg as node functions: ellipsoids, polynomial sets, and what the other templates do not have, piecewise semi-ellipsoids and piecewise polytopes. Stability only, like the sum-of-squares template. Needs SetProg with support for constant supersets, blegat/SetProg.jl branch bl/constant_superset.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #38 +/- ##
==========================================
+ Coverage 96.72% 96.82% +0.09%
==========================================
Files 47 49 +2
Lines 1404 1479 +75
==========================================
+ Hits 1358 1432 +74
- Misses 46 47 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # CLAUDE.md # docs/src/manual/support.md # docs/src/manual/templates.md # src/PathCompleteCertificates.jl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a template whose node functions are the sets of SetProg. For a homogeneous node function of degree
d, the stability edge inequalityV_dst(A x) ≤ γᵈ V_src(x)is the set inclusion(A / γ) S_src ⊆ S_dst, and this template hands that inclusion to SetProg.What it adds over the existing templates is the piecewise semi-ellipsoid, a function
that is quadratic on each cone of a fixed partition. SetProg also covers the families PCC
already has, which is how the template is checked.
Supported set variables
variableV_s(x)Ellipsoid(symmetric = true)x' Q_s xQuadraticTemplatePolySet(symmetric = true, degree = 2d, variables = x)p_s(x)2dSumOfSquaresTemplate(d, x)Polytope(symmetric = true, piecewise = P)a_{s,i}' xon theith coneConicPolyhedralTemplateon the same conesEllipsoid(symmetric = true, piecewise = P)x' Q_{s,i} xon theith conePass one variable to share it across nodes, or a vector with one per node to give each
node its own partition. With one per node,
reindexgives each node of a lifted graphthe variable of its origin, like the polyhedral templates.
Benchmarks
The system is the one from
test/templates/sum_of_squares.jl: a rotation and a shear, bothscaled by
0.69. Every rate is an upper bound on the joint spectral radius fromjsr_boundwith Clarabel andrtol = 1e-4. The joint spectral radius is at least0.69,the spectral radius of each mode.
One node (two self-loops):
QuadraticTemplateSetProgTemplate(Ellipsoid(symmetric = true))SumOfSquaresTemplate(2, x)SetProgTemplate(PolySet(symmetric = true, degree = 4, variables = x))ConicPolyhedralTemplate([planar_conic_partition(1)])SetProgTemplate(Polytope(symmetric = true, piecewise = octagon))SetProgTemplate(Ellipsoid(symmetric = true, piecewise = square)), 4 piecesSetProgTemplate(Ellipsoid(symmetric = true, piecewise = octagon)), 8 piecesde_bruijn(1, 2)(two nodes):QuadraticTemplateSetProgTemplate, square partition at node 1 and octagon at node 2existing template.
±(−1, 1). Its facet cones are exactly those of
planar_conic_partition(1), which iswhat makes the polytope comparison meaningful.
With 4 pieces on this system, the optimum has all pieces equal to the ellipsoid.
How it is built
add_domination!folds the scale into the map,(map / γ) * S_src ⊆ S_dstwith
γ = scale^(1/d). A nonzeromarginand ascalethat is a JuMP expression boththrow an
ArgumentError, as the interface asks.add_normalization!constrainsS ⊆ unit, i.e.V(x) ≥ ‖x‖₂ᵈ, orV ≥the gauge ofPfor a polytope. The unit set is written in the variable's ownfamily. The edge conditions are homogeneous, so this fixes the scale and excludes
V ≡ 0without excluding any certificate.by its gauge function. A constant polynomial or piecewise superset has no dual
representation.
SetProgFunctionis callable. On a piecewise set it evaluates thepiece containing
x, and the function is continuous, so a boundary point can useeither neighbour.
Limitations
domination_slack, the same asSumOfSquaresTemplate. Soedge_slacks,tight_edgesandrefinedo not work with this template yet.order_witnessonly uses the template-free simulationmap. Both rows are in the graph-layer table of What works with what.
1e-16of a
cos(π/2), can make the solver reportALMOST_OPTIMALfor a point that violatesthe edge inequalities by a lot. In a SetProg prototype with Hypatia, a 45°-rotated
square with noisy normals "certified" 0.62, below the 0.69 lower bound; with the
normals rounded it gives 0.9758. PCC counts
ALMOST_OPTIMALas feasible, so thedocstring warns about it and the tests use exact partitions. The cause is in
SetProg/Polyhedra's handling of the pieces and is left for a separate fix.