Skip to content

Commit aca6880

Browse files
committed
Improve doc for dual
1 parent 61dc80d commit aca6880

File tree

4 files changed

+60
-6
lines changed

4 files changed

+60
-6
lines changed

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
SumOfSquares = "4b9e565b-77fc-50a5-a571-1244f986bda1"
34

45
[compat]
56
Documenter = "~0.21"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ makedocs(
1414
],
1515
# The following ensures that we only include the docstrings from
1616
# this module for functions define in Base that we overwrite.
17-
modules = [SumOfSquares]
17+
modules = [SumOfSquares, PolyJuMP]
1818
)
1919

2020
deploydocs(

docs/src/constraints.md

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,42 @@ for a detailed example.
190190
The dual of a polynomial constraint `cref` is a moment serie `μ` as defined in
191191
[MultivariateMoments](https://github.com/JuliaAlgebra/MultivariateMoments.jl).
192192
The dual can be obtained with the `dual` function as with classical
193-
dual values in JuMP. The matrix of moments can be obtained using [`moment_matrix`](@ref):
193+
dual values in JuMP.
194194
```julia
195195
μ = dual(cref)
196+
```
197+
By dual of a Sum-of-Squares constraint, we may mean different things
198+
and the meaning chosen for `dual` function was chosen for consistency
199+
with the definition of the JuMP `dual` function to ensure that generic
200+
code will work as expected with Sum-of-Squares constraints.
201+
In a Sum-of-Squares constraint, a polynomial $p$ is constraint to
202+
be SOS in some domain defined by polynomial `q_i`.
203+
So `p(x)` is constrained to be equal to
204+
`s(x) = s_0(x) + s_1(x) * q_1(x) + s_2(x) * q_2(x) + ...`
205+
where the `s_i(x)` polynomials are Sum-of-Squares.
206+
The dual of the equality constraint between `p(x)` and `s(x)` is given
207+
by [`SumOfSquares.PolyJuMP.moments`](@ref).
208+
```julia
209+
μ = moments(cref)
210+
```
211+
Note that the `dual` and `moments` may give different results. For instance,
212+
the output of `dual` only contains the moments corresponding to monomials of `p`
213+
while the output of `moments` may give the moments of other monomials if `s(x)`
214+
has more monomials than `p(x)`. Besides, if the domain contains polynomial,
215+
equalities, only the remainder of `p(x) - s(x)` modulo the ideal is constrained
216+
to be zero, see Corollary 2 of [CLO13]. In that case, the output `moments` is
217+
the dual of the constraint on the remainder so some monomials may have different
218+
moments with `dual` or `moments`.
219+
220+
The dual of the Sum-of-Squares constraint on `s_0(x)`, commonly referred
221+
to as the the matrix of moments can be obtained using [`moment_matrix`](@ref):
222+
```julia
196223
ν = moment_matrix(cref)
197224
```
198225
The `extractatoms` function of [MultivariateMoments](https://github.com/JuliaAlgebra/MultivariateMoments.jl)
199226
can be used to check if there exists an *atomic* measure (i.e. a measure that is
200-
a sum of Dirac measures) that has the moments given in `ν`.
201-
This can be used for instance in polynomial optimization (see
227+
a sum of Dirac measures) that has the moments given in the the moment matrix
228+
`ν`. This can be used for instance in polynomial optimization (see
202229
[this notebook](https://github.com/JuliaOpt/SumOfSquares.jl/blob/master/examples/Polynomial_Optimization.ipynb))
203230
or stability analysis (see
204231
[this notebook](https://github.com/blegat/SwitchOnSafety.jl/blob/master/examples/LPJ17e43.ipynb)).
@@ -207,10 +234,14 @@ or stability analysis (see
207234

208235
[BPT12] Blekherman, G.; Parrilo, P. A. & Thomas, R. R.
209236
*Semidefinite Optimization and Convex Algebraic Geometry*.
210-
Society for Industrial and Applied Mathematics, 2012.
237+
Society for Industrial and Applied Mathematics, **2012**.
238+
239+
[CLO13] Cox, D., Little, J., & OShea, D.
240+
*Ideals, varieties, and algorithms: an introduction to computational algebraic geometry and commutative algebra*.
241+
Springer Science & Business Media, **2013**.
211242

212243
[AM17] Ahmadi, A. A. & Majumdar, A.
213-
*DSOS and SDSOS Optimization: More Tractable Alternatives to Sum of Squares and Semidefinite Optimization*
244+
*DSOS and SDSOS Optimization: More Tractable Alternatives to Sum of Squares and Semidefinite Optimization*.
214245
ArXiv e-prints, **2017**.
215246

216247
## Reference
@@ -249,6 +280,8 @@ SumOfSquares.CopositiveInner
249280

250281
Attributes
251282
```@docs
283+
SumOfSquares.PolyJuMP.MomentsAttribute
284+
SumOfSquares.MultivariateMoments.moments(::SumOfSquares.JuMP.ConstraintRef)
252285
GramMatrix
253286
SumOfSquares.GramMatrixAttribute
254287
gram_matrix
@@ -260,3 +293,17 @@ certificate_monomials
260293
SumOfSquares.LagrangianMultipliers
261294
lagrangian_multipliers
262295
```
296+
297+
Polynomial basis:
298+
```@docs
299+
SumOfSquares.PolyJuMP.AbstractPolynomialBasis
300+
SumOfSquares.PolyJuMP.MonomialBasis
301+
SumOfSquares.PolyJuMP.ScaledMonomialBasis
302+
SumOfSquares.PolyJuMP.FixedPolynomialBasis
303+
```
304+
305+
Bridges are automatically added using the following utilities:
306+
```@docs
307+
SumOfSquares.PolyJuMP.bridgeable
308+
SumOfSquares.PolyJuMP.bridges
309+
```

docs/src/variables.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,9 @@ Society for Industrial and Applied Mathematics, **2012**.
173173
[AM17] Ahmadi, A. A. & Majumdar, A.
174174
*DSOS and SDSOS Optimization: More Tractable Alternatives to Sum of Squares and Semidefinite Optimization*
175175
ArXiv e-prints, **2017**.
176+
177+
## Reference
178+
179+
```@docs
180+
SumOfSquares.PolyJuMP.Poly
181+
```

0 commit comments

Comments
 (0)