ProductSpaceOperator¶
- class odl.operator.pspace_ops.ProductSpaceOperator(*args, **kwargs)[source]¶
Bases:
OperatorA "matrix of operators" on product spaces.
For example a matrix of operators can act on a vector by
ProductSpaceOperator([[A, B], [C, D]])([x, y]) = [A(x) + B(y), C(x) + D(y)]See also
BroadcastOperatorCase when a single argument is used by several ops.
ReductionOperatorCalculates sum of operator results.
DiagonalOperatorCase where the 'matrix' is diagonal.
Notes
This is intended for the case where an operator can be decomposed as a linear combination of "sub-operators", e.g.

Mathematically, a
ProductSpaceOperatoris an operator
between product spaces
and
which can be written in the form
with component operators
.Its action on a vector
is defined as
the matrix multiplication![[\mathcal{A}(x)]_i = \sum_{j=1}^m \mathcal{A}_{ij}(x_j).](../_images/math/b1f25bce1211b77cd3d6afdc05fa2bc3087bb92f.png)
- Attributes:
adjointAdjoint of this operator.
domainSet of objects on which this operator can be evaluated.
inverseReturn the operator inverse.
is_functionalTrueif this operator's range is aField.is_linearTrueif this operator is linear.opsThe sparse operator matrix representing this operator.
rangeSet in which the result of an evaluation of this operator lies.
shapeShape of the matrix of operators.
sizeTotal size of the matrix of operators.
Methods
__call__(x[, out])Return
self(x[, out, **kwargs]).derivative(x)Derivative of the product space operator.
norm([estimate])Return the operator norm of this operator.
- __init__(operators, domain=None, range=None)[source]¶
Initialize a new instance.
- Parameters:
- operators
array-like An array of
Operator's, must be 2-dimensional.- domain
ProductSpace, optional Domain of the operator. If not provided, it is tried to be inferred from the operators. This requires each column to contain at least one operator.
- range
ProductSpace, optional Range of the operator. If not provided, it is tried to be inferred from the operators. This requires each row to contain at least one operator.
- operators
Examples
>>> r3 = odl.rn(3) >>> pspace = odl.ProductSpace(r3, r3) >>> I = odl.IdentityOperator(r3) >>> x = pspace.element([[1, 2, 3], ... [4, 5, 6]])
Create an operator that sums two inputs:
>>> prod_op = odl.ProductSpaceOperator([[I, I]]) >>> prod_op(x) ProductSpace(rn(3), 1).element([ [ 5., 7., 9.] ])
Diagonal operator -- 0 or
Nonemeans ignore, or the implicit zero operator:>>> prod_op = odl.ProductSpaceOperator([[I, 0], ... [0, I]]) >>> prod_op(x) ProductSpace(rn(3), 2).element([ [ 1., 2., 3.], [ 4., 5., 6.] ])
If a column is empty, the operator domain must be specified. The same holds for an empty row and the range of the operator:
>>> prod_op = odl.ProductSpaceOperator([[I, 0], ... [I, 0]], domain=r3 ** 2) >>> prod_op(x) ProductSpace(rn(3), 2).element([ [ 1., 2., 3.], [ 1., 2., 3.] ]) >>> prod_op = odl.ProductSpaceOperator([[I, I], ... [0, 0]], range=r3 ** 2) >>> prod_op(x) ProductSpace(rn(3), 2).element([ [ 5., 7., 9.], [ 0., 0., 0.] ])