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 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 scipy.sparse.linalg._ProductLinearOperator or scipy.sparse.linalg._SumLinearOperator

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.

explicitbool, optional

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

clinearbool, optional

New in version 1.17.0.

Operator is complex-linear. Defaults to True.

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, ...])

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

1D, 2D and 3D Sliding

1D, 2D and 3D Sliding

1D, 2D and 3D Sliding
AVO modelling

AVO modelling

AVO modelling
Bilinear Interpolation

Bilinear Interpolation

Bilinear Interpolation
CGLS and LSQR Solvers

CGLS and LSQR Solvers

CGLS and LSQR Solvers
Causal Integration

Causal Integration

Causal Integration
Chirp Radon Transform

Chirp Radon Transform

Chirp Radon Transform
Conj

Conj

Conj
Convolution

Convolution

Convolution
Derivatives

Derivatives

Derivatives
Describe

Describe

Describe
Diagonal

Diagonal

Diagonal
Flip along an axis

Flip along an axis

Flip along an axis
Identity

Identity

Identity
Imag

Imag

Imag
Linear Regression

Linear Regression

Linear Regression
MP, OMP, ISTA and FISTA

MP, OMP, ISTA and FISTA

MP, OMP, ISTA and FISTA
Matrix Multiplication

Matrix Multiplication

Matrix Multiplication
Multi-Dimensional Convolution

Multi-Dimensional Convolution

Multi-Dimensional Convolution
Normal Moveout (NMO) Correction

Normal Moveout (NMO) Correction

Normal Moveout (NMO) Correction
Operators concatenation

Operators concatenation

Operators concatenation
Operators with Multiprocessing

Operators with Multiprocessing

Operators with Multiprocessing
Padding

Padding

Padding
Patching

Patching

Patching
PhaseShift operator

PhaseShift operator

PhaseShift operator
Polynomial Regression

Polynomial Regression

Polynomial Regression
Pre-stack modelling

Pre-stack modelling

Pre-stack modelling
Real

Real

Real
Restriction and Interpolation

Restriction and Interpolation

Restriction and Interpolation
Roll

Roll

Roll
Seislet transform

Seislet transform

Seislet transform
Shift

Shift

Shift
Spread How-to

Spread How-to

Spread How-to
Sum

Sum

Sum
Symmetrize

Symmetrize

Symmetrize
Total Variation (TV) Regularization

Total Variation (TV) Regularization

Total Variation (TV) Regularization
Transpose

Transpose

Transpose
Wavelet estimation

Wavelet estimation

Wavelet estimation
Wavelet transform

Wavelet transform

Wavelet transform
Zero

Zero

Zero
01. The LinearOpeator

01. The LinearOpeator

01. The LinearOpeator
02. The Dot-Test

02. The Dot-Test

02. The Dot-Test
03. Solvers

03. Solvers

03. Solvers
03. Solvers (Advanced)

03. Solvers (Advanced)

03. Solvers (Advanced)
04. Bayesian Inversion

04. Bayesian Inversion

04. Bayesian Inversion
05. Image deblurring

05. Image deblurring

05. Image deblurring
06. 2D Interpolation

06. 2D Interpolation

06. 2D Interpolation
07. Post-stack inversion

07. Post-stack inversion

07. Post-stack inversion
08. Pre-stack (AVO) inversion

08. Pre-stack (AVO) inversion

08. Pre-stack (AVO) inversion
09. Multi-Dimensional Deconvolution

09. Multi-Dimensional Deconvolution

09. Multi-Dimensional Deconvolution
12. Seismic regularization

12. Seismic regularization

12. Seismic regularization
14. Seismic wavefield decomposition

14. Seismic wavefield decomposition

14. Seismic wavefield decomposition
16. CT Scan Imaging

16. CT Scan Imaging

16. CT Scan Imaging
17. Real/Complex Inversion

17. Real/Complex Inversion

17. Real/Complex Inversion
18. Deblending

18. Deblending

18. Deblending
19. Automatic Differentiation

19. Automatic Differentiation

19. Automatic Differentiation