ComplexEmbedding¶
- class odl.operator.default_ops.ComplexEmbedding(*args, **kwargs)[source]¶
Bases:
Operator
Operator that embeds a vector into a complex space.
Implements:
ComplexEmbedding(space)(x) <==> space.complex_space.element(x)
- Attributes:
Methods
__call__
(x[, out])Return
self(x[, out, **kwargs])
.derivative
(point)Return the operator derivative at
point
.norm
([estimate])Return the operator norm of this operator.
- __init__(space, scalar=1.0)[source]¶
Initialize a new instance.
- Parameters:
- space
TensorSpace
Space that should be embedded into its complex counterpart. It must implement
TensorSpace.complex_space
.- scalar
space.complex_space.field
element, optional Scalar to be multiplied with incoming vectors in order to get the complex vector.
- space
Examples
Embed real vector into complex space:
>>> r3 = odl.rn(3) >>> op = ComplexEmbedding(r3) >>> op([1, 2, 3]) cn(3).element([ 1.+0.j, 2.+0.j, 3.+0.j])
Embed real vector as imaginary part into complex space:
>>> op = ComplexEmbedding(r3, scalar=1j) >>> op([1, 2, 3]) cn(3).element([ 0.+1.j, 0.+2.j, 0.+3.j])
On complex spaces the operator is the same as simple multiplication by scalar:
>>> c3 = odl.cn(3) >>> op = ComplexEmbedding(c3, scalar=1 + 2j) >>> op([1 + 1j, 2 + 2j, 3 + 3j]) cn(3).element([-1.+3.j, -2.+6.j, -3.+9.j])