Operators#
Operator Base Class#
- class pepflow.Operator(*, is_basis: bool, composition: AddedOper | ScaledOper | None = None, tags: list[str] = NOTHING, math_expr: MathExpr = NOTHING)#
A
Operatorobject represents an operator.Operatorobjects can be constructed as linear combinations of otherOperatorobjects. Let a and b be some numeric data type. Let A and B beOperatorobjects. Then, we can form a newOperatorobject: a*A+b*B.A
Operatorobject should never be explicitly constructed. Only children ofOperatorsuch asLinearOperatororMonotoneOperatorshould be constructed. See their respective documentation to see how.Every child class needs to implement the
get_interpolation_constraints_by_group()method. This returns aConstraintDataobject which will store theOperator’s interpolation conditions. See theConstraintDatadocumentation for details and theLinearOperatororMonotoneOperatorfor examples.Let A be a
Operatorobject. The naming convention for aScalarConstraintobject representing an interpolation condition of A between twoVectorobjects x_0 and x_1 is {A.tag}:{x_0.tag},{x_1.tag}. The naming convention for aScalarConstraintobject representing an interpolation condition of A using only oneVectorobject x_0 is {A.tag}:{x_0.tag},{x_0.tag}.If a
Operatorhas multipleScalarConstraintgroups, then the naming convention of the individualScalarConstraintobjects must differ. For example, Lipschitz Strongly Monotone Operators has a group ofScalarConstraintobjects representing the interpolation conditions related to Lipschitz Continuity and a group ofScalarConstraintobjects representing the interpolation conditions related to Strong Monotonicity. Let A be aOperatorobject. A possible naming convention for aScalarConstraintobject representing an interpolation condition related to the Lipschitz Continuity of A between twoVectorobjects x_0 and x_1 is {A.tag}_convex:{x_0.tag},{x_1.tag}. A possible naming convention for aScalarConstraintobject representing an interpolation condition related to the Strong Monotonicity of A between twoVectorobjects x_0 and x_1 is {A.tag}_SM:{x_0.tag},{x_1.tag}.- Variables:
is_basis (bool) – True if this operator is not formed through a linear combination of other operators. False otherwise.
tags (list[str]) – A list that contains tags that can be used to identify the
Operatorobject. Tags should be unique.math_expr (
MathExpr) – AMathExprobject with a member variable that contains a mathematical expression represented as a string.
- add_tag(tag: str) Operator#
Add a new tag for this
Operatorobject.- Parameters:
tag (str) – The new tag to be added to the tags list.
- apply(point: Vector) Vector#
Returns a
Vectorobject that is the output of theOperatorapplied on the givenVector.
- get_interpolation_constraints_by_group(pep_context: PEPContext | None = None) ConstraintData#
When implemented, structure the types of constraints as a list of related
ScalarConstraintor individualPSDConstraintobjects.
- resolvent(x: Vector, stepsize: numbers.Number | Parameter, tag: str | None = None) Vector#
Apply the resolvent of this operator on the input \(x\).
Define the resolvent operator as
\[J_{\gamma A} := (I+\gamma A)^{-1},\]where \(I\) is the identity operator.
This function returns the output
Vector\(u\) found from applying the resolvent of thisOperator\(A\) on the inputVector\(x\) with stepsize \(\gamma\).- Parameters:
- Returns:
Vector– The output of the resolvent applied on x.
Note
For children of
Operatorfor which the resolvent is not defined, overwrite the function to raise NotImplemented.
- set_fixed_point(name: str) Vector#
Return a fixed point for this
Operatorobject.A
Operatorobject can only have one fixed point.
Duplet#
Linear Operator#
- class pepflow.LinearOperator(*, is_basis: bool, composition: AddedOper | ScaledOper | None = None, tags: list[str] = NOTHING, math_expr: MathExpr = NOTHING, M: NUMERICAL_TYPE | Parameter)#
Bases:
OperatorThe
LinearOperatorclass represents a bounded, linear operator.The
LinearOperatorclass is a child ofOperator.A bounded linear operator has an operator norm \(M\). We can instantiate a
LinearOperatorobject as follows:Example
>>> import pepflow as pf >>> A = pf.LinearOperator(is_basis=True, tags=["A"], M=1)
We can access the transpose of a
LinearOperatorobject as follows:Example
>>> import pepflow as pf >>> A = pf.LinearOperator(is_basis=True, tags=["A"], M=1) >>> A.T
- add_tag(tag: str) Operator#
Add a new tag for this
Operatorobject.- Parameters:
tag (str) – The new tag to be added to the tags list.
- get_interpolation_constraints_by_group(pep_context: PEPContext | None = None) ConstraintData#
Return a
ConstraintDataobject that manages the operator’s groups of interpolation conditions.References
N. Bousselmi, J. M. Hendrickx, and F. Glineur, Interpolation Conditions for Linear Operators and Applications to Performance Estimation Problems, SIAM Journal on Optimization, 34 (2024), pp. 3033–3063.
- resolvent(x: Vector, stepsize: numbers.Number | Parameter, tag: str | None = None) Vector#
Note
The resolvent is not implemented for
LinearOperator.
Monotone Operator#
- class pepflow.MonotoneOperator(*, is_basis: bool, composition: AddedOper | ScaledOper | None = None, tags: list[str] = NOTHING, math_expr: MathExpr = NOTHING)#
Bases:
OperatorThe
MonotoneOperatorclass represents a monotone operator.The
MonotoneOperatorclass is a child ofOperator.We can instantiate a
MonotoneOperatorobject as follows:Example
>>> import pepflow as pf >>> A = pf.MonotoneOperator(is_basis=True, tags=["A"])
- add_tag(tag: str) MonotoneOperator#
Add a new tag for this
MonotoneOperatorobject.- Parameters:
tag (str) – The new tag to be added to the tags list.
- get_interpolation_constraints_by_group(pep_context: PEPContext | None = None) ConstraintData#
Return a
ConstraintDataobject that manages the operator’s groups of interpolation conditions.
- interp_ineq(p1: Vector | str, p2: Vector | str, pep_context: PEPContext | None = None) Scalar#
Generate the interpolation inequality
Scalarobject between twoVectorobjects through the objects themselves or their tags.The interpolation inequality between two points \(p_1, p_2\) for a monotone operator \(A\) is
\[- \langle A(p_1) - A(p_2), p_1 - p_2 \rangle \leq 0.\]References
H. H. Bauschke and P. L. Combettes, Convex Analysis and Monotone Operator Theory in Hilbert Spaces, 2017.
E. K. Ryu, A. B. Taylor, C. Bergeling, and P. Giselsson, Operator splitting performance estimation: Tight contraction factors and optimal parameter selection, SIAM Journal on Optimization, 30 (2020), pp. 2251–2271.