picos.expressions.exp_norm¶
Implements Norm
.
Classes
- class picos.expressions.exp_norm.Norm(x, p=2, q=None, denominator_limit=1000)[source]¶
Bases:
Expression
Entrywise
-norm or
-norm of an expression.
This class can represent the absolute value, the modulus, a vector
-norm and an entrywise matrix
-norm of a (complex) affine expression. In addition to these convex norms, it can represent the concave generalized vector
-norm with
.
Not all of these norms are available on the complex field; see the definitions below to learn more.
- Definition
If
is not given (
None
), then it is set equal to.
If the normed expression is a real scalar
, then this is the absolute value
The parameters
and
are ignored in this case.
If the normed expression is a complex scalar
, then this is the modulus
The parameters
and
are ignored in this case.
If the normed expression is a real vector
and
, then this is the (generalized) vector
-norm
for
with
and
the absolute value of the
-th entry of
.
Note that for
the expression is not convex and thus not a proper norm. However, it is concave over the nonnegative orthant and posing a lower bound on such a generalized norm yields a convex constraint for
.
Warning
When you pose a lower bound on a concave generalized norm (
), then PICOS enforces
through an auxiliary constraint during solution search.
Special cases:
For
, this is the Manhattan or Taxicab norm
.
For
, this is the Euclidean norm
.
For
, this is the Maximum, Chebyshev, or Infinity norm
.
If the normed expression is a real vector
and
, then it is treated as a matrix with a single row or a single column, depending on the shape associated with
. See case (5).
If the normed expression is a complex vector
and
, then the definition is the same as in case (3) but with
,
the modulus of the
-th entry of
, and
.
If the normed expression is a real
matrix
, then this is the
-norm
for
with
.
If
, then this is equal to the (generalized) vector
-norm of the the vectorized matrix, that is
. In this case, the requirement
is relaxed to
and
may be a complex matrix. See case (3).
Special cases:
For
, this is the Frobenius norm
.
For
,
, this is the maximum absolute column sum
This equals the operator norm induced by the vector
-norm. You can obtain the maximum absolute row sum (the operator norm induced by the vector
-norm) by first transposing
.
Complex matrix norms are not supported.
Note
You can write
in Python as
float("inf")
.- __init__(x, p=2, q=None, denominator_limit=1000)[source]¶
Construct a
Norm
.- Parameters
x (ComplexAffineExpression) – The affine expression to take the norm of.
p (float) – The value for
, which is cast to a limited precision fraction.
q (float) – The value for
, which is cast to a limited precision fraction. The default of
None
means equal to.
denominator_limit (int) – The largest allowed denominator when casting
and
to a fraction. Higher values can yield a greater precision at reduced performance.
- property p¶
The parameter
.
This is a limited precision version of the parameter used when the norm was constructed.
- property pden¶
The limited precision fraction denominator of
.
- property pnum¶
The limited precision fraction numerator of
.
- property q¶
The parameter
.
This is a limited precision version of the parameter used when the norm was constructed.
- property qden¶
The limited precision fraction denominator of
.
- property qnum¶
The limited precision fraction numerator of
.
- property x¶
Real expression whose norm equals that of the original expression.