pylops.LinearOperator#

class pylops.LinearOperator(Op=None, dtype=None, shape=None, dims=None, dimsd=None, clinear=None, explicit=None, forceflat=None, name=None)[source]#

Common interface for performing matrix-vector products.

This class acts as an abstract interface between matrix-like objects and iterative solvers, providing methods to perform matrix-vector and adjoint matrix-vector products as as well as convenience methods such as eigs, cond, and conj.

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
Opscipy.sparse.linalg.LinearOperator or pylops.linearoperator.LinearOperator

Operator. If other arguments are provided, they will overwrite those obtained from Op.

dtypestr, optional

Type of elements in input array.

shapetuple(int, int), optional

Shape of operator. If not provided, obtained from dims and dimsd.

dimstuple(int, ..., int), optional

New in version 2.0.0.

Dimensions of model. If not provided, (self.shape[1],) is used.

dimsdtuple(int, ..., int), optional

New in version 2.0.0.

Dimensions of data. If not provided, (self.shape[0],) is used.

clinearbool, optional

New in version 1.17.0.

Operator is complex-linear. Defaults to True.

explicitbool, optional

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

forceflatbool, optional

New in version 2.2.0.

Force an array to be flattened after matvec/rmatvec if the input is ambiguous (i.e., is a 1D array both when operating with ND arrays and with 1D arrays). Defaults to None for operators that have no ambiguity or to True for those with ambiguity.

namestr, optional

New in version 2.0.0.

Name of operator (to be used by pylops.utils.describe.describe)

Methods

__init__([Op, dtype, shape, dims, dimsd, ...])

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()

Examples using pylops.LinearOperator#

1D Smoothing

1D Smoothing

1D, 2D and 3D Sliding

1D, 2D and 3D Sliding

2D Smoothing

2D Smoothing

AVO modelling

AVO modelling

Acoustic Wave Equation modelling

Acoustic Wave Equation modelling

Bayesian Linear Regression

Bayesian Linear Regression

Bilinear Interpolation

Bilinear Interpolation

Blending

Blending

CGLS and LSQR Solvers

CGLS and LSQR Solvers

Causal Integration

Causal Integration

Chirp Radon Transform

Chirp Radon Transform

Conj

Conj

Convolution

Convolution

Derivatives

Derivatives

Describe

Describe

Diagonal

Diagonal

Discrete Cosine Transform

Discrete Cosine Transform

Dual-Tree Complex Wavelet Transform

Dual-Tree Complex Wavelet Transform

Flip along an axis

Flip along an axis

Fourier Radon Transform

Fourier Radon Transform

Identity

Identity

Imag

Imag

L1-L1 IRLS

L1-L1 IRLS

Linear Regression

Linear Regression

MP, OMP, ISTA and FISTA

MP, OMP, ISTA and FISTA

Matrix Multiplication

Matrix Multiplication

Non-stationary Convolution

Non-stationary Convolution

Non-stationary Filter Estimation

Non-stationary Filter Estimation

Normal Moveout (NMO) Correction

Normal Moveout (NMO) Correction

Operators concatenation

Operators concatenation

Operators with Multiprocessing

Operators with Multiprocessing

Padding

Padding

Patching

Patching

Polynomial Regression

Polynomial Regression

Real

Real

Restriction and Interpolation

Restriction and Interpolation

Roll

Roll

Seislet transform

Seislet transform

Spread How-to

Spread How-to

Sum

Sum

Symmetrize

Symmetrize

Total Variation (TV) Regularization

Total Variation (TV) Regularization

Transpose

Transpose

Wavelet estimation

Wavelet estimation

Wavelet transform

Wavelet transform

Zero

Zero

01. The LinearOperator

01. The LinearOperator

02. The Dot-Test

02. The Dot-Test

03. Solvers

03. Solvers

03. Solvers (Advanced)

03. Solvers (Advanced)

04. Bayesian Inversion

04. Bayesian Inversion

05. Image deblurring

05. Image deblurring

06. 2D Interpolation

06. 2D Interpolation

08. Pre-stack (AVO) inversion

08. Pre-stack (AVO) inversion

12. Seismic regularization

12. Seismic regularization

16. CT Scan Imaging

16. CT Scan Imaging

17. Real/Complex Inversion

17. Real/Complex Inversion

18. Deblending

18. Deblending

19. Image Domain Least-squares migration

19. Image Domain Least-squares migration

20. Torch Operator

20. Torch Operator

21. JAX Operator

21. JAX Operator