PyLops API

The Application Programming Interface (API) of PyLops can be loosely seen as composed of a stack of three main layers:

  • Linear operators: building blocks for the setting up of inverse problems
  • Solvers: interfaces to a variety of solvers, providing an easy way to augment an inverse problem with additional regularization and/or preconditioning term
  • Applications: high-level interfaces allowing users to easily setup and solve specific problems (while hiding the non-needed details - i.e., creation and setup of linear operators and solvers).

Linear operators


LinearOperator([Op, explicit]) Common interface for performing matrix-vector products.
FunctionOperator(f, *args, **kwargs) Function Operator.

Basic operators

MatrixMult(A[, dims, dtype]) Matrix multiplication.
Identity(N[, M, dtype, inplace]) Identity operator.
Zero(N[, M, dtype]) Zero operator.
Diagonal(diag[, dims, dir, dtype]) Diagonal operator.
Transpose(dims, axes[, dtype]) Transpose operator.
Flip(N[, dims, dir, dtype]) Flip along an axis.
Roll(N[, dims, dir, shift, dtype]) Roll along an axis.
Symmetrize(N[, dims, dir, dtype]) Symmetrize along an axis.
Restriction(M, iava[, dims, dir, dtype, inplace]) Restriction (or sampling) operator.
Regression(taxis, order[, dtype]) Polynomial regression.
LinearRegression(taxis[, dtype]) Linear regression.
CausalIntegration(N[, dims, dir, sampling, …]) Causal integration.
Spread(dims, dimsd[, table, dtable, fh, …]) Spread operator.
VStack(ops[, dtype]) Vertical stacking.
HStack(ops[, dtype]) Horizontal stacking.
Block(ops[, dtype]) Block operator.
BlockDiag(ops[, dtype]) Block-diagonal operator.
Kronecker(Op1, Op2[, dtype]) Kronecker operator.

Smoothing and derivatives

Smoothing1D(nsmooth, dims[, dir, dtype]) 1D Smoothing.
Smoothing2D(nsmooth, dims[, nodir, dtype]) 2D Smoothing.
FirstDerivative(N[, dims, dir, sampling, …]) First derivative.
SecondDerivative(N[, dims, dir, sampling, …]) Second derivative.
Laplacian(dims[, dirs, weights, sampling, …]) Laplacian.

Signal processing

FFT(dims[, dir, nfft, sampling, real, …]) One dimensional Fast-Fourier Transform.
FFT2D(dims[, dirs, nffts, sampling, dtype]) Two dimensional Fast-Fourier Transform.
FFTND(dims[, dirs, nffts, sampling, dtype]) N-dimensional Fast-Fourier Transform.
Convolve1D(N, h[, offset, dims, dir, dtype]) 1D convolution operator.
Convolve2D(N, h, dims[, offset, nodir, dtype]) 2D convolution operator.
Interp(M, iava[, dims, dir, kind, dtype]) Interpolation operator.
Radon2D(taxis, haxis, pxaxis[, kind, …]) Two dimensional Radon transform.
Radon3D(taxis, hyaxis, hxaxis, pyaxis, pxaxis) Three dimensional Radon transform.
Sliding2D(Op, dims, dimsd, nwin, nover[, …]) 2D Sliding transform operator.
Sliding3D(Op, dims, dimsd, nwin, nover, nop) 3D Sliding transform operator.
Fredholm1(G[, nz, saveGt, usematmul, dtype]) Fredholm integral of first kind.

Wave-Equation processing

UpDownComposition2D(nt, nr, dt, dr, rho, vel) 2D Up-down wavefield composition.
MDC(G, nt, nv[, dt, dr, twosided, fast, …]) Multi-dimensional convolution.
Demigration(z, x, t, srcs, recs, vel, wav, …) Demigration operator.

Geophysicical subsurface characterization

avo.AVOLinearModelling(theta[, vsvp, nt0, …]) AVO Linearized modelling.
poststack.PoststackLinearModelling(wav, nt0) Post-stack linearized seismic modelling operator.
prestack.PrestackLinearModelling(wav, theta) Pre-stack linearized seismic modelling operator.
prestack.PrestackWaveletModelling(m, theta, nwav) Pre-stack linearized seismic modelling operator for wavelet.



leastsquares.NormalEquationsInversion(Op, …) Inversion of normal equations.
leastsquares.RegularizedInversion(Op, Regs, data) Regularized inversion.
leastsquares.PreconditionedInversion(Op, P, data) Preconditioned inversion.


sparsity.IRLS(Op, data, nouter[, threshR, …]) Iteratively reweighted least squares.
sparsity.ISTA(Op, data, niter[, eps, alpha, …]) Iterative Soft Thresholding Algorithm (ISTA).
sparsity.FISTA(Op, data, niter[, eps, …]) Fast Iterative Soft Thresholding Algorithm (FISTA).
sparsity.SPGL1(Op, data[, SOp, tau, sigma, x0]) Spectral Projected-Gradient for L1 norm.
sparsity.SplitBregman(Op, RegsL1, data[, …]) Split Bregman for mixed L2-L1 norms.


Wave-Equation processing

SeismicInterpolation(data, nrec, iava[, …]) Seismic interpolation (or regularization).
WavefieldDecomposition(p, vz, nt, nr, dt, …) Up-down wavefield decomposition.
MDD(G, d[, dt, dr, nfmax, wav, twosided, …]) Multi-dimensional deconvolution.
Marchenko(R[, R1, dt, nt, dr, nfmax, wav, …]) Marchenko redatuming
LSM(z, x, t, srcs, recs, vel, wav, wavcenter) Least-squares Migration (LSM).

Geophysical subsurface characterization

poststack.PoststackInversion(data, wav[, …]) Post-stack linearized seismic inversion.
prestack.PrestackInversion(data, theta, wav) Pre-stack linearized seismic inversion.