picos.expressions.exp_sumxtr

Implements SumExtremes.

Classes

class picos.expressions.exp_sumxtr.SumExtremes(x, k, largest, eigenvalues=False)[source]

Bases: picos.expressions.expression.Expression

Sum of the k largest or smallest elements or eigenvalues.

Definition

Let k \in \mathbb{Z}_{\geq 1}.

  1. If x is an n-dimensional real vector or matrix and eigenvalues == False, then this is the sum of the k \leq n largest or smallest scalar elements of x, depending on the truth value of largest.

    Special cases:

    • If k = 1, this is either the largest element \max_{i = 1}^n \operatorname{vec}(x)_i or the smallest element \min_{i = 1}^n \operatorname{vec}(x)_i of x.

    • If k = n, this is the sum of all elements \langle x, 1 \rangle of x.

  2. If X is an n \times n hermitian matrix and eigenvalues == True, then this is the sum of the k \leq n largest or smallest eigenvalues of X, depending on the truth value of largest. Recall that the eigenvalues of a hermitian matrix are real.

    Special cases:

    • If k = 1, this is either the largest eigenvalue \lambda_{\max}(X) or the smallest eigenvalue \lambda_{\min}(X) of X.

    • If k = n, this equals the trace \operatorname{tr}(X).

If the given k exceeds the n of either case, then k is silently clipped to n.

__ge__(other)[source]

Return a constraint that the expression is lower-bounded.

__init__(x, k, largest, eigenvalues=False)[source]

Construct a SumExtremes.

Parameters
  • x (ComplexAffineExpression) – The affine expression to take a sum over.

  • k (int) – Number of summands.

  • largest (bool) – Whether to sum over the largest (eigen)values as opposed to the smallest.

  • eigenvalues (bool) – Whether to sum eigenvalues instead of elements.

__le__(other)[source]

Return a constraint that the expression is upper-bounded.

__mul__(other)[source]

Denote multiplication with another expression on the right.

__rmul__(other)[source]

Denote multiplication with another expression on the left.

property eigenvalues

Whether the sum concerns eigenvalues as opposed to elements.

property full

Whether the sum concerns all (eigen)values of the expression.

property k

Number of (eigen)values to sum.

property largest

Whether the sum concerns largest values as opposed to smallest.

property x

The expression under the sum.