InterpolatedLinearOperator#

class InterpolatedLinearOperator(training_parameters=None, entries=None, InterpolatorClass: type = None, fromblock=False)[source]#

Parametric linear operator \(\Ophat_{\ell}(\qhat,\u;\bfmu) = \Ahat(\bfmu)\qhat\) where \(\Ahat(\bfmu) \in \RR^{r \times r}\) and the parametric dependence is handled with elementwise interpolation.

\[\Ahat(\bfmu) = \textrm{interpolate}( (\bfmu_1,\Ahat^{(1)}),\ldots,(\bfmu_s,\Ahat^{(s)}); \bfmu)\]

Here,

  • \(\bfmu_1,\ldots,\bfmu_s\in\RR^p\) are the (fixed) training parameter values, and

  • \(\Ahat^{(i)} = \Ahat(\bfmu_i) \in \RR^{r \times r}\) are the operator entries evaluated at the training parameter values.

See opinf.operators.LinearOperator

Parameters
training_parameterslist of s scalars or (p,) 1D ndarrays

Parameter values for which the operator entries are known or will be inferred from data. If not provided in the constructor, use set_training_parameters() later.

entrieslist of s ndarrays, or None

Operator entries corresponding to the training_parameters. If not provided in the constructor, use set_entries() later.

InterpolatorClasstype or None

Class for the elementwise interpolation. Must obey the syntax

>>> interpolator = InterpolatorClass(data_points, data_values)
>>> interpolator_evaluation = interpolator(new_data_point)

This can be, e.g., a class from scipy.interpolate. If None (default), use scipy.interpolate.CubicSpline for one-dimensional parameters and scipy.interpolate.LinearNDInterpolator otherwise. If not provided in the constructor, use set_interpolator() later.

fromblockbool

If True, interpret entries as a horizontal concatenation of arrays; if False (default), interpret entries as a list of arrays.

Properties

OperatorClass

Nonparametric opinf.operators class that represents this parametric operator evaluated at a particular parameter value.

entries

Operator entries corresponding to the training parameters values, i.e., entries[i] are the operator entries corresponding to the parameter value training_parameters[i].

interpolator

Interpolator object for evaluating the operator at specified parameter values.

parameter_dimension

Dimension of the parameters \(\bfmu\) that the operator acts on.

shape

Shape of the operator entries matrix when evaluated at a parameter value.

state_dimension

Dimension of the state \(\qhat\) that the operator acts on.

training_parameters

Parameter values for which the operator entries are known.

Methods

apply

Apply the operator to the given state and input at the specified parameter value, \(\Ophat_\ell(\qhat,\u;\bfmu)\).

copy

Return a copy of the operator.

datablock

Return the data matrix block corresponding to the operator.

evaluate

Evaluate the operator at the given parameter value, \(\Ophat_{\ell}(\cdot,\cdot;\bfmu)\).

galerkin

Project this operator to a low-dimensional linear space.

jacobian

Construct the state Jacobian of the operator, \(\ddqhat\Ophat_\ell(\qhat,\u;\bfmu)\).

load

Load a parametric operator from an HDF5 file.

operator_dimension

Number of columns sd in the concatenated operator matrix \([~\Ohat_{\ell}^{(1)}~~\cdots~~\Ohat_{\ell}^{(s)}~]\).

save

Save the operator to an HDF5 file.

set_entries

Set the operator entries, the matrices \(\Ohat_{\ell}^{(1)},\ldots,\Ohat_{\ell}^{(s)}\).

set_interpolator

Construct the interpolator for the operator entries.

set_training_parameters

Set the training parameter values.