TIDE
Torch-based Inversion & Development Engine
TIDE is a PyTorch-first electromagnetic FDTD library for forward modeling and full-waveform inversion. It provides differentiable 2D and 3D Maxwell solvers, native C/CUDA kernels, and configurable snapshot storage for memory-intensive gradient calculations.
Capabilities
| Capability | API | Status |
|---|---|---|
| 2D TM forward/inverse modeling | tide.MaxwellTM |
Stable |
| 3D forward/inverse modeling | tide.Maxwell3D |
Stable with constraints |
| JVP, VJP, and second VJP | operator.linearize(model) |
Stable |
| Snapshot storage | storage_mode |
Device, CPU, disk, none, or auto |
| Snapshot compression | storage_compression |
Optional BF16 compression |
| Debye dispersion | DebyeDispersion |
Advanced |
TIDE also includes PML boundaries, staggered-grid operators, callbacks, CFL resampling, shot batching, and inversion workflow helpers. Check the limitations guide before scaling up 3D or inversion workloads.
Installation
TIDE requires Python 3.12 or newer and PyTorch 2.12 or newer.
Install the package from PyPI:
uv pip install tide-GPR
You can also use pip:
pip install tide-GPR
For GPU use, install the PyTorch build that matches your CUDA environment before installing TIDE.
Build from source
Building from source requires CMake 3.28 or newer. A CUDA Toolkit is optional.
git clone https://github.com/vcholerae1/tide.git
cd tide
uv build
See the build guide for native-backend builds and troubleshooting.
Quick start
This example runs a small 2D TM forward simulation on CUDA when available and falls back to CPU otherwise:
import torch
import tide
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
epsilon = torch.full((96, 96), 4.0, device=device)
model = tide.EMModel(
epsilon=epsilon,
sigma=torch.zeros_like(epsilon),
mu=torch.ones_like(epsilon),
)
nt, dt = 300, 4e-11
experiment = tide.Experiment(
acquisition=tide.Acquisition(
source_location=torch.tensor([[[20, 48]]], device=device),
receiver_location=torch.tensor([[[20, 60]]], device=device),
),
source_amplitude=tide.ricker(8e8, nt, dt, device=device).view(1, 1, nt),
)
operator = tide.MaxwellTM(
tide.Discretization(
spacing=0.02,
dt=dt,
boundary=tide.CPML(width=10),
),
experiment,
execution=tide.ExecutionOptions(fallback=tide.FallbackPolicy.REFERENCE),
)
result = operator(model)
print(result.receiver_data.shape) # [nt, n_shots, n_receivers]
Documentation
Start with the path that matches your task:
- Getting started: installation, backend checks, and a first 2D simulation
- API orientation: models, experiments, operators, and derivative sessions
- Modeling: sources, receivers, boundaries, and tensor layouts
- Inversion: losses, backpropagation, and optimizer workflows
- Configuration: storage, callbacks, backends, and CFL controls
- API reference: public contracts and operators
Before relying on advanced configurations, review the known limitations and verification guide.
Development
Install the development dependencies and run the test suite:
uv sync --group dev
uv run pytest
Preview the documentation:
npm install
npm run dev
Issues and pull requests are welcome.
Citation
If you use TIDE in your research, cite:
@software{tide2025,
author = {Vcholerae1},
title = {TIDE: Torch-based Inversion \& Development Engine},
year = {2025},
url = {https://github.com/vcholerae1/tide}
}
Acknowledgments
TIDE includes code derived from Deepwave by Alan Richardson.
License
TIDE is available under the MIT License.
Metadata
Release files for tide-GPR 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tide_gpr-0.1.0.tar.gz | 485.6 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tide_gpr-0.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| tide_gpr-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| tide_gpr-0.1.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 6.9 MB
Release files / tide_gpr-0.1.0.tar.gz
| Download URL | tide_gpr-0.1.0.tar.gz |
|---|---|
| Size | 485.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5b3e97dca16da7511d939f421c6d648ca1c9ab5ae41589d482be65214958f97
|
|
BLAKE2b-256 checksum How to use checksums |
309fe2c0d3ba972f66f3925678f6d4e72b369648f3bbf4b6363b83ac9a92de68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tide_gpr-0.1.0-py3-none-win_amd64.whl
| Download URL | tide_gpr-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 660.5 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a3aaedba1ca578829d0e293f77b85cc754d53a49a83b5065ea953b5c69538b91
|
|
BLAKE2b-256 checksum How to use checksums |
54b8fca9724f3f7aca516c88ea8067f1bbfe4b71cb9db21ac7893814e4271f37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tide_gpr-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tide_gpr-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
259a3d59876bcf9ed2dcf3fd1a7c0396b3c3121ecb2402ff8298b3d82014a8da
|
|
BLAKE2b-256 checksum How to use checksums |
c8c78a0b91017cd57413cb4c767367feb77e417eff38a21492b28c90306ee9fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tide_gpr-0.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | tide_gpr-0.1.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 868.4 kB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
16f1ad6fc65f9d3e65cc81aef80dbedaa44a3d3953b2c8d39f3c0298d2d6e554
|
|
BLAKE2b-256 checksum How to use checksums |
bc162c40bf456c5ad5a2f5f91ebc31cc548685970a70bba847a81074dbdc76ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|