This file documents major changes to PICOS. The format is based on Keep a Changelog.
The performance update.
Support for noncovex quadratic constraints with Gurobi 9 (or later).
UNRELIABLE_STRATEGIESto enable passing of problems to solvers that nominally support them but have proven unreliable.
Option mosek_basic_sol to let MOSEK (Optimizer) compute a basic solution for LPs.
The performance for solving problems with large data has been improved
drastically for CVXOPT and MOSEK (Optimizer; LPs in particular),
significantly for Cplex and SCIP, and
subtly for GLPK, Gurobi and ECOS.
This is most notable for LPs with a dense constraint matrix where the overhead for data passing can be significant in relation to the search time.
The performance of
picos.sumwhen summing a large number of (bi-)affine expressions has been improved drastically.
When possible, Gurobi is now interfaced through its matrix interface, which is faster for large data. This requires Gurobi 9 (or later) and SciPy.
By default, solving with MOSEK (Optimizer) does not return a basic LP solution any more. Use mosek_basic_sol to control this.
Dualization now makes use of variable bounds to reduce the number of auxiliary constraints.
The Python interface used to communicate with a solver is now mentioned in various log messages and exceptions.
On-the-fly loading of a data vector in a multiplication with a matrix expression.
Maximization of a squared norm not being detected as a nonconvex quadratic objective and being passed to solvers that do not support it.
The syntactic sugar update.
When forming linear matrix inequalities with the
>>operator, if one operand is an matrix and the other is an -dimensional vector (or a scalar), the latter is now understood as (respectively broadcasted along) the main diagonal of an diagonal matrix. In particular
X >> 1is now understood as as opposed to . If you want to express a constraint where is a matrix of all ones, use the new
Support for the OSQP solver.
Ability to negate or scale any expression and to sum any two expressions with the same or with a different type. This is established through a new
WeightedSumfallback class. Convex or concave weighted sums can be used as an objective or in a constraint like any other expression.
Ability to use
numpy.arraydirectly on valued PICOS objects, returning a zero, one or two-dimensional array depending on the shape of the value.
Ability to perform some algebraic operations on
Support for solving nonconvex continuous quadratic programs (QPs) with CPLEX and Gurobi. Gurobi further allows convex quadratic constraints to be present.
reshapeaffine expressions in C-order, like NumPy.
Support for MOSEK remote optimization with the mosek_server option.
Option cplex_vmconfig to load a virtual machine configuration file with CPLEX.
The performance of solving semidefinite programs with trivial linear matrix inequalities of the form
X >> 0using MOSEK (Optimizer) has been improved dramatically. Depending on your problem, you might experience this speedup when using the dualize option.
duals=Truewill now raise an exception when duals were returned by the solver but not all could be converted. Use the default of
duals=Noneto accept also incomplete duals.
The new argument
nameis the only optional argument to
Problemthat may be passed as a positional argument; the arguments
useOptionsmust now be passed as keyword arguments.
setup.pyunder Python 3.6 and earlier.
Bad shebang lines; all are now properly reading
Incorrect duals returned by MOSEK (Fusion).
An assertion failure when multiplying some quadratic expressions with a negative scalar.
A false expression being created when multiplying a
DetRootNwith a negative scalar.
An exception when multiplying a scalar power with a constant.
A modify-during-iteration issue that could result in a suboptimal solver being chosen.
Building piecewise affine functions from a mix of certain and random expressions.
A failure when computing the convex hull of a
ScenarioPerturbationSetwith few points.
Detection of string groups where the variable part is at the start or end of the strings.
CVXOPT reacting inconsistently to some infeasible problems.
A potential variable clash when reformulating a
Grammatical issues when printing variable groups of a problem.
The Python 3 update.
PICOS now requires Python 3.4 or later; Python 2 support was dropped.
A synopsis to the
NoStrategyFoundexception, explaining why strategy search failed.
Optimizing matrix -norms when columns of the matrix are constant.
Refining norms over a sparse constant term to a constant affine expression.
Gurobi printing empty lines to console when dual retrieval fails.
A bunch of Python 2 compatibility code was finally removed.
Exception readability has been improved using Python 3’s
raise fromsyntax where applicable.
__version_info__field now contains integers instead of strings.
QuadraticExpression.quadratic_forms, as write access would leave the expression in an inconsistent state. (At your own risk, use the equivalent
The robust optimization update.
The sign of dual values for affine equality constraints has been fixed by inversion.
Support for a selection of robust optimization (RO) and distributionally robust stochastic programming (DRO) models through a new
picos.uncertainnamespace. You may now solve
scenario-robust conic programs via
least squares and piecewise linear stochastic programs where the data generating distribution is defined ambiguously through a Wasserstein ball or through bounds on its first two moments via
picos.blockto create block matrices efficiently.
New convenience class
picos.Samplesfor data-driven applications.
matrix reshuffling(aka matrix realignment) used in quantum information theory.
Ability to define cones of fixed dimensionality and
Ability to query the
solver-reported objective value(useful with RO and DRO objectives).
picos.settingsdefining global options that can be set through environment variables prefixed with
PICOS_. Among other things, you can now blacklist all proprietary solvers for an application by passing
PICOS_NONFREE_SOLVERS=Falseto the Python interpreter.
A new base class
BiaffineExpressionfor all (uncertain) affine expression types. This gives developers extending PICOS a framework to support models with parameterized data.
factoring outvariables and parameters from (bi)affine vector expression.
replacingvariables and parameters with affine expressions of same shape to perform a change of variables in a mathematical sense.
Support for SCIP Optimization Suite 7.
Quadratic expressions created from a squared norm failing to decompose due to a numerically singular quadratic form.
Solution objects unintendedly sharing memory.
Solution search options that take a dictionary as their argument.
EpigraphReformulationfalsely claiming that it can reformulate any nonconvex objective.
A division by zero that could occur when computing the solution search overhead.
An exception with functions that look for short string descriptions, in particular with
Squared norms are now implemented as a subclass of quadratic expressions (
SquaredNorm), skipping an unnecessary decomposition on constraint creation.
Commutation matrices used internally for various algebraic tasks are now retrieved from a centralized cached function, improving performance.
The string description of
Probleminstances is not enclosed by dashed lines any more.
The backend update.
This is a major release featuring vast backend rewrites as well as interface changes. Programs written for older versions of PICOS are expected to raise deprecation warnings but should otherwise work as before. The following lists notable exceptions:
If solution search fails to find an optimal primal solution, PICOS will now raise a
SolutionFailureby default. Old behavior of not raising an exception is achieved by setting
primals=None(see primals and duals options).
The definition of the -norm has changed: It no longer refers to the -norm of the -norms of the matrix rows but to the -norm of the -norms of the matrix columns. This matches the definition you would find on Wikipedia and should reduce confusion for new users. See
The signs in the Lagrange dual problem of a conic problem are now more consistent for all cones, see Dual Values. In particular the signs of dual values for (rotated) second order conic constraints have changed and the problem obtained by
as_dual) has a different (but equivalent) form.
A modular problem reformulation framework. Before selecting a solver, PICOS now builds a map of problem types that your problem can be reformulated to and makes a choice based on the expected complexity of the reposed problem.
An object oriented interface to solution search options. See
Support for arbitrary objective functions via an epigraph reformulation.
Support for MOSEK 9.
Support for ECOS 2.0.7.
Support for multiple subsystems with
Lower and upper diagonal matrix variable types.
Possibility to use
picos.sumto sum over the elements of a single multidimensional expression.
Many new properties (postfix operations) to work with affine expressions; for instance
A.vecis a faster and cached way to express the vectorization
An option for every solver to manipulate the chances of it being selected (e.g. penalty_cvxopt).
Ability to run doctests via
The following are issues that were fixed in an effort of their own. If a bug is not listed here, it might still be fixed as a side effect of some of the large scale code rewrites that this release ships.
Upgrading the PyPI package via pip.
A regression that rendered the Kronecker product unusable.
Noisy exception handling in a sparse matrix helper function.
Shape detection for matrices given by string.
The hotstart option when solving with CPLEX.
Low precision QCP duals from Gurobi.
All algebraic expression code has been rewritten and organized in a new
expressionspackage. In particular, real and complex expressions are distinguished more clearly.
All algebraic expressions are now immutable.
The result of any unary operation on algebraic expressions (e.g. negation, transposition) is cached (only computed once per expression).
Slicing of affine expressions is more powerful, see Matrix Slicing.
Loading of constant numeric data has been unified, see
Constraints are added to problems as they are; any transformation is done transparently during solution search.
In particular, is now initially a (nonconvex) quadratic constraint and transformation to a conic constraint is controlled by the new assume_conic option.
Options passed to
solveare only used for that particular search.
The default value for the verbosity option (formerly
verbose) is now .
Available solvers are only imported when they are actually being used, which speeds up import of PICOS on platforms with many solvers installed.
The code obeys PEP 8 and PEP 257 more strongly. Exceptions: D105, D203, D213, D401, E122, E128, E221, E271, E272, E501, E702, E741.
Production testing code was moved out of the
Some public functions in the
toolsmodule that were originally meant for internal use.
This section lists deprecated modules, functions and options with their respective replacement or deprecation reason on the right hand side. Deprecated entities produce a warning and will be removed in a future release.
toolsmodule as a whole. It previously contained both algebraic functions for the user as well as functions meant for internal use. The former group of functions can now be imported directly from the
picosnamespace (though some are also individually deprecated). The other functions were either relocated (but can still be imported from
toolswhile it lasts) or removed.
add_list_of_constraints→ are ignored
All expression types:
Algebraic functions and shorthands in the
Solution search options:
verbose→ verbosity (takes an integer)
noprimals→ primals (the meaning is inverted)
noduals→ duals (the meaning is inverted)
The dual value returned for rotated second order cone constraints is now a proper member of the dual cone (which equals the primal cone up to a factor of ). Previously, the dual of an equivalent second order cone constraint was returned.
The Python 2/3 compatibility library
sixis no longer a dependency.
Support for the ECOS solver.
Experimental support for MOSEK’s new Fusion API.
Full support for exponential cone programming.
A production testing framework featuring around 40 novel optimization test cases that allows quick selection of tests, solvers, and solver options.
A “glyph” system that allows the user to adjust the string representations of future expressions and constraints. For instance,
picos.latin1()disables use of unicode symbols.
Support for symmetric variables with all solvers, even if they do not support semidefinite programming.
Solver implementations each have a source file of their own, and a common interface that makes implementing new solvers easier.
Likewise, constraint implementations each have a source file of their own.
The implementations of CPLEX, Gurobi, MOSEK and SCIP have been rewritten.
Solver selection takes into account how well a problem is supported, distinguishing between native, secondary, experimental and limited support.
Unsupported operations on expressions now produce meaningful exceptions.
The old production testing script.
Support for the SDPA solver.
Support for sequential quadratic programming.
Support for GLPK and MOSEK through CVXOPT.
Performance issues when exporting variable bounds to CVXOPT.
Hadamard product involving complex matrices.
Adding constant terms to quadratic expression.
Incorrect or redundant expression string representations.
GLPK handling of the default
Miscellaneous solver-specific bugs in the solvers that were re-implemented.
Support for the solvers GLPK and SCIP.
PICOS packages on Anaconda Cloud.
PICOS packages in the Arch Linux User Repository.
The main repository has moved to GitLab.
Releases of packages and documentation changes are automated and thus more frequent. In particular, post release versions are available.
Test bench execution is automated for greater code stability.
Improved test bench output.
Improved support for the SDPA solver.
partial_tracecan handle rectangular subsystems.
The documentation was restructured; examples were converted to Python 3.
Upper bounding the norm of a complex scalar.
Multiplication with a complex scalar.
A couple of Python 3 specific errors, in particular when deleting constraints.
All documentation examples are reproducible with the current state of PICOS.
Ability to dynamically add and remove constraints.
pass_simple_cons_as_bound, see below.
Improved efficiency when processing large expressions.
Improved support for the SDPA solver.
add_constraintreturns a handle to the constraint when the option return_constraints is set.
New signature for the function
partial_transpose, which can now transpose arbitrary subsystems from a kronecker product.
PICOS no longer turns constraints into variable bounds, unless the new option
Minor bugs with complex expressions.
Support for the SDPA solver.
Partial trace of an affine expression, see
Improved PEP 8 compliance.
Compatibility with Python 3.
Compatibility with Python 3.
The main repository has moved to GitHub.
Ability to read and write problems in conic benchmark format.
Support for inequalities involving the -norm of an affine expression, see
Support for equalities involving complex coefficients.
Support for antisymmetric matrix variables.
Hadamard (elementwise) product of affine expression, as an overload of the
^operator, read the tutorial on overloads.
Partial transposition of an aAffine Expression, see
Improved efficiency of the sparse SDPA file format writer.
Improved efficiency of the complex to real transformation.
Scalar product of hermitian matrices.
Conjugate of a complex expression.
Support for semidefinite programming over the complex domain, see the documentation on complex problems.
Helper function to input (multicommodity) graph flow problems, see the tutorial on flow constraints.
Additional argument to
tracepow, to represent constraints of the form .
Significantly improved slicing performance for affine expressions.
Improved performance when loading data.
Improved performance when retrieving primal solution from CPLEX.
The documentation received an overhaul.
Ability to specify variable bounds directly rather than by adding constraints, see
solve_via_dualwhich controls passing the dual problem to the solver instead of the primal problem. This can result in a significant speedup for certain problems.
Semidefinite programming interface for MOSEK 7.0.
handleConeVarsto customize how SOCPs and SDPs are passed to MOSEK. When these are set to
True, PICOS tries to minimize the number of variables of the MOSEK instance.
If the chosen solver supports this, updated problems will be partially re-solved instead of solved from scratch.
geomeanfunction to construct geometric mean inequalities that will be cast as rotated second order cone constraints.
lboundlimitto tell CPLEX to stop the search as soon as the given threshold is reached for the upper and lower bound, respectively.
boundMonitorto inspect the evolution of CPLEX lower and upper bounds.
Ability to use the weak inequality operators as an alias for the strong ones.
The solver search time is returned in the dictionary returned by
Access to dual values of fixed variables with CPLEX.
Evaluation of constant affine expressions with a zero coefficient.
Number of constraints not being updated in
Interface to Gurobi.
Ability to give an initial solution to warm-start mixed integer optimizers.
Ability to get a reference to a constraint that was added.
Minor bugs with quadratic expressions.