pylops.LinearOperator¶
- class pylops.LinearOperator(*args, **kwargs)[source]¶
Common interface for performing matrix-vector products.
This class is an overload of the
scipy.sparse.linalg.LinearOperator
class. It adds functionalities by overloading standard operators such as__truediv__
as well as creating convenience methods such aseigs
,cond
, andconj
.Note
End users of PyLops should not use this class directly but simply use operators that are already implemented. This class is meant for developers and it has to be used as the parent class of any new operator developed within PyLops. Find more details regarding implementation of new operators at Implementing new operators.
- Parameters
- Op
scipy.sparse.linalg.LinearOperator
orscipy.sparse.linalg._ProductLinearOperator
orscipy.sparse.linalg._SumLinearOperator
Operator. If other arguments are provided, they will overwrite those obtained from
Op
.- dtype
str
, optional Type of elements in input array.
- shape
tuple(int, int)
, optional Shape of operator. If not provided, obtained from
dims
anddimsd
.- dims
tuple(int, ..., int)
, optional New in version 2.0.0.
Dimensions of model. If not provided,
(self.shape[1],)
is used.- dimsd
tuple(int, ..., int)
, optional New in version 2.0.0.
Dimensions of data. If not provided,
(self.shape[0],)
is used.- explicit
bool
, optional Operator contains a matrix that can be solved explicitly (
True
) or not (False
). Defaults toFalse
.- clinear
bool
, optional New in version 1.17.0.
Operator is complex-linear. Defaults to
True
.- name
str
, optional New in version 2.0.0.
Name of operator (to be used by
pylops.utils.describe.describe
)
- Op
Methods
__init__
([Op, dtype, shape, dims, dimsd, ...])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, densesolver])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.
reset_count
()Reset counters
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.
trace
([neval, method, backend])Trace of linear operator.
transpose
()Transpose this linear operator.
Examples using pylops.LinearOperator
¶
Normal Moveout (NMO) Correction
Operators with Multiprocessing
Total Variation (TV) Regularization
09. Multi-Dimensional Deconvolution
14. Seismic wavefield decomposition