Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ymahlau/fdtdx

Repository files navigation

logo

Documentation arXiv arXiv codecov PyPI version Continuous integration status

FDTDX: Electromagnetic Simulations in JAX

FDTDX is an efficient open-source Python package for the inverse 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 3D design in nanophotonics.

Key Features

  • 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 and development

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  # Basic CPU-Installation
pip install fdtdx[cuda12]  # GPU-Acceleration (Highly Recommended!)
pip install fdtdx[rocm]   # AMD-GPU (only python<=3.12)

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{schubert2025quantized,
  title={Quantized inverse design for photonic integrated circuits},
  author={Schubert, Frederik and Mahlau, Yannik and Bethmann, Konrad and Hartmann, Fabian and Caspary, Reinhard and Munderloh, Marco and Ostermann, J{\"o}rn and Rosenhahn, Bodo},
  journal={ACS omega},
  volume={10},
  number={5},
  pages={5080--5086},
  year={2025},
  publisher={ACS Publications}
}

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).

About

Electromagnetic FDTD Simulations in JAX

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 13

Languages