class pylops.Spread(dims, dimsd, table=None, dtable=None, fh=None, interp=False, engine='numpy', dtype='float64')[source]

Spread operator.

Spread values from the input model vector arranged as a 2-dimensional array of size \([n_{x0} \times n_{t0}]\) into the data vector of size \([n_x \times n_t]\). Spreading is performed along parametric curves provided as look-up table of pre-computed indices (table) or computed on-the-fly using a function handle (fh).

In adjont mode, values from the data vector are instead stacked along the same parametric curves.

dims : tuple

Dimensions of model vector (vector will be reshaped internally into a two-dimensional array of size \([n_{x0} \times n_{t0}]\), where the first dimension is the spreading/stacking direction)

dimsd : tuple

Dimensions of model vector (vector will be reshaped internal into a two-dimensional array of size \([n_x \times n_t]\))

table : np.ndarray, optional

Look-up table of indeces of size \([n_{x0} \times n_{t0} \times n_x]\) (if None use function handle fh)

dtable : np.ndarray, optional

Look-up table of decimals remainders for linear interpolation of size \([n_{x0} \times n_{t0} \times n_x]\) (if None use function handle fh)

fh : np.ndarray, optional

Function handle that returns an index (and a fractional value in case of interp=True) to be used for spreading/stacking given indices in \(x0\) and \(t\) axes (if None use look-up table table)

interp : bool, optional

Apply linear interpolation (True) or nearest interpolation (False) during stacking/spreading along parametric curve. To be used only if engine='numba', inferred directly from the number of outputs of fh for engine='numpy'

engine : str, optional

Engine used for fft computation (numpy or numba). Note that numba can only be used when providing a look-up table

dtype : str, optional

Type of elements in input array.


If engine is neither numpy nor numba


If both table and fh are not provided


If table has shape different from \([n_{x0} \times n_t0 \times n_x]\)


The Spread operator applies the following linear transform in forward mode to the model vector after reshaping it into a 2-dimensional array of size \([n_x \times n_t]\):

\[m(x0, t_0) \rightarrow d(x, t=f(x0, x, t_0))\]

where \(f(x0, x, t)\) is a mapping function that returns a value t given values \(x0\), \(x\), and \(t_0\).

In adjoint mode, the model is reconstructed by means of the following stacking operation:

\[m(x0, t_0) = \int{d(x, t=f(x0, x, t_0))} dx\]

Note that table (or fh) must return integer numbers representing indices in the axis \(t\). However it also possible to perform linear interpolation as part of the spreading/stacking process by providing the decimal part of the mapping function (\(t - \lfloor t \rfloor\)) either in dtable input parameter or as second value in the return of fh function.

shape : tuple

Operator shape

explicit : bool

Operator contains a matrix that can be solved explicitly (True) or not (False)


__init__(dims, dimsd[, table, dtable, fh, …]) Initialize this LinearOperator.
adjoint() Hermitian adjoint.
apply_columns(cols) Apply subset of columns of operator
cond([uselobpcg]) Condition number of linear operator.
conj() Complex conjugate operator
div(y[, niter]) Solve the linear problem \(\mathbf{y}=\mathbf{A}\mathbf{x}\).
dot(x) Matrix-matrix or matrix-vector multiplication.
eigs([neigs, symmetric, niter, uselobpcg]) Most significant eigenvalues of linear operator.
matmat(X) Matrix-matrix multiplication.
matvec(x) Matrix-vector multiplication.
rmatmat(X) Matrix-matrix multiplication.
rmatvec(x) Adjoint matrix-vector multiplication.
todense([backend]) Return dense matrix.
toimag([forw, adj]) Imag operator
toreal([forw, adj]) Real operator
tosparse() Return sparse matrix.
transpose() Transpose this linear operator.