ComplexEmbedding

class odl.ComplexEmbedding(*args, **kwargs)

Bases: Operator

Operator that embeds a vector into a complex space.

Implements:

ComplexEmbedding(space)(x) <==> space.complex_space.element(x)
__init__(space, scalar=1.0)[source]

Initialize a new instance.

Parameters

spaceTensorSpace

Space that should be embedded into its complex counterpart. It must implement TensorSpace.complex_space.

scalarspace.complex_space.field element, optional

Scalar to be multiplied with incoming vectors in order to get the complex vector.

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])