# gsim

Photonic FDTD and RF/microwave simulation for GDSFactory, powered by [GDSFactory+](<https://gdsfactory.com>).

| Engine | Status and use |
| --- | --- |
| **GDSFactory FDTD** (`gsim.fdtd`) | **Primary.** New photonic FDTD simulations supported by its current capabilities. |
| **Palace** (`gsim.palace`) | **Established.** FEM simulations for RF and microwave devices. |
| **Meep** (`gsim.meep`) | **Supported.** Photonic workflows that are not yet available in GDSFactory FDTD. |

## Photonic FDTD

**GDSFactory FDTD (`gsim.fdtd`) is the primary engine for new photonic simulations.** Meep (`gsim.meep`) remains supported for capabilities not yet available in GDSFactory FDTD.

### Quick start

```python
import gdsfactory as gf

from gsim import fdtd

gf.gpdk.PDK.activate()
component = gf.get_component("mmi1x2")

simulation = fdtd.Simulation()
simulation.materials(background="SiO2", overrides={"si": 3.4757})
simulation.geometry(component)
simulation.source(port="o1", wavelength_span_um=0.1)

result = simulation.run(check_cache=True)
result.plot_plotly()
```

[Start with the MMI tutorial](<https://gdsfactory.com/gsim/nbs/fdtd_mmi_gpdk/index.md>) or read the [GDSFactory FDTD guide](<https://gdsfactory.com/gsim/api/fdtd/index.md>).

## GDSFactory FDTD roadmap

Over the next six months, we plan to add:

- Material dispersion
- Anisotropic materials
- Periodic boundary conditions
- Gradients for inverse design
- Feature parity and Meep migration

Meep will be deprecated only after GDSFactory FDTD reaches the required feature coverage and a documented migration path is available.

*Last updated: August 2026.*

## Palace for RF and microwave

`gsim.palace` is the FEM engine for driven RF and microwave simulations, eigenmodes, electrostatics, and impedance extraction.

[Start with the Palace CPW tutorial](<https://gdsfactory.com/gsim/nbs/palace_cpw_lumped/index.md>) or read the [Palace guide](<https://gdsfactory.com/gsim/api/palace/index.md>).

## Installation

```bash
pip install gsim
```

## API guides

[GDSFactory FDTD](<https://gdsfactory.com/gsim/api/fdtd/index.md>) · [Meep](<https://gdsfactory.com/gsim/api/meep/index.md>) · [Palace](<https://gdsfactory.com/gsim/api/palace/index.md>) · [Common](<https://gdsfactory.com/gsim/api/common/index.md>) · [Cloud](<https://gdsfactory.com/gsim/api/cloud/index.md>)

## API reference

The API reference is generated from the Python source and docstrings. Browse `gsim.fdtd`, `gsim.meep`, `gsim.palace`, `gsim.common`, or `gsim.gcloud`. Start with `fdtd.Simulation`, `meep.Simulation`, or `palace.DrivenSim`. API entries link back to guides that reference them.
