src.operators

Methods related to the problem’s forward operator and Hilbert spaces.

The Hilbert spaces are implicitly defined via the functons in this module. A priory, these are numpy.ndarray of type complex objects, representing a finite dimensional complex space.

This module has certain global variables to be used by the defined methods. These are set by src.DGCG.set_model_parameters()

Global variables

test_funccallable

Function representing the kernel that defines the forward operator.

grad_test_funccallable

Derivative function of test_func

H_dimensionslist[int]

Dimensions of each of the considered Hilbert spaces.

Module Contents

Functions

H_t_product(t, f_t, g_t)

Computes the Hilbert space product between two elements in H_t.

H_t_product_set_vector(t, f_t, g_t)

Hilbert space product between a set of elements vs a single one.

int_time_H_t_product(f, g)

Time integral of two collections of elements in each Hilbert space.

K_t(t, f_t)

Evaluation of pre-adjoint forward operator of the inverse problem.

grad_K_t(t, f)

K_t_star(t, rho)

Evaluation of forward operator of the inverse problem.

K_t_star_full(rho)

Evaluation of forward operator of the inverse problem at all times.

overpenalization(s, M_0)

Overpenalization of the main inverse problem energy.

main_energy(rho, f)

The main energy to minimize by the inverse problem.

src.operators.TEST_FUNC
src.operators.GRAD_TEST_FUNC
src.operators.H_DIMENSIONS
src.operators.H_t_product(t, f_t, g_t)

Computes the Hilbert space product between two elements in H_t.

H_t represents the Hilbert space at time t. The implemented Hilbert space consists of the normalized real part of the complex dot product

Parameters
tint

Index of the referenced time sample. Takes values in 0,1,…,T. With (T+1) the total number of time samples.

f_t, g_tnumpy.ndarray

1-dimenisonal complex array representing an element of the Hilbert space at time t, H_t.

Returns
float

Notes

The computed formula is

<f_t,g_t>_{H_t} = Re(<f_t, g_t>_{\mathbb{C}})/dim(H_t)
= Re( \sum_k f_t(k)\overline g_t(k))/dim(H_t)

The Hilbert spaces must be real, meaning that the output of the inner product has to be a real number. In the implemented case here, we considered realified complex spaces.

src.operators.H_t_product_set_vector(t, f_t, g_t)

Hilbert space product between a set of elements vs a single one.

An extension for fast evaluation between groups of elements.

Parameters
tint

Index of the references time sample. Takes values in 0,1,…,T, where (T+1) the total number of time samples.

f_tnumpy.ndarray

(N,K) shaped complex array representing a collection of N elements of the Hilbert space at time t H_t with dimension K.

g_tnumpy.ndarray

1-dimensional complex array representing an element of the Hilbert space at time t H_t.

Returns
numpy.ndarray

(N,1)-dimensional float array with N the number of elements of the input collection f_t.

src.operators.int_time_H_t_product(f, g)

Time integral of two collections of elements in each Hilbert space.

A time integral in this context corresponds to the time average. Therefore this method computes the time average of the Hilbert space inner products.

Parameters
f,glist[numpy.ndarray]

A list of size T, where the t-th entry contains an element of the Hilbert space at time t, H_t.

Returns
float

Notes

Precisely, the computed value is

\sum_{t=0}^T w(t) <f_t, g_t>_{H_t}

with w(t) some weight at time t, by default it is 1/T, with T the total number of time samples. To change the way the spaces are weighted in this integral, modify config.time_weights.

src.operators.K_t(t, f_t)

Evaluation of pre-adjoint forward operator of the inverse problem.

Defines/evaluates the preadjoint of the forward operator at time sample t and element f of the t-th Hilbert space. The preadjoint maps into continuous functions.

Parameters
tint

Index of the considered time sample. Takes values from 0,1,…,T-1

fnumpy.ndarray

1-dimensional complex array representing a member of the t-th Hilbert space H_t.

Returns
callable[numpy.ndarray, numpy.ndarray]

function that takes (N,2)-sized arrays represnting N points in the domain Ω, and returns a (N,1)-sized array.

Notes

The preadjoint at time sample t is a function that maps from the Hilbert space H_t to the space of continuous functions on the domain C(\Omega). The formula that defines this mapping is

K_t(f_f) = x \rightarrow <\varphi(t,x), f_t>_{H_t}

With \varphi the function TEST_FUNC input via src.DGCG.set_model_parameters.

src.operators.grad_K_t(t, f)
src.operators.K_t_star(t, rho)

Evaluation of forward operator of the inverse problem.

Evaluates the forward operator at time sample t and measure rho. The forward operator at time t maps into the t-th Hilbert space H_t.

Parameters
tint

Index of the considered time sample. Takes values from 0,1,…,T, where (T+1) is the total number of time samples of the inverse problem.

rhosrc.classes.measure

Measure where the forward operator is evaluated.

Returns
numpy.ndarray

1-dimensional complex array, representing an element of the t-th Hilbert space H_t

Notes

The forward operator at time sample t is a function that maps from the space of Radon measures \mathcal{M}(\Omega) to the t-th Hilbert space H_t. The input measure of class src.classes.curve is a dynamic measure, that once evaluated at time t, becomes a Radon Measure.

The formula that defines this function is the following Bochner integral

K_t^*(\rho_t) = \int_{\Omega} \varphi(t,x) \rho_t(dx)

With \varphi the function TEST_FUNC input via src.DGCG.set_model_parameters.

src.operators.K_t_star_full(rho)

Evaluation of forward operator of the inverse problem at all times.

Evaluates the forward operator at all time samples and dynamic measure rho. The output of this method is a list of elements in H_t.

Parameters
rhosrc.classes.measure

Measure where the forward operator is evaluated.

Returns
list[numpy.ndarray]

T-sized list of 1-dimensional complex arrays, representing elements of the Hilbert spaces H_t

Notes

For further reference, see src.operators.K_t_star().

src.operators.overpenalization(s, M_0)

Overpenalization of the main inverse problem energy.

Parameters
s, M_0float
Returns
float

Notes

This function is the one applied to the Benamou-Brenier energy when defining the surrogate linear problem described in the paper. It is a C^1 gluing of a linear and quadratic function.

src.operators.main_energy(rho, f)

The main energy to minimize by the inverse problem.

Parameters
measuresrc.classes.measure

Radon measure.

flist[numpy.ndarray]

list of elements of the Hilbert spaces H_t

Returns
float

Notes

Implements the formula

\frac{1}{2T} \sum_{t=0}^{T-1} || K_t^*(\rho_t) - f_t ||_{H_t}^2 +
J_{\alpha, \beta}(\rho, m)

Where m is the momentum, that is implicitly defined for sparse measures as the ones used here.