pylops_distributed.Spread

class pylops_distributed.Spread(dims, dimsd, table=None, dtable=None, compute=(False, False), todask=(False, False), 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.

Parameters:
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 or dask.array.core.Array, optional

Look-up table of indeces of size \([n_x \times n_{x0} \times n_{t0}]\)

dtable : np.ndarray or dask.array.core.Array, optional

Look-up table of decimals remainders for linear interpolation of same size as dtable

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'

compute : tuple, optional

Compute the outcome of forward and adjoint or simply define the graph and return a dask.array

todask : tuple, optional

Apply dask.array.from_array to model and data before applying forward and adjoint respectively

dtype : str, optional

Type of elements in input array.

Raises:
KeyError

If engine is neither numpy nor numba

NotImplementedError

If both table and fh are not provided

ValueError

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

Notes

Refer to pylops.basicoperators.Spread for implementation details.

Attributes:
shape : tuple

Operator shape

explicit : bool

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

Methods

__init__(dims, dimsd[, table, dtable, …]) 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-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) Adjoint matrix-matrix multiplication.
rmatvec(x) Adjoint Matrix-vector multiplication.
todense() Return dense matrix.
tosparse() Return sparse matrix.
transpose() Transpose this linear operator.