| name | pylops |
| description | Linear operators for large-scale inverse problems with matrix-free representations.
Use when Claude needs to: (1) Define linear operators for forward/adjoint operations,
(2) Solve inverse problems (deconvolution, imaging, tomography), (3) Apply signal
processing transforms (FFT, convolution, derivatives), (4) Compose operators for
complex workflows, (5) Perform regularized inversion with smoothness or sparsity
constraints, (6) Process seismic or image data at scale.
|
| version | 1.0.0 |
| author | Geoscience Skills |
| license | MIT |
| tags | ["Linear Operators","Inverse Problems","Deconvolution","Signal Processing"] |
| dependencies | ["pylops>=2.0.0","numpy","scipy"] |
| complements | ["devito","simpeg","segyio"] |
| workflow_role | modelling |
PyLops - Linear Operators Library
Quick Reference
import numpy as np
import pylops
A = pylops.FirstDerivative(n=100, dtype='float64')
y = A @ x
x_adj = A.H @ y
x_est = A / y
Key Classes
| Class | Purpose |
|---|
LinearOperator | Base class for all operators |
VStack/HStack | Vertical/horizontal operator stacking |
BlockDiag | Block diagonal operator composition |
Essential Operations
Basic Operators
D = pylops.Diagonal(np.array([1., 2., 3.]))
y = D @ x; x_adj = D.H @ y
D1 = pylops.FirstDerivative(n, dtype='float64')
D2 = pylops.SecondDerivative(n, dtype='float64')
G = pylops.Gradient(dims=(64, 64), dtype='float64')
Convolution
wavelet = np.sin(np.linspace(0, 2*np.pi, 21)) * np.hanning(21)
C = pylops.signalprocessing.Convolve1D(n, h=wavelet, offset=10)
y = C @ x
x_adj = C.H @ y
Compose and Stack Operators
composed = pylops.Smoothing1D(5, n) @ pylops.FirstDerivative(n) @ pylops.Identity(n)
V = pylops.VStack([A, B])
H = pylops.HStack([A, B])
BD = pylops.BlockDiag([A, B])