Skip to content

Sacher Visible SiN MMI with GDSFactory FDTD

Simulate one visible 1×2 splitter: design 1 on wafer 3, with a 200 nm LPCVD silicon nitride core.

You will: build the component, configure the physical stack and 20 nm grid, preview the domain, and inspect transmission and a field monitor.

Requirements: GDSFactory+ cloud simulation access.

Reference run: 20 nm cells · 113,992,704 total allocated cells, including PML and padding.

Original paper

W. D. Sacher et al., “Visible-light silicon nitride waveguide devices and implantable neurophotonic probes on thinned 200 mm silicon wafers,” Optics Express 27, 37400–37418 (2019). Read the paper · DOI 10.1364/OE.27.037400.

1. Build the component

All geometry below is in micrometers. The model includes fixed 200 nm straight leads at its modal ports.

import math

import gdsfactory as gf
import matplotlib.pyplot as plt
import numpy as np
from gdsfactory.technology import LayerLevel, LayerStack, LogicalLayer
from shapely.geometry import LineString

from gsim import fdtd

gf.gpdk.PDK.activate()


def level(layer, material, zmin, thickness):
    return LayerLevel(
        layer=LogicalLayer(layer=layer),
        material=material,
        zmin=zmin,
        thickness=thickness,
        mesh_order=1,
        sidewall_angle=0,
    )
def extend_ports(component, length_um):
    """Append straight access guides and move each existing optical port."""
    ports = list(component.ports)
    component.ports.clear()
    for port in ports:
        angle = math.radians(port.orientation)
        normal = np.round([math.cos(angle), math.sin(angle)], 12)
        tangent = np.array([-normal[1], normal[0]])
        start = np.asarray(port.center)
        # GDS polygons are quantized to 1 nm; ports must share that face.
        end = np.round(start + length_um * normal, 3)
        half_width = port.width / 2
        component.add_polygon(
            [
                start - half_width * tangent,
                end - half_width * tangent,
                end + half_width * tangent,
                start + half_width * tangent,
            ],
            layer=port.layer,
        )
        component.add_port(
            name=port.name,
            center=tuple(end),
            width=port.width,
            orientation=port.orientation,
            layer=port.layer,
        )
component = gf.Component()
body_length_um, body_width_um, aperture_width_um, aperture_spacing_um = (
    4.74,
    1.52,
    0.36,
    0.76,
)
# Section 3.3 supplies these four dimensions. Access routing is a labeled
# nominal reconstruction: 8 um smooth fanout, constant aperture width,
# and output centers at +/-2 um to isolate the port mode solves.
component.add_polygon(
    [
        (0, -body_width_um / 2),
        (body_length_um, -body_width_um / 2),
        (body_length_um, body_width_um / 2),
        (0, body_width_um / 2),
    ],
    layer=(1, 0),
)
component.add_polygon(
    [
        (-1, -aperture_width_um / 2),
        (0, -aperture_width_um / 2),
        (0, aperture_width_um / 2),
        (-1, aperture_width_um / 2),
    ],
    layer=(1, 0),
)
component.add_port(
    name="o1", center=(-1, 0), width=aperture_width_um, orientation=180, layer=(1, 0)
)
for sign, port_name in [(-1, "o2"), (1, "o3")]:
    t = np.linspace(0, 1, 401)
    x = body_length_um + 8 * t
    y = sign * (
        aperture_spacing_um / 2
        + (2 - aperture_spacing_um / 2) * (10 * t**3 - 15 * t**4 + 6 * t**5)
    )
    polygon = LineString(np.column_stack([x, y])).buffer(
        aperture_width_um / 2, cap_style="flat"
    )
    component.add_polygon(np.asarray(polygon.exterior.coords), layer=(1, 0))
    component.add_port(
        name=port_name,
        center=(body_length_um + 8, sign * 2),
        width=aperture_width_um,
        orientation=0,
        layer=(1, 0),
    )
layers = {"core": level((1, 0), "SiN", 0, 0.2)}

extend_ports(component, 0.2)

2. Configure the simulation

Use explicit layer thicknesses and frozen source-center indices to reproduce the saved result. The 1.28 µm target PML is rounded up to whole cells. Materials are nondispersive over the sweep.

pdk = gf.Pdk(name="fdtd_sacher_visible_mmi", layer_stack=LayerStack(layers=layers))
simulation = fdtd.Simulation(pdk=pdk)
simulation.geometry(component)
simulation.materials(
    background="SiO2", overrides={"SiN": 2.002020202020202, "SiO2": 1.4603881165775716}
)
simulation.source(port="o1", wavelength_um=0.539, wavelength_span_um=0.218)
simulation.solver(cell_size_nm=20, max_timesteps=100000, max_wall_seconds=1800)
simulation.domain(
    pml_cells=64,
    x_bounds=((-1.2), (12.94)),
    y_bounds=((-3.18), (3.18)),
    z_bounds=((-1.48), (1.4)),
)

lower, upper = np.array([[-1.2, -3.18, -1.48], [12.94, 3.18, 1.4]])
simulation.monitors.add_plane(
    "overview_xy",
    center_um=((lower[0] + upper[0]) / 2, (lower[1] + upper[1]) / 2, 0.1),
    size_um=(upper[0] - lower[0] - 0.24, upper[1] - lower[1] - 0.24, 0),
    normal="+z",
    flux=False,
    wavelengths_um=[0.539],
    heatmap=fdtd.Heatmap(quantity="intensity", wavelengths_um=[0.539]),
)
PlaneMonitor(name='overview_xy', center_um=(5.87, 0.0, 0.1), size_um=(13.899999999999999, 6.12, 0.0), normal='+z', flux=False, wavelengths_um=[0.539], heatmap=Heatmap(quantity='intensity', wavelengths_um=[0.539]), fiber_mode=None, fields=None)

3. Inspect the simulation

Use the built-in 2D views to inspect the core, ports, monitor and PML. The top view passes through the core; the side view shows the vertical stack.

simulation.plot_2d(axis="z", position_um=0.1, figsize=(10, 4), legend=False)
plt.show()

svg

simulation.plot_2d(axis="y", position_um=0, figsize=(10, 4), legend=False)
plt.show()

svg

Rotate and zoom the built-in 3D viewer to inspect the complete simulation geometry.

simulation.plot_3d()

4. Run the simulation

Reuse a matching result when it is available in the cloud cache.

result = simulation.run(check_cache=True)
print(f"Total allocated cells: {result.grid['total_cells']:,}")
print(f"Solver time: {result.timing['run_seconds']:.1f} s")
Total allocated cells: 113,992,704
Solver time: 121.6 s

5. Inspect transmission

Plot incident-power-normalized modal transmission. Invalid source-band samples remain masked. Default Matplotlib figure size and fonts are used.

fig, ax = plt.subplots()
for port in ["o2", "o3"]:
    trace = result.s_parameters[port, "o1"]
    power = np.where(trace.valid, np.abs(trace.values) ** 2, np.nan)
    ax.plot(result.wavelength_um * 1000, power, label=f"|S{port[1:]}1|²")
ax.set(
    xlabel="Wavelength (nm)",
    ylabel="Power transmission",
    title="Sacher Visible SiN MMI",
)
ax.grid(alpha=0.2)
ax.legend()
plt.show()

svg

6. Inspect the top-view field

Overlay the silicon or silicon-nitride layout on the source-center intensity monitor. The x/y axes use equal aspect.

monitor = result.monitors["overview_xy"]
fig, ax = plt.subplots(figsize=(10, 4), layout="constrained")
monitor.plot_heatmap(
    wavelength_um=simulation.source.wavelength_um,
    quantity="intensity",
    ax=ax,
    cmap="viridis",
)
for points in component.get_polygons_points(by="tuple")[(1, 0)]:
    outline = np.vstack([points, points[0]])
    ax.plot(outline[:, 0], outline[:, 1], color="white", linewidth=0.5)
ax.set_aspect("equal", adjustable="box")
plt.show()

svg

Model scope

The body and apertures follow the paper. The 1 µm input access and 8 µm quintic output fanouts are labeled nominal reconstructions. SiN n = 2.002020 is interpolated from the paper’s index endpoints at 539 nm and held fixed across the band. Fig. 11 supplies excess loss; its per-output transmission estimate assumes equal splitting.

The saved result reached its finite-time stopping condition. That is separate from spatial mesh convergence. The reference campaign enforced a 30-minute wall-time budget.