Metadata-Version: 2.1
Name: SumOfSquares
Version: 1.2.1
Summary: Python implementation of Sum-of-Squares optimization built on picos
Home-page: https://github.com/yuanchenyang/SumOfSquares.py
Author: Chenyang Yuan
Author-email: yuanchenyang@gmail.com
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/yuanchenyang/SumOfSquares.py/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

SumOfSquares.py
---------------

Sum of squares optimization built on top of
[picos](https://picos-api.gitlab.io/picos/). Easy access to pseudoexpectation
operators for both formulating problems and extracting solutions via rounding
algorithms.


### Installation

To install from [pypi](https://pypi.org/project/SumOfSquares/):

```
pip install SumOfSquares
```

### Examples

To compute the sum of squares decomposition of a polynomial:
```python
>>> import sympy as sp
>>> x, y = sp.symbols('x y')
>>> p = 2*x**4 + 2*x**3*y - x**2*y**2 + 5*y**4
>>> prob = SOSProblem()
>>> c = prob.add_sos_constraint(p, [x, y])
>>> prob.solve()
>>> c.get_sos_decomp()
Matrix([
[5.0*(-0.306*x**2 + y**2)**2],
[2.057*(0.486*x**2 + x*y)**2],
[                 1.047*x**4]])
```

[More Examples](https://sums-of-squares.github.io/sos/index.html#python)


