Skip to main content

SWEEP

SWEEP

Docs License: MIT PyTorch

English | 中文

Seismic Wave Equation Exploration Platform — a differentiable framework for seismic wave-equation modeling, migration, and full-waveform inversion. One API, 20+ equations (acoustic / elastic / VTI / TTI / DAS), PyTorch and JAX backends, eager and compiled CUDA paths.

📖 Documentation: https://sweepx.deepwave.group/solver/

Install

pip install torch --index-url https://download.pytorch.org/whl/cu126   # match your driver, see below
pip install sweepx

Install a torch built for your driver first: PyPI's default torch is CUDA 13 and needs driver >= 580, so on an older driver (or a V100) use cu126 as above. The install selector gives the exact command for your GPU and driver.

The wheel ships prebuilt CUDA cores, so the compiled backend (impl='c') works right after install with any PyTorch version: no nvcc, no compiler, no build step. It needs an NVIDIA GPU and driver; the core for your torch's CUDA version is picked automatically (CUDA 12: V100 and newer; CUDA 13: T4 and newer, driver >= 580). The eager PyTorch and JAX backends are pure Python.

From source: a clone has no prebuilt core, so the CUDA core is compiled locally once (with an nvcc matching your torch's CUDA version) and cached:

pip install .
python -m sweep.build   # optional: compile it now instead of on the first impl='c' call

sweepx (Python >= 3.10) installs the solver together with the sweepx toolkit (task runner, agent, losses, I/O, networks, optimizers); you import sweep. pip install sweep-solver installs the solver alone (Python >= 3.9). GPU coverage, custom cores and developer builds are covered in Building the CUDA core.

Hello SWEEP

One shot, one receiver, one .backward() — read off the velocity-model gradient for a single trace:

import numpy as np
import torch
from sweep.equations import Acoustic
from sweep.propagator.torch import PropTorch
from sweep.signal import ricker

shape = (96, 128)
dh, dt, nt = 10.0, 0.002, 800
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

vp_true = np.full(shape, 1500.0, dtype=np.float32)
vp_true[shape[0] // 2:, :] = 2500.0
vp_init = np.full(shape, 1500.0, dtype=np.float32)

solver = PropTorch(Acoustic(device=device), shape=shape, dh=dh, dt=dt,
                   device=device, use_ckpt=False)

t = np.arange(nt) * dt
wavelet = ricker(t - 0.14, f=10.0).astype(np.float32)
sources   = np.array([[shape[1] // 4, shape[0] // 2]], dtype=np.int64)
receivers = np.array([[[3 * shape[1] // 4, shape[0] // 2]]], dtype=np.int64)

with torch.no_grad():
    obs = solver(wavelet, sources, receivers, models=[torch.tensor(vp_true, device=device)])

vp_t = torch.tensor(vp_init, device=device, requires_grad=True)
pred = solver(wavelet, sources, receivers, models=[vp_t])
(0.5 * (pred - obs).pow(2).sum()).backward()

print("vp gradient shape:", tuple(vp_t.grad.shape))

Swap Acoustic for Elastic, AcousticVTI, ElasticTTI, ... — the surrounding code is unchanged.

Notebooks & examples

Citing

@misc{wang2026sweep,
  title  = {{SWEEP} ({S}eismic {W}ave {E}quation {E}xploration {P}latform):
            A Unified Solver Framework for Differentiable Wave Physics},
  author = {Wang, Shaowen and Alkhalifah, Tariq},
  year   = {2026},
  eprint = {2604.14189},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2604.14189},
}

License

MIT — see LICENSE.

Metadata

Release files for sweep-solver 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sweep-solver 0.3.6
File Size Uploaded Provenance Actions
sweep_solver-0.3.6.tar.gz 2.4 MB Without provenance Details for sweep_solver-0.3.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sweep-solver 0.3.6
File Interpreter ABI Platform Actions
sweep_solver-0.3.6-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for sweep_solver-0.3.6-py3-none-manylinux_2_28_x86_64.whl

Total release size: 64.5 MB

Release files / sweep_solver-0.3.6.tar.gz

Download URL sweep_solver-0.3.6.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
d3eb9c75b40bba7639d0520b284850b546f68822ae497656421bf0100bf3c241
BLAKE2b-256 checksum
How to use checksums
c35b048771816360ce4da1bbd89d59093a3f2925a298d017e8e2dfc75e37a705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release files / sweep_solver-0.3.6-py3-none-manylinux_2_28_x86_64.whl

Download URL sweep_solver-0.3.6-py3-none-manylinux_2_28_x86_64.whl
Size 62.1 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
449750fb4d85959e58032c5fa509b0ec56651ef7e9c21ef534c11cc0b23cdede
BLAKE2b-256 checksum
How to use checksums
48f6f30b9f8d35cf992f48da4b0a5a8f9aa8ca7ca242851fe31e468cffd5965b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Security for sweep-solver 0.3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page