Skip to main content

Deepwave

DOI

Deepwave provides wave propagation modules for PyTorch, for applications such as seismic imaging/inversion. You can use it to perform forward modelling and backpropagation, so it can simulate wave propagation to generate synthetic data, invert for the scattering potential (RTM/LSRTM), other model parameters (FWI), initial wavefields, or source wavelets. You can use it to integrate wave propagation into a larger chain of operations with end-to-end forward and backpropagation. Deepwave enables you to easily experiment with your own objective functions or functions that generate the inputs to the propagator, letting PyTorch's automatic differentiation do the hard work of calculating how to backpropagate through them.

To install it, I recommend first installing PyTorch using the instructions on the PyTorch website. Deepwave can then be installed using

    pip install deepwave

The documentation contains examples and instructions on how to install and use Deepwave. You might also like to watch a video summary of Deepwave.

Features

  • Supports the 1D, 2D, and 3D constant density acoustic / scalar wave equation (regular and Born modelling), variable density acoustic, and elastic wave equation
  • Runs on CPUs and appropriate GPUs
  • The gradient of all outputs (final wavefields and receiver data) can be calculated with respect to the model parameters (wavespeed, scattering potential, etc.), initial wavefields, and source amplitudes
  • Uses the Pasalic and McGarry PML for accurate absorbing boundaries in the scalar wave propagator
  • Uses C-PML with the improved vacuum method free-surface method for the elastic wave propagator
  • The PML width for each edge can be set independently, allowing a reflective surface (no PML) on any side
  • Finite difference accuracy can be set by the user
  • A region of the model around the sources and receivers currently being propagated can be automatically extracted to avoid the unnecessary computation of propagation in distant parts of the model
  • Double backpropagation through the regular scalar propagator, including calculating the Hessian

Quick Example

In a few lines you can make a velocity model, propagate a wave from a source in the top left corner to a receiver in the top right, calculate an objective function, and backpropagate to obtain its gradient with respect to the velocity.

import torch
import deepwave
import matplotlib.pyplot as plt

v = 1500 * torch.ones(100, 100)
v[50:] = 2000
v.requires_grad_()

out = deepwave.scalar(
    v, grid_spacing=4, dt=0.004,
    source_amplitudes=deepwave.wavelets.ricker(25, 200, 0.004, 0.06).reshape(1, 1, -1),
    source_locations=torch.tensor([[[0, 0]]]),
    receiver_locations=torch.tensor([[[0, 99]]])
)

(out[-1]**2).sum().backward()

_, ax = plt.subplots(1, 3, figsize=(9, 3))
ax[0].imshow(v.detach())
ax[0].set_title("Velocity model")
ax[1].plot(out[-1].detach().flatten())
ax[1].set_title("Receiver data")
ax[2].imshow(v.grad.detach(), vmin=-1e-5, vmax=1e-5)
ax[2].set_title("Gradient")
plt.show()

Output from quick example

There are more examples in the documentation.

Citing

If you would like to cite Deepwave, I suggest:

@software{richardson_alan_2026,
  author       = {Richardson, Alan},
  title        = {Deepwave},
  month        = jun,
  year         = 2026,
  publisher    = {Zenodo},
  version      = {v0.0.27},
  doi          = {10.5281/zenodo.3829886},
  url          = {https://doi.org/10.5281/zenodo.3829886}
}

Metadata

Release files for deepwave 0.0.27

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

Source distribution (sdist)

Source distribution for deepwave 0.0.27
File Size Uploaded
deepwave-0.0.27.tar.gz 174.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for deepwave 0.0.27
File
deepwave-0.0.27-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
deepwave-0.0.27-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
deepwave-0.0.27-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
deepwave-0.0.27-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details

Total release size: 92.8 MB

Release files / deepwave-0.0.27.tar.gz

Download URL deepwave-0.0.27.tar.gz
Size 174.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e8eb798bcb25503ccf1bfb8c9ae42beddfab2cc6afe7632290c1e71d131fe4df
BLAKE2b-256 checksum
How to use checksums
9171387fd0091edf8d48b6268ee4ab05b6d8829437e5bea98e5d45cc5da42a03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / deepwave-0.0.27-py3-none-win_amd64.whl

Download URL deepwave-0.0.27-py3-none-win_amd64.whl
Size 23.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
857edf430192b2640e1f418ed64ee59f1b1dd2be9b16909bec0a0a20cebdf85c
BLAKE2b-256 checksum
How to use checksums
238f9f0885db2668f7c2951841c60f22ca1e937eba8450ffd86dea887356bed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / deepwave-0.0.27-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL deepwave-0.0.27-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 48.0 MB
Tags Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f8a54e593ea7003af091d08cda932ab2fcaaac19ab88aa8c7f0f790a3f04d79c
BLAKE2b-256 checksum
How to use checksums
f96bf75ab345f3edc2b74b894317ef18aae05938f8b7ff1493ee67582b54e1f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / deepwave-0.0.27-py3-none-macosx_11_0_arm64.whl

Download URL deepwave-0.0.27-py3-none-macosx_11_0_arm64.whl
Size 7.0 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d390d6e30f28181eb31ccccfc507c1d60c1841d9e9a7f4cc54e267c6794d475e
BLAKE2b-256 checksum
How to use checksums
216b34aa1b8928210c848259a77627ba44d7b8f057f661e062a1d019ff63eb4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / deepwave-0.0.27-py3-none-macosx_10_9_x86_64.whl

Download URL deepwave-0.0.27-py3-none-macosx_10_9_x86_64.whl
Size 14.6 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
ed59539fb61c75359fff3582205f88ae0c83534c2dab5e494cb29a840f5d6882
BLAKE2b-256 checksum
How to use checksums
6f914e9c657657bb01b800e1ebba9e3ebf48439d19c976397d7e61190c665c83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.0.27 This release

5 release files

0.0.25

5 release files

0.0.23

5 release files

0.0.22

5 release files

0.0.20

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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