Skip to main content

Python implementation of Sum-of-Squares optimization built on picos

Project description

Documentation Build Status
Build Status

Sum of squares optimization built on top of picos. Easy access to pseudoexpectation operators for both formulating problems and extracting solutions via rounding algorithms.


To install from pypi:

pip install SumOfSquares


To compute the sum of squares decomposition of a polynomial:

>>> 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()
[5.0*(-0.306*x**2 + y**2)**2],
[2.057*(0.486*x**2 + x*y)**2],
[                 1.047*x**4]])

More Examples


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

author = {Yuan, Chenyang},
license = {MIT},
title = {{}},
url = {}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sumofsquares-1.3.0.tar.gz (13.3 kB view hashes)

Uploaded Source

Built Distribution

SumOfSquares-1.3.0-py3-none-any.whl (11.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page