Skip to content

Commit a641b6b

Browse files
authored
Document certificates (#179)
1 parent c42818f commit a641b6b

File tree

6 files changed

+143
-10
lines changed

6 files changed

+143
-10
lines changed

docs/src/constraints.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,26 @@ Approximations of the cone of copositive matrices:
285285
SumOfSquares.CopositiveInner
286286
```
287287

288-
Sparsity certificates:
288+
Types of sparsity
289289
```@docs
290+
SumOfSquares.Certificate.VariableSparsity
290291
SumOfSquares.Certificate.MonomialSparsity
292+
SumOfSquares.Certificate.SignSymmetry
293+
```
294+
295+
Ideal certificates:
296+
```@docs
297+
SumOfSquares.Certificate.MaxDegree
298+
SumOfSquares.Certificate.FixedBasis
299+
SumOfSquares.Certificate.Newton
300+
SumOfSquares.Certificate.Remainder
301+
SumOfSquares.Certificate.SparseIdeal
302+
```
303+
304+
Preorder certificates:
305+
```@docs
306+
SumOfSquares.Certificate.Putinar
307+
SumOfSquares.Certificate.SparsePreorder
291308
```
292309

293310
Attributes

src/Certificate/Certificate.jl

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,21 @@ abstract type AbstractCertificate end
5656
abstract type AbstractPreorderCertificate <: AbstractCertificate end
5757
abstract type AbstractIdealCertificate <: AbstractCertificate end
5858

59+
"""
60+
struct Putinar{IC <: AbstractIdealCertificate, CT <: SumOfSquares.SOSLikeCone, BT <: MB.AbstractPolynomialBasis} <: AbstractPreorderCertificate
61+
ideal_certificate::IC
62+
cone::CT
63+
basis::Type{BT}
64+
maxdegree::Int
65+
end
66+
67+
The `Putinar` certificate ensures the nonnegativity of `p(x)` for all `x` such that
68+
`g_i(x) >= 0` and `h_i(x) = 0` by exhibiting Sum-of-Squares polynomials `σ_i(x)`
69+
such that `p(x) - ∑ σ_i(x) g_i(x)` is guaranteed to be nonnegativity for all `x`
70+
such that `h_i(x) = 0`.
71+
The polynomials `σ_i(x)` are search over `cone` with a basis of type `basis` such that
72+
the degree of `σ_i(x) g_i(x)` does not exceed `maxdegree`.
73+
"""
5974
struct Putinar{IC <: AbstractIdealCertificate, CT <: SumOfSquares.SOSLikeCone, BT <: MB.AbstractPolynomialBasis} <: AbstractPreorderCertificate
6075
ideal_certificate::IC
6176
cone::CT
@@ -119,6 +134,20 @@ SumOfSquares.matrix_cone_type(::Type{<:SimpleIdealCertificate{CT}}) where {CT} =
119134
zero_basis(certificate::SimpleIdealCertificate) = MB.MonomialBasis
120135
zero_basis_type(::Type{<:SimpleIdealCertificate{CT, BT}}) where {CT, BT} = MB.MonomialBasis
121136

137+
"""
138+
struct MaxDegree{CT <: SumOfSquares.SOSLikeCone, BT <: MB.AbstractPolynomialBasis} <: SimpleIdealCertificate{CT, BT}
139+
cone::CT
140+
basis::Type{BT}
141+
maxdegree::Int
142+
end
143+
144+
The `MaxDegree` certificate ensures the nonnegativity of `p(x)` for all `x` such that
145+
`h_i(x) = 0` by exhibiting a Sum-of-Squares polynomials `σ(x)`
146+
such that `p(x) - σ(x)` is guaranteed to be zero for all `x`
147+
such that `h_i(x) = 0`.
148+
The polynomial `σ(x)` is search over `cone` with a basis of type `basis` such that
149+
the degree of `σ(x)` does not exceed `maxdegree`.
150+
"""
122151
struct MaxDegree{CT <: SumOfSquares.SOSLikeCone, BT <: MB.AbstractPolynomialBasis} <: SimpleIdealCertificate{CT, BT}
123152
cone::CT
124153
basis::Type{BT}
@@ -131,6 +160,18 @@ function get(::Type{MaxDegree{CT, BT}}, ::GramBasisType) where {CT, BT}
131160
return BT
132161
end
133162

163+
"""
164+
struct FixedBasis{CT <: SumOfSquares.SOSLikeCone, BT <: MB.AbstractPolynomialBasis} <: SimpleIdealCertificate{CT, BT}
165+
cone::CT
166+
basis::BT
167+
end
168+
169+
The `FixedBasis` certificate ensures the nonnegativity of `p(x)` for all `x` such that
170+
`h_i(x) = 0` by exhibiting a Sum-of-Squares polynomials `σ(x)`
171+
such that `p(x) - σ(x)` is guaranteed to be zero for all `x`
172+
such that `h_i(x) = 0`.
173+
The polynomial `σ(x)` is search over `cone` with basis `basis`.
174+
"""
134175
struct FixedBasis{CT <: SumOfSquares.SOSLikeCone, BT <: MB.AbstractPolynomialBasis} <: SimpleIdealCertificate{CT, BT}
135176
cone::CT
136177
basis::BT
@@ -142,6 +183,22 @@ function get(::Type{FixedBasis{CT, BT}}, ::GramBasisType) where {CT, BT}
142183
return BT
143184
end
144185

186+
"""
187+
struct Newton{CT <: SumOfSquares.SOSLikeCone, BT <: MB.AbstractPolynomialBasis, NPT <: Tuple} <: SimpleIdealCertificate{CT, BT}
188+
cone::CT
189+
basis::Type{BT}
190+
variable_groups::NPT
191+
end
192+
193+
The `Newton` certificate ensures the nonnegativity of `p(x)` for all `x` such that
194+
`h_i(x) = 0` by exhibiting a Sum-of-Squares polynomials `σ(x)`
195+
such that `p(x) - σ(x)` is guaranteed to be zero for all `x`
196+
such that `h_i(x) = 0`.
197+
The polynomial `σ(x)` is search over `cone` with a basis of type `basis`
198+
chosen using the multipartite Newton polytope with parts `variable_groups`.
199+
If `variable_groups = tuple()` then it falls back to the classical Newton polytope
200+
with all variables in the same part.
201+
"""
145202
struct Newton{CT <: SumOfSquares.SOSLikeCone, BT <: MB.AbstractPolynomialBasis, NPT <: Tuple} <: SimpleIdealCertificate{CT, BT}
146203
cone::CT
147204
basis::Type{BT}
@@ -154,6 +211,22 @@ function get(::Type{<:Newton{CT, BT}}, ::GramBasisType) where {CT, BT}
154211
return BT
155212
end
156213

214+
"""
215+
struct Remainder{GCT<:AbstractIdealCertificate} <: AbstractIdealCertificate
216+
gram_certificate::GCT
217+
end
218+
219+
The `Remainder` certificate ensures the nonnegativity of `p(x)` for all `x` such that
220+
`h_i(x) = 0` by guaranteeing the remainder of `p(x)` modulo the ideal generated by
221+
`⟨h_i⟩` to be nonnegative for all `x` such that `h_i(x) = 0` using the certificate
222+
`gram_certificate`.
223+
For instance, if `gram_certificate` is [`SumOfSquares.Certificate.Newton`](@ref),
224+
then the certificate `Remainder(gram_certificate)` will take the remainder before
225+
computing the Newton polytope hence might generate a much smaller Newton polytope
226+
hence a smaller basis and smaller semidefinite program.
227+
However, this then corresponds to a lower degree of the hierarchy which might
228+
be insufficient to find a certificate.
229+
"""
157230
struct Remainder{GCT<:AbstractIdealCertificate} <: AbstractIdealCertificate
158231
gram_certificate::GCT
159232
end

src/Certificate/sparse/monomial_sparsity.jl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@ const CEG = SumOfSquares.Certificate.ChordalExtensionGraph
22

33
"""
44
struct MonomialSparsity{C<:CEG.AbstractCompletion} <: Sparsity
5-
k::Int
65
completion::C
6+
k::Int
77
use_all_monomials::Bool
88
end
99
10-
Monomial or term sparsity as developed in [].
10+
Monomial or term sparsity as developed in [WML20a, WML20b].
11+
The `completion` field should be `ClusterCompletion()` [default] for the block-closure or cluster completion [WML20a],
12+
and `ChordalCompletion()` for chordal completion [WML20b].
13+
The integer `k` [default=0] corresponds to `Σ_k` defined in [(3.2), WML20a]
14+
and `k = 0` corresponds to `Σ_*` defined in [(3.3), WML20a].
15+
If `use_all_monomials` is `false` then some monomials of the basis
16+
might be dropped from the basis if not needed.
17+
18+
[WML20a] Wang, Jie, Victor Magron, and Jean-Bernard Lasserre.
19+
*TSSOS: A Moment-SOS hierarchy that exploits term sparsity*.
20+
arXiv preprint arXiv:1912.08899 (2020).
1121
12-
# [WML20a] Wang, Jie, Victor Magron, and Jean-Bernard Lasserre.
13-
# *TSSOS: A Moment-SOS hierarchy that exploits term sparsity*.
14-
# arXiv preprint arXiv:1912.08899 (2020).
15-
#
16-
# [WML20b] Wang, Jie, Victor Magron, and Jean-Bernard Lasserre.
17-
# *Chordal-TSSOS: a moment-SOS hierarchy that exploits term sparsity with chordal extension*.
18-
# arXiv preprint arXiv:2003.03210 (2020).
22+
[WML20b] Wang, Jie, Victor Magron, and Jean-Bernard Lasserre.
23+
*Chordal-TSSOS: a moment-SOS hierarchy that exploits term sparsity with chordal extension*.
24+
arXiv preprint arXiv:2003.03210 (2020).
1925
"""
2026
struct MonomialSparsity{C<:CEG.AbstractCompletion} <: Sparsity
2127
completion::C

src/Certificate/sparse/sign.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
"""
2+
struct SignSymmetry <: Sparsity end
3+
4+
Sign symmetry as developed in [Section III.C, L09].
5+
6+
[L09] Lofberg, Johan.
7+
*Pre-and post-processing sum-of-squares programs in practice*.
8+
IEEE transactions on automatic control 54, no. 5 (2009): 1007-1011.
9+
"""
110
struct SignSymmetry <: Sparsity end
11+
212
function binary_exponent(exponents, ::Type{T}) where T
313
cur = zero(T)
414
for exponent in exponents

src/Certificate/sparse/sparse_putinar.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ include("sign.jl")
77
include("variable_sparsity.jl")
88
include("monomial_sparsity.jl")
99

10+
"""
11+
struct SparsePreorder{S <: Sparsity, C <: AbstractPreorderCertificate} <: AbstractPreorderCertificate
12+
sparsity::S
13+
certificate::C
14+
end
15+
16+
Same certificate as `C` except that the Sum-of-Squares polynomials `σ_i`
17+
are modelled as a sum of Sum-of-Squares polynomials with smaller basis
18+
using the sparsity reduction `sparsity`.
19+
"""
1020
struct SparsePreorder{S <: Sparsity, C <: AbstractPreorderCertificate} <: AbstractPreorderCertificate
1121
sparsity::S
1222
certificate::C
@@ -45,6 +55,16 @@ get(::Type{<:SparsePreorder{S, C}}, attr::IdealCertificate) where {S, C} = Spars
4555

4656
SumOfSquares.matrix_cone_type(::Type{SparsePreorder{S, C}}) where {S, C} = SumOfSquares.matrix_cone_type(C)
4757

58+
"""
59+
struct SparseIdeal{S <: Sparsity, C <: AbstractIdealCertificate} <: AbstractIdealCertificate
60+
sparsity::S
61+
certificate::C
62+
end
63+
64+
Same certificate as `C` except that the Sum-of-Squares polynomial `σ`
65+
is modelled as a sum of Sum-of-Squares polynomials with smaller basis
66+
using the sparsity reduction `sparsity`.
67+
"""
4868
struct SparseIdeal{S <: Sparsity, C <: AbstractIdealCertificate} <: AbstractIdealCertificate
4969
sparsity::S
5070
certificate::C

src/Certificate/sparse/variable_sparsity.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
struct VariableSparsity <: Sparsity end
3+
4+
Variable or correlative sparsity as developed in [WSMM06].
5+
6+
[WSMM06] Waki, Hayato, Sunyoung Kim, Masakazu Kojima, and Masakazu Muramatsu. "Sums of squares and semidefinite program relaxations for polynomial optimization problems with structured sparsity." SIAM Journal on Optimization 17, no. 1 (2006): 218-242.
7+
"""
18
struct VariableSparsity <: Sparsity end
29

310
const CEG = ChordalExtensionGraph

0 commit comments

Comments
 (0)