Skip to main content

TIDE

Documentation

Torch-based Inversion & Development Engine

Test coverage License: MIT

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.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 tide-GPR 0.1.1
File Size Uploaded
tide_gpr-0.1.1.tar.gz 815.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tide-GPR 0.1.1
File Interpreter ABI Platform
tide_gpr-0.1.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
tide_gpr-0.1.1-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.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 7.9 MB

Release files / tide_gpr-0.1.1.tar.gz

Download URL tide_gpr-0.1.1.tar.gz
Size 815.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f73964e0cfb7073485dc5fc09786dc977efb69cdc836c73bbe42373ad5211160
BLAKE2b-256 checksum
How to use checksums
ad7002f6566d544390986b524cd80f4516cbea3c6714a55dea683a140bf96f72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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.1-py3-none-win_amd64.whl

Download URL tide_gpr-0.1.1-py3-none-win_amd64.whl
Size 658.9 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
cbbafbd706a59b1895f1ee89c1a57ff860e02475e171d76b6280e2b179e57458
BLAKE2b-256 checksum
How to use checksums
0d888278aa18c1ce102b03de1f4778f741537ed81ea7956d285b6e3a9e4c4e24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL tide_gpr-0.1.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.6 MB
Tags Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
746c956a61a4b893a9ca2edd2919d1e27e1e2cd787d798b309d054d62ee3969f
BLAKE2b-256 checksum
How to use checksums
b4a685189271f425f237c29764888269748a4e7587432d7ec9222a1f9f5e5574
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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.1-py3-none-macosx_11_0_arm64.whl

Download URL tide_gpr-0.1.1-py3-none-macosx_11_0_arm64.whl
Size 866.8 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c3c53985ad002f5514e740d59c1b2c3baf910a71e7c2e228c3e53bb83e3236ea
BLAKE2b-256 checksum
How to use checksums
0f1cc64fba9a4119dc5a00b38e44b2e5556ba50cd43b7ba406954ae38a4b84bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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 history Release notifications | RSS feed

0.1.2

4 release files

This release

0.1.1 This release

4 release files

0.1.0

4 release files

0.0.34

4 release files

0.0.32

4 release files

0.0.31

4 release files

0.0.29

4 release files

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