gds_fdtd
EDA- and solver-agnostic 3D FDTD simulation framework for photonic layouts: GDS in, S-parameters, fields, and compact models out - tidy3d, Lumerical, or beamz behind one API.
One component, one technology file, one SimulationSpec, any engine: EDA-agnostic on the front (KLayout/SiEPIC, gdsfactory, raw GDS), solver-agnostic on the back. Beyond the S-matrix you also get field and mode visualizations, physics checks (reciprocity/passivity), mesh-convergence and cross-engine validation, and one-call export to compact-model formats (Touchstone .sNp, Lumerical INTERCONNECT .dat, HDF5) for circuit simulation.
solver = get_solver("tidy3d" | "lumerical" | "beamz")(component, tech, spec)
smatrix = solver.run()
| a waveguide crossing on tidy3d (log-scale field): TE0 goes straight through, with the faint crosstalk into the side arms visible | its S-parameters (51 λ, TE + TM): −0.5 dB insertion loss, −41 dB crosstalk, −33 dB reflection |
| a y-branch splitter (log-scale field): one input mode splitting evenly into two arms | the IDENTICAL job on all three engines: tidy3d and Lumerical within 0.003 dB, free beamz within 0.05 dB |
All images are real solver output.
See your problem before you run it
Every solver setup renders as an interactive 3D scene — the layer stack with per-layer colors, port cones, field-monitor planes, and the domain box. Orbit, zoom, click an object for its material and z-extent, toggle groups from the legend. Play with it live in the docs (also embedded in examples 01 and 11):
from gds_fdtd.viewer3d import show_3d
show_3d(solver) # notebooks + docs; save_3d(...) writes a shareable page
Features
- Bring your own engine: implement four methods and any FDTD engine plugs in with full S-matrix export, physics checks, caching, CLI, and a free conformance test suite — the guide: docs/adding_a_solver.md.
- Solver-agnostic engine registry:
get_solver("tidy3d" | "lumerical" | "beamz")— identical(component, technology, SimulationSpec)in, identicalSMatrixout. Third-party engines plug in via entry points.validate()/build()/estimate()are always offline and free; onlyrun()spends credits/licenses/compute. - Layout ingestion: raw GDS via KLayout with SiEPIC pin/devrec conventions, SiEPIC PDK cells, and gdsfactory (>= 9) components — ports auto-detected, never hand-placed.
- Validated technology files: the layer stack is a pydantic-validated YAML (bad files fail with the offending key named). Materials can carry per-solver entries or a neutral refractiveindex.info reference (
rii: {shelf, book, page}), resolved offline from a local database copy. - Canonical S-matrix: one
SMatrixtype with NaN-aware partial matrices, reciprocity/passivity/power-balance checks, and I/O to Lumerical INTERCONNECT.dat, Touchstone.sNp(scikit-rf compatible), HDF5/npz, plus plotting. - Cross-validated engines (see SOLVER_STATUS.md for per-engine last-verified dates): the tidy3d (>= 2.11, cloud) and Lumerical (2024/2025, local) adapters were validated live against each other on identical geometry — within 0.0033 dB, with the recorded beamz 0.4.3 results inside 0.052 dB of both; the agreement is locked into CI via recorded artifacts.
- Interactive 3D viewer:
show_3d(solver)renders the extruded layer stack, ports, field-monitor planes, and simulation domain as an orbitable, clickable three.js scene — in notebooks and in the documentation gallery alike;render_staticdraws the same scene without JavaScript. - Multimode/dual-polarization simulations on the engines that support them (tidy3d, Lumerical).
- Serializable jobs + CLI: every simulation is a JSON
JobSpec;gds-fdtd validate|build|estimate|run|convert|solversdrives it from the shell, andSubprocessBackendruns sweeps crash-isolated and in parallel. Secrets stay in the environment — job files are safe to ship to a cluster or cloud runner (docs/remote_compute.md). - Convergence sweeps, caching, cross-solver validation:
convergence.sweep()steps anySimulationSpecfield and recommends the converged value;run_cached()hashes the full job (geometry + technology + spec + engine version) so repeat runs are free;validation.validate_across()quantifies worst-case |ΔS| between engines on the same job.
Supported solvers
| engine | execution | cost | install |
|---|---|---|---|
| Tidy3D >= 2.12.2 (2.11.x on Intel macOS) | cloud | FlexCredits | pip install gds_fdtd[tidy3d] |
| Ansys Lumerical FDTD 2024/2025 | local | license | Lumerical install + lumapi on path |
| beamz >= 0.5.3, < 0.6 | local (JAX, CPU/GPU) | free | pip install gds_fdtd[beamz] |
BeamZ 0.5.0–0.5.2 GPU integration results and reproduction commands are in the RTX 3090 benchmark report. Fresh S-bend, y-branch, and Si→SiN escalator comparisons include full matrices and the S-bend monitor-position investigation. BeamZ 0.5.3 verification confirms that the upstream material-snapshot correction substantially reduces that sensitivity. The 0.5.3 S-bend mesh sweep through mesh 30 passes a 0.05 dB successive-change criterion for sampled through paths.
Examples
A guided path from "load a layout" to "run it on any engine and read the
S-parameters" — paired .py (jupytext) + executed .ipynb. See
examples/README.md for the full tour.
| # | example | shows | engine |
|---|---|---|---|
| 00 | 00_quickstart/ |
layout → S-matrix in ten lines | beamz (free) |
| 01 | 01_layout_to_component/ |
load a GDS / gdsfactory cell, auto-detect ports, read the geometry | none |
| 02 | 02_technology/ |
materials, refractiveindex.info vs shipped models, the vertical layer stack |
none |
| 02b | 02_technology/ |
feed one refractiveindex.info model (full complex n+ik) into every engine |
tidy3d-local + recorded |
| 03 | 03_first_simulation/ |
the full flow end-to-end: geometry → permittivity → build → run → S-params → fields | beamz (free) |
| 04 | 04_reading_results/ |
SMatrix: insertion loss, crosstalk, phase, reciprocity/passivity, Touchstone/HDF5/npz I/O |
none |
| 05 | 05_fields_and_modes/ |
waveguide mode profiles, effective indices, permittivity cross-sections | tidy3d-local (free) |
| 05b | 05_fields_and_modes/ |
field monitors: axes, pinned positions, recorded wavelengths, plot_monitor_planes; the escalator side view |
recorded (tidy3d) |
| 06 | 06_convergence_and_caching/ |
mesh-convergence sweeps, run_cached (repeat runs free), and cross-engine validation where converged ≠ correct |
beamz + recorded |
| 07 | 07_choosing_an_engine/ |
the identical job on beamz / tidy3d / Lumerical, and how they agree | all three |
| 08 | 08_frontends/ |
any EDA in, any engine out: gdsfactory / SiEPIC / raw-GDS frontends, then the frontend × engine matrix | mixed |
| 09 | 09_cli_and_jobs/ |
the gds-fdtd CLI and serializable JobSpec for remote/batch compute |
none |
| 10 | 10_cookbook/ |
reference devices with known-good S-params — the Si→SiN escalator on the free engine, cross-checked against recorded tidy3d/Lumerical | beamz + recorded |
| 10b | 10_cookbook/ |
polarization splitter and splitter-rotator from gdsfactory: TE/TM modes, multi-mode S-params, per-polarization fields | recorded (2 engines) |
| 11 | 11_bragg_grating/ |
a 95 µm Bragg grating: stopband spectrum + the field reflecting in-band and passing out-of-band | recorded (tidy3d) |
Installation
pip install gds-fdtd # core
pip install "gds-fdtd[all]" # + every engine and layout frontend
From source, editable:
git clone https://github.com/SiEPIC/gds_fdtd.git && cd gds_fdtd
pip install -e ".[all]" # everything, editable
pip install -e ".[all,dev]" # + test and lint tools, for contributing
Lumerical needs no extra; the adapter finds lumapi from your local Lumerical install.
To pick plugins individually, each is its own extra:
| extra | adds |
|---|---|
tidy3d |
Tidy3D cloud solver |
beamz |
beamz open-source JAX solver |
gdsfactory |
gdsfactory frontend |
siepic |
SiEPIC / KLayout frontend |
prefab |
PreFab lithography prediction |
engines |
tidy3d + beamz |
all |
every plugin above |
dev |
test and lint tooling (for contributing) |
Requires Python ≥ 3.11; core runtime deps (numpy, matplotlib, shapely, PyYAML, klayout, pydantic) install automatically.
Running tests
If you've installed the dev dependencies, you can run the test suite with:
pytest --cov=gds_fdtd tests
Development
Development Setup
git clone https://github.com/SiEPIC/gds_fdtd.git
cd gds_fdtd
pip install -e .[dev] # or: uv sync --extra dev
# install the git hooks (uses the standard .pre-commit-config.yaml;
# prek is a fast drop-in for pre-commit)
uv tool install prek && prek install
Canonical dev tasks live in the justfile:
just test # tests with coverage
just lint # ruff check + format check (what CI runs)
just fix # auto-fix lint + formatting
just docs # build documentation
just gate # quick lint+test gate
Versioning & Releases
The version is derived from git tags via hatch-vcs — there is nothing to bump and no
version string in the source. To release:
git tag v0.7.1
git push --tags
The release.yml workflow then verifies the tagged commit passed CI, builds and inspects the
package, publishes to PyPI via Trusted Publishing (with PEP 740 attestations), and creates a
GitHub Release with auto-generated notes (categorized by PR labels — see
.github/release.yml).
Metadata
Release files for gds-fdtd 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gds_fdtd-0.7.2.tar.gz | 26.1 MB | With provenance | Details for gds_fdtd-0.7.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gds_fdtd-0.7.2-py3-none-any.whl | Python 3 | none | any | Details for gds_fdtd-0.7.2-py3-none-any.whl |
Total release size: 26.3 MB
Release files / gds_fdtd-0.7.2.tar.gz
| Download URL | gds_fdtd-0.7.2.tar.gz |
|---|---|
| Size | 26.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f5572efcf90720f8fe5d2bfea30f1e7e61887f7f1936267429b787ddbccc871
|
|
BLAKE2b-256 checksum How to use checksums |
b065990487cfb2860b4936b7b188e6fb300640f48be7393db71a34628faeb555
|
| 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 Nov 7, 2026.
Transparency logRelease files / gds_fdtd-0.7.2-py3-none-any.whl
| Download URL | gds_fdtd-0.7.2-py3-none-any.whl |
|---|---|
| Size | 131.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71252bda3bda6fda4e6aa0683f8524b56fcfd9335027d0db9cf9f36438c6ee9c
|
|
BLAKE2b-256 checksum How to use checksums |
aae55cdb8411cc90b5903e22d4541dddc27cdd7a165ffb1eac7fec0791b7046f
|
| 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 Nov 7, 2026.
Transparency logSecurity for gds-fdtd 0.7.2
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.
Attestation for gds_fdtd-0.7.2.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 Nov 7, 2026.
Transparency logA 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.