PowerOperator

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

Bases: odl.operator.operator.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(self, x[, out])

Take the power of x and write to out if given.

derivative(self, point)

Derivative of this operator.

norm(self[, estimate])

Return the operator norm of this operator.

__init__(self, 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