A Python interface to conic optimization solvers¶
Welcome to the documentation of PICOS, a powerful and user friendly Python API for convex and mixed integer optimization that dispatches your problem to the best fit solver that is available at runtime. A PDF version of this documentation is available for offline use. Here’s a quick example:
>>> import picos as pc >>> x = pc.RealVariable("x", 5) >>> a = pc.Constant("a", range(5)) >>> P = pc.Problem() >>> P.minimize = abs(x - a) # abs() - Euclidean norm >>> P += pc.sum(x) == 1 # Add a constraint >>> opt = P.solve(solver="cvxopt") # Optional: Solver choice >>> print(x.T) # .T - Transpose [-1.80e+00 -8.00e-01 2.00e-01 1.20e+00 2.20e+00] >>> round(P.value, 3) 4.025
If you want to report a bug or contribute to PICOS, the contribution guide has you covered.
If you still have a question, we’re happy to receive your mail!