Metadata-Version: 2.1
Name: SumOfSquares
Version: 1.3.1
Summary: Python implementation of Sum-of-Squares optimization built on picos
Author-email: Chenyang Yuan <yuanchenyang@gmail.com>
Maintainer-email: Chenyang Yuan <yuanchenyang@gmail.com>
License: Copyright 2020-2024 Chenyang Yuan
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/yuanchenyang/SumOfSquares.py
Project-URL: Bug Tracker, https://github.com/yuanchenyang/SumOfSquares.py/issues
Project-URL: Documentation, https://sums-of-squares.github.io/sos/index.html#python
Project-URL: Source, https://github.com/yuanchenyang/SumOfSquares.py
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: sympy
Requires-Dist: picos
Provides-Extra: convexhull
Requires-Dist: scipy ; extra == 'convexhull'
Provides-Extra: dev
Requires-Dist: build ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'

SumOfSquares.py
---------------
| **Documentation** | **Build Status** |
|:-----------------:|:----------------:|
| [![][docs-latest-img]][docs-latest-url] | [![Build Status][build-img]][build-url] |


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)

[docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg
[docs-latest-url]: https://sums-of-squares.github.io/sos/index.html#python
[build-img]: https://github.com/yuanchenyang/SumOfSquares.py/workflows/CI/badge.svg?branch=master
[build-url]: https://github.com/yuanchenyang/SumOfSquares.py/actions?query=workflow%3ACI

### Citation
If you use this library in your work, please consider citing:

```
@software{Yuan_SumOfSquares_py,
author = {Yuan, Chenyang},
license = {MIT},
title = {{SumOfSquares.py}},
url = {https://github.com/yuanchenyang/SumOfSquares.py}
}
```
