FDTDX: Electromagnetic Simulations in JAX
FDTDX is an efficient open-source Python package for the simulation and design of three-dimensional photonic nanostructures using the Finite-Difference Time-Domain (FDTD) method. Built on JAX, it provides native GPU support and automatic differentiation capabilities, making it ideal for large-scale design tasks.
Key Features
The key features differentiating FDTDX from other simulation software packages like Meep (which is also great!) are the following:
- High Performance: GPU-accelerated FDTD simulations with multi-GPU scaling capabilities
- Memory Efficient: Leverages time-reversibility in Maxwell's equations for efficient gradient computation
- Automatic Differentiation: Built-in gradient-based optimization for complex 3D structures
- User-Friendly API: Intuitive positioning and sizing of objects in absolute or relative coordinates
- Large-Scale Design: Capable of handling simulations with billions of grid cells
- Open Source: Freely available for research, development and commercial use.
Documentation
Visit our documentation for:
- Detailed API reference
- Tutorial guides
- Best practices
Also check out our whitepaper for some examples and a comparison to other popular FDTD-frameworks.
Installation
Install FDTDX using pip:
pip install fdtdx
In addition, we recommend installing GPU acceleration:
pip install jax[cuda13] # NVIDIA GPUs
pip install jax[rocm7-local] # AMD GPUs
pip install jax[tpu] # TPUs
For development installation, see the contributing guidelines!
Multi-GPU
# The following lines often lead to better memory usage in JAX
# when using multiple GPU.
export XLA_PYTHON_CLIENT_ALLOCATOR="platform"
export XLA_PYTHON_CLIENT_PREALLOCATE="false"
export NCCL_LL128_BUFFSIZE="-2"
export NCCL_LL_BUFFSIZE="-2"
export NCCL_PROTO="SIMPLE,LL,LL128"
Citation
If you find this repository helpful for you work, please consider citing:
@article{Mahlau2026,
doi = {10.21105/joss.08912},
url = {https://doi.org/10.21105/joss.08912},
year = {2026},
publisher = {The Open Journal},
volume = {11},
number = {117},
pages = {8912},
author = {Mahlau, Yannik and Schubert, Frederik and Berg, Lukas and Rosenhahn, Bodo},
title = {FDTDX: High-Performance Open-Source FDTD Simulation with Automatic Differentiation},
journal = {Journal of Open Source Software}
}
Acknowedgement
This project was developed at the Institute of Information Processing at Leibniz University Hannover, Germany and sponsored by the cluster of excellence PhoenixD (Photonics, Optics, Engineering, Innovation across Disciplines).
Metadata
Release files for fdtdx 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fdtdx-0.6.3.tar.gz | 1.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fdtdx-0.6.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.0 MB
Release files / fdtdx-0.6.3.tar.gz
| Download URL | fdtdx-0.6.3.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ddcbc0fe8c7a6d829c62d27726a0ae74431f683775dc2fa3f7b97ba7b83e579
|
|
BLAKE2b-256 checksum How to use checksums |
358f85fb5ded7d731cf4abaeaf5a2a0f1fd2527d2cbe3e4fa0d93041ceb90eb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 12, 2026.
Transparency logRelease files / fdtdx-0.6.3-py3-none-any.whl
| Download URL | fdtdx-0.6.3-py3-none-any.whl |
|---|---|
| Size | 375.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
477082a19fc447d50812c69dbe5c7597daafbc68dc4d1001976b5d8d96feb2ae
|
|
BLAKE2b-256 checksum How to use checksums |
345b9bcc376b5ce105df1ef15a5768a104ddaf13ace67d39641769e2c7f9fb81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 12, 2026.
Transparency log