PowerOperator

class odl.operator.default_ops.PowerOperator(*args, **kwargs)[source]

Bases: Operator

Operator taking a fixed power of a space or field element.

Implements:

PowerOperator(p)(x) == x ** p

Here, x is a LinearSpaceElement or Field element and p is a number. Hence, this operator can be defined either on a LinearSpace or on a Field.

Attributes:
adjoint

Adjoint of this operator (abstract).

domain

Set of objects on which this operator can be evaluated.

exponent

Power of the input element to take.

inverse

Return the operator inverse.

is_functional

True if this operator's range is a Field.

is_linear

True if this operator is linear.

range

Set in which the result of an evaluation of this operator lies.

Methods

__call__(x[, out])

Return self(x[, out, **kwargs]).

derivative(point)

Derivative of this operator.

norm([estimate])

Return the operator norm of this operator.

__init__(domain, exponent)[source]

Initialize a new instance.

Parameters:
domainLinearSpace or Field

Set of elements on which the operator can be applied.

exponentfloat

Exponent parameter of the power function applied to an element.

Examples

Use with vectors

>>> op = PowerOperator(odl.rn(3), exponent=2)
>>> op([1, 2, 3])
rn(3).element([ 1.,  4.,  9.])

or scalars

>>> op = PowerOperator(odl.RealNumbers(), exponent=2)
>>> op(2.0)
4.0