Skip to main content

CuWave

CuWave is a GPU-accelerated (single or multi), differentiable finite difference wave propagation code. Possible applications include

nondestructive testing via full waveform inversion nondestructive testing via full waveform inversion
transient acoustic topology optimization transient acoustic topology optimization
analog neural networks
transient photonic topology optimization transient photonic topology optimization

Documentation

  • see the documentation for how the code works (AI-assisted; verify with sources for critical details)
  • see examples for how to apply the code

Multiple GPUs

Several GPUs take one argument, and the driver otherwise stays as it is:

  • Simulation(..., devices=(0, 1)) splits one grid along its first axis over the listed GPUs, for grids too large or too slow for one. simulate, sensitivity, reconstruction_sensitivity and superposition_sensitivity then run split and return the same result as on one GPU, bitwise. Try it with the DEVICES setting of
  • misfit_gradient(..., devices=[0, 1]) (and measure, misfit) deals the shots of an inversion out over the GPUs, which needs no communication and is the faster choice whenever one shot fits one GPU.

Development status

Scalar & acoustic wave equations have been developed over the last 2 years and are thoroughly validated. The elastic wave and electromagnetic wave equations were developed with AI assistance (Claude). The first is validated on experimental data, while the latter are cross-validated against the independent FDTD code FDTDX.

Performance

CuWave's runtime for identical discretizations is comparable to that of other established wave propagation finite difference codes. Speedups in 2D with reflecting boundaries (a ratio above 1 means CuWave is that many times faster) compared to the following frameworks:

  • scalar wave equation
  • elastic wave equation
    • Deepwave (forward: ~1.1x, sensitivity: ~1.3x)
    • SeismicWaves.jl (forward: ~4x, sensitivity: ~5x) Tested on one NVIDIA RTX PRO 500 Blackwell laptop GPU (6 GB) on the largest possible grids with CuWave's superposition_sensitivity as reference for the sensitivities. The specific numbers need to be taken with a grain of salt, as they are subject to specific hardware and simulation setup. All implementations operate on the same order of magnitude.

Additional benefits of CuWave are

  • the built-in higher order finite difference schemes, allowing for fewer grid points
  • a sensitivity analysis whose memory is independent of the number of timesteps, allowing for orders of magnitude larger grids

Install

pip install cuwave

Requires an NVIDIA GPU and CuPy matching your CUDA toolkit (e.g. pip install cupy-cuda12x), which is not pulled in automatically. For the full installation, including the optional PyTorch and running the tests, see docs/install.md.

References

If you use our code for your scientific research, please acknowledge this by referring to the following publication:

Herrmann, L., Bürchner, T., Kudela, L., Kollmannsberger, S., 2026, A memory-efficient adjoint method to enable billion parameter optimization on a single GPU in dynamic problems, Structural and Multidisciplinary Optimization, Volume 69, 52 (2026), DOI: 10.1007/s00158-025-04237-y

Acknowledgements

Ideas adapted from FDTDX (Mahlau, Schubert, Berg & Rosenhahn 2026), which also serves as the reference for validating the electromagnetic solvers.

Contact

For questions, bug reports, or collaboration inquiries, please don't hesitate to contact Leon Herrmann at herrmann.leon@pm.me.

License

MIT; see LICENSE.

Metadata

Release files for cuwave 0.7.1

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

Source distribution (sdist)

Source distribution for cuwave 0.7.1
File Size Uploaded Provenance Actions
cuwave-0.7.1.tar.gz 143.8 kB With provenance Details for cuwave-0.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cuwave 0.7.1
File Interpreter ABI Platform Actions
cuwave-0.7.1-py3-none-any.whl Python 3 none any Details for cuwave-0.7.1-py3-none-any.whl

Total release size: 301.2 kB

Release files / cuwave-0.7.1.tar.gz

Download URL cuwave-0.7.1.tar.gz
Size 143.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7cc84393a2e91282ea63f3ca6a2909a3666f8b67a8991b9282cde56034ec5c5e
BLAKE2b-256 checksum
How to use checksums
78b9659633192fa4d3f4cbce14614a15629d75a2a95d66256c5b6af895bff80b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / cuwave-0.7.1-py3-none-any.whl

Download URL cuwave-0.7.1-py3-none-any.whl
Size 157.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f78715529fd93a975cecb9279e218d79db6bd3f378cbb10da840e3aa5893c3d9
BLAKE2b-256 checksum
How to use checksums
654f7f66a106c015e3ec3bd1154e3c03f12bfca12bcb10ba74b5878cbe105e66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for cuwave 0.7.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cuwave-0.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

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