i1 : R = QQ[x,y]; |

i2 : f = 2*x^4 + 2*x^3*y - 2*x^2*y^2 + 5*y^4; |

i3 : sol = solveSOS f; |

i4 : s = sosPoly sol 83 2 2 2 43 20 2 2 231773 2 2 o4 = (5)(- ---x + y ) + (--)(--x + x*y) + (------)(x ) 200 20 43 344000 o4 : SOSPoly |

i5 : value(s) 4 3 2 2 4 o5 = 2x + 2x y - 2x y + 5y o5 : R |

i6 : R = QQ[x,y]; |

i7 : S = R/ideal(x^2 + y^2 - 1); |

i8 : f = 10-x^2-y; |

i9 : sol = solveSOS (f, 2); |

i10 : sosPoly sol 1 2 2 83 2 o10 = (7)(y - --) + (6)(x) + (--)(1) 14 28 o10 : SOSPoly |

- The package implements Hilbert's algorithm to decompose a nonnegative ternary form into a sum of squares of rational functions: sosdecTernary.
- Sums of squares problems can be solved parametrically: solveSOS.
- Optimization over varieties can run using lowerBound.

- [BPT12]
*Semidefinite Optimization and Convex Algebraic Geometry*SIAM Textbook, edited by G. Blekherman, P. Parrilo, and R. Thomas, (2012). - [P05]
*Exploiting Algebraic Structure in Sum of Squares Programs*P. Parrilo in*Positive polynomials in control*(2005). - [PP]
*Computing sum of squares decompositions with rational coefficients*H. Peyrl and P. Parrilo in Theoretical Computer Science 409 (2008) p. 269–281.

- Special thanks: Ilir Dema, Nidhi Kaihnsa, Anton Leykin

- Functions and commands
- checkSolver -- tests a semidefinite programming solver
- library -- library of interesting nonnegative forms
- lowerBound -- finds a lower bound for a polynomial
- recoverSolution -- factor a rank one positive semidefinite matrix
- solveSOS -- solve a sum-of-squares problem
- sosdecTernary -- sum of squares decomposition for ternary forms
- sosInIdeal -- sum of squares polynomial in ideal
- sosPoly -- make an SOS polynomial

- Methods
- clean(RR,SOSPoly) -- remove squares with very small coefficients from a sum of squares
- recoverSolution(SDPResult), see recoverSolution -- factor a rank one positive semidefinite matrix
- net(SDPResult), see SDPResult -- result of a semidefinite programming computation
- status(SDPResult), see SDPResult -- result of a semidefinite programming computation
- coefficients(SOSPoly), see SOSPoly -- A type to store sums-of-squares polynomials
- expression(SOSPoly), see SOSPoly -- A type to store sums-of-squares polynomials
- generators(SOSPoly), see SOSPoly -- A type to store sums-of-squares polynomials
- length(SOSPoly), see SOSPoly -- A type to store sums-of-squares polynomials
- Matrix == SOSPoly, see SOSPoly -- A type to store sums-of-squares polynomials
- net(SOSPoly), see SOSPoly -- A type to store sums-of-squares polynomials
- Number * SOSPoly, see SOSPoly -- A type to store sums-of-squares polynomials
- ring(SOSPoly), see SOSPoly -- A type to store sums-of-squares polynomials
- RingElement == SOSPoly, see SOSPoly -- A type to store sums-of-squares polynomials
- SOSPoly * SOSPoly, see SOSPoly -- A type to store sums-of-squares polynomials
- SOSPoly + SOSPoly, see SOSPoly -- A type to store sums-of-squares polynomials
- SOSPoly == Matrix, see SOSPoly -- A type to store sums-of-squares polynomials
- SOSPoly == RingElement, see SOSPoly -- A type to store sums-of-squares polynomials
- SOSPoly == SOSPoly, see SOSPoly -- A type to store sums-of-squares polynomials
- SOSPoly ^ ZZ, see SOSPoly -- A type to store sums-of-squares polynomials
- substitute(SOSPoly,Ring), see SOSPoly -- A type to store sums-of-squares polynomials
- sosPoly(SDPResult), see sosPoly -- make an SOS polynomial
- value(SOSPoly) -- expansion of a weighted SOS decomposition

- Symbols
- RoundTol -- tolerance for rational rounding
- GramMatrix, see SDPResult -- result of a semidefinite programming computation
- MomentMatrix, see SDPResult -- result of a semidefinite programming computation
- Status, see SDPResult -- result of a semidefinite programming computation
- TraceObj -- whether to use trace as the objective function