Abstract¶
Designing a photonic integrated circuit (PIC) involves many steps, from drawing the mask layout and simulating devices and circuits to verifying the design and testing the fabricated chips. Each step traditionally relies on a dedicated tool with a separate description of the same design. GDSFactory is an open-source Python library that ties all steps in the design cycle together. The layout is generated by Python functions, and the same objects drive simulators, verification and the test plan. This tutorial paper is intended as a pedagogical introduction to GDSFactory for photonics engineers and students. Starting from a single polygon, the paper develops a wavelength-division-multiplexed silicon-photonic transceiver and introduces the concepts of GDSFactory along the way, from parametric cells and automatic routing to simulation, process design kits, verification and the preparation of wafer-scale tests. The paper also shows how to avoid design regressions using appropriate tests. The paper is accompanied by an executable notebook reproducing all shown results.

Figure 1:The design cycle of a photonic integrated circuit in GDSFactory. The same layout feeds simulation and optimization, KLayout-based verification and the measurement and data-analysis pipeline.
Introduction¶
Iterating on hardware is slow and expensive. A fabrication run of a photonic chip takes months, and the cost of a run is measured in tens of thousands of dollars or more, whereas an iteration in software takes minutes. Chip design therefore benefits from the practices that make software reliable, namely version control, code review, automated tests and reproducible builds. Electronic design automation (EDA) follows these practices with mature tool chains, which are, however, largely proprietary and specialized for electronics. Integrated photonics is younger. Photonic devices are geometrically more diverse (curved waveguides, tapers, gratings), and photonic design flows are still consolidating Bogaerts & Chrostowski, 2018Chrostowski & Hochberg, 2015. Photonic design automation (PDA) thus leaves room for a design environment that is open, scriptable and built on the language that most engineers and scientists already use for data analysis and simulation, namely Python.
GDSFactory provides such an environment. At its core GDSFactory is a Python library to describe mask layouts as code. Around the library, an ecosystem of extensions connects the layout to simulators, verification tools and test equipment (Figure 1). The Python description of the layout is the single source of truth. Geometry is never redrawn by hand for a simulator or re-entered into a test plan but derived from the same Python objects. For geometry operations, file input and output and visualization, GDSFactory builds on KLayout Köfferlein, n.d., an open-source layout viewer and editor with a Python interface that is widely used for mask design.
Related work¶
Several open-source tools describe photonic layouts in Python. PHIDL McCaughan et al., 2021 provides geometry and hierarchy for nanolithography, and early versions of GDSFactory were built on PHIDL. SiEPIC-Tools Chrostowski et al., 2016 extends KLayout with schematic-driven layout, netlist extraction and verification for rapid-prototyping foundry processes, and Simphony Ploeg et al., 2021 simulates the extracted circuits. Nazca Design Nazca Design: photonic integrated circuit design framework, n.d. and the commercial framework IPKISS Luceda Photonics, n.d. also assemble circuits from parametric cells with ports. GDSFactory combines layout, routing, PDKs, simulation interfaces, verification and test metadata in one package. A recent overview summarizes the features of GDSFactory Matres et al., 2026.
Because a GDSFactory layout is a program, the layout can also be generated by other programs. OptoSynthesizer Zhou et al., 2026 places and routes inverse-designed devices in large electronic-photonic circuits and adopts a GDSFactory-compatible PDK format. Agents based on large language models (LLMs) write the design code from a natural-language request. PhIDO Sharma et al., 2025 translates such requests into GDSFactory layouts and was evaluated on designs ranging from single devices to circuits of 112 components. PICopilot Jiang et al., 2026 generates design scripts with several cooperating agents and retrieval-augmented generation, and PICBench Wu et al., 2025 benchmarks LLMs on PIC design problems evaluated with SAX. Further agents optimize individual devices in closed loops of simulation and evaluation Kharel et al., 2026.
The present paper is a tutorial rather than an overview or a tool paper. A single case study is developed from one polygon to a tested chip, every result is produced by the printed code, and an executable notebook reproduces all figures. The examples are written for human designers but can equally serve as reference material for LLM-based design agents.
Conventions¶
Each concept is introduced with a short and complete code example printed next to the result, as in Figure 2. The examples build on each other and develop a small wavelength-division-multiplexed (WDM) transceiver. The examples use GDSFactory 9.51, which is installed with pip install gdsfactory==9.51.0 or added to a uv-managed project with uv add gdsfactory==9.51.0. The shown layouts are rendered with the addition of ports as arrows (optical ports in blue, electrical ports in ochre) and a scale bar. Lengths are given in micrometers.
The case study¶
The running example is the transmitter and the receiver of a four-channel WDM link on a silicon-on-insulator chip (Table 1). In the transmitter, light from a fiber carrying four carrier wavelengths is split into the four channels by a two-stage demultiplexer. A band filter of coupled ring resonators first separates two bands of two channels each, and banks of ring-resonator add-drop filters Little et al., 1997Bogaerts et al., 2012 then separate the channels within each band. Each channel is modulated by a Mach-Zehnder modulator (MZM) whose phase shifters are slot waveguides Almeida et al., 2004 filled with an electro-optic polymer, through silicon-organic hybrid (SOH) integration Koos et al., 2009Alloatti et al., 2014. A mirrored copy of the demultiplexer recombines the modulated channels. The modulators and the photodiodes are contacted through ground-signal-ground (GSG) probe pads. In the receiver, an identical demultiplexer routes each channel to a germanium photodiode. Test structures for process control complete the chip.
The device physics is deliberately kept simple to keep the focus on the design flow. Small building blocks are developed first and then composed into larger ones, so that each GDSFactory concept is introduced at the first point of use.
Table 1:The building blocks of the case study and the GDSFactory concepts introduced with them.
Building block | Concepts | Section |
|---|---|---|
strip-to-slot converter | polygons, references, cross-sections, parametric cells, ports | |
electro-optic phase shifter, MZM | connecting ports, hierarchy, reuse of library cells | |
demultiplexer, transmitter lane | optical routing, mirroring | |
receiver lane | YAML netlists, electrical routing | |
all cells | regression tests | |
slot waveguide, ring and band filters, optical link | mode solving, circuit and time-domain simulation, optimization | |
transceiver PDK | layers, layer stack, cross-sections, cell library | |
phase shifter, modulator | design rule check, LVS | |
test sites, test structures, chip | fiber arrays, metadata, test manifest, packing, dummy fill | |
ring heater | thermal simulation |
Mask layout¶
The primary output of a chip design is a mask layout, a set of polygons on numbered layers with one layer per fabrication step, stored in the GDSII or OASIS file format. Besides the geometry, GDSFactory keeps track of information that the file format cannot hold. Ports describe where and how components can be connected, settings record the parameters that created a component, and the netlist describes how components are connected to each other.
The first building block is a strip-to-slot mode converter. The converter couples light from a strip waveguide Chrostowski & Hochberg, 2015, used to route light across the chip, into the slot waveguide of the modulators. A slot waveguide consists of two silicon rails separated by a narrow gap, which is later filled with an electro-optic polymer.
Components and polygons¶
import gdsfactory as gf
from gdsfactory.gpdk import PDK
PDK.activate() # the generic process design kit
# strip width, slot width, slot gap, length in µm
w_I, w_II, g, L = 0.5, 0.8, 0.1, 3.0
# an empty component (a GDS cell with extras)
c = gf.Component()
c.add_polygon(
[(0, 0), (L, 0), (L, (w_II - g) / 2), (0, w_I)],
layer="WG", # layer name defined by the PDK
)
c # render the layout inlineFigure 2:Drawing a polygon. (a) A blank Component is created, and a polygon is added to the waveguide layer WG of the generic PDK. (b) The resulting layout, the lower half of the strip-to-slot converter.
Figure 2 shows a minimal GDSFactory program. After importing the library, a process design kit (PDK) is selected. The PDK defines the available layers, layer names and layer numbers, along with other process-specific properties that are discussed in Process design kits. The example uses the generic PDK that ships with GDSFactory. A gf.Component is the GDSFactory version of a GDS cell, a named container of polygons on layers, enriched with ports, settings and other metadata. Polygons are added with add_polygon from a list of vertices. Internally the coordinates are stored as integers in database units (1 nm by default), so every coordinate snaps to the database grid. c.write_gds("filename.gds") writes the layout to a file, and c.show() sends the layout to a running KLayout window for interactive inspection[1].
References and the component library¶
Drawing every shape vertex by vertex quickly becomes tedious. GDSFactory therefore comes with a library of several hundred parametric components in gf.components, from geometric primitives to complete photonic devices and test structures. In Figure 3 the taper component forms the upper rail of the converter. The narrow end of the taper begins next to the strip, and the wide end becomes the upper rail of the slot.
# instantiate a parametric cell from the library
offset = 0.75 * w_II + 0.25 * g
taper = gf.components.taper(
length=L,
width1=2 * (offset - g - w_I),
width2=(w_II - g) / 2,
)
ref = c << taper # add a *reference* to c
ref.movey(offset) # references can be transformed
cFigure 3:Reusing a library component. (a) The library function gf.components.taper creates a taper component, and c << taper places a reference to the taper inside c, which is then moved upwards. (b) The complete strip-to-slot converter. The polygon of Figure 2 and the referenced taper form the two rails of the slot.
The line ref = c << taper (equivalent to c.add_ref(taper)) does not copy the polygons of the taper into c. The line rather adds a reference (an instance in GDS terminology), which points to the taper component and stores a placement consisting of a translation, a rotation and possibly a mirroring. References can be moved, rotated, mirrored or positioned by their bounding box (ref.xmin = 10). Because the geometry of a referenced component is stored only once, however often the component is placed, hierarchical layouts stay light-weight.
Cross-sections and paths¶
Many waveguide components have a cross-section, the arrangement of layers perpendicular to the direction of propagation, that is invariant along the propagation direction. GDSFactory captures the translational invariance in a CrossSection, a collection of Section objects (in the lateral plane), each with a width, a lateral offset and a layer. Extruding a cross-section along a Path creates a component (Figure 4). Paths are composed of straight segments and bends. In an Euler bend the curvature increases gradually, which reduces bend losses and mode mismatch at the transitions.
w_rail = (w_II - g) / 2 # width of a single rail
xs_slot = gf.CrossSection(sections=(
# hidden core section: defines the ports
gf.Section(width=w_II, layer="WG", hidden=True,
port_names=("o1", "o2")),
# the two silicon rails left and right of the slot
gf.Section(width=w_rail, layer="WG",
offset=+(w_rail + g) / 2),
gf.Section(width=w_rail, layer="WG",
offset=-(w_rail + g) / 2),
))
# extrude a path (straight + Euler bend) along it
path = gf.path.straight(2) + gf.path.euler(radius=3)
gf.path.extrude(path, cross_section=xs_slot)Figure 4:Cross-sections. (a) The slot waveguide is described by two rails, offset from the center by half the rail width plus half the gap. A hidden section of the full slot width defines the position of the ports but adds no geometry. Any path can be extruded with the cross-section, here a straight segment followed by a 90° Euler bend. (b) The extruded slot waveguide with two ports.
Library functions such as gf.components.straight and gf.components.bend_euler, and all routing functions, accept a cross_section argument. The same function thus produces a strip, rib, slot or metal line, depending on the cross-section passed to the function.
Parametric cells and ports¶
So far the code is a script drawing one particular converter geometry. To reuse the converter with different dimensions, the script becomes a parametric cell (PCell), a Python function that takes the design parameters as arguments and returns a component (Figure 5). Functions that return components are also called component factories, which is the origin of the name GDSFactory.
@gf.cell # caches the result and names the cell
def strip_to_slot(
w_I: float = 0.5, w_II: float = 0.8,
g: float = 0.1, L: float = 3.0,
) -> gf.Component:
c = gf.Component()
c.add_polygon(
[(0, 0), (L, 0), (L, (w_II - g) / 2), (0, w_I)],
layer="WG",
)
offset = 0.75 * w_II + 0.25 * g
t = gf.components.taper(length=L,
width1=2 * (offset - g - w_I),
width2=(w_II - g) / 2)
c.add_ref(t).movey(offset)
# ports: position, direction, width, cross-section
c.add_port("o1", center=(0, w_I / 2), width=w_I,
orientation=180, cross_section="strip")
c.add_port("o2", center=(L, w_II / 2), width=w_II,
orientation=0, cross_section=xs_slot)
return c
strip_to_slot()Figure 5:A parametric cell. (a) The strip-to-slot converter as a function of widths, gap and length. The @gf.cell decorator caches the result and gives the cell a unique name. Two ports declare where the converter can be connected, o1 to a strip waveguide and o2 to the slot waveguide of Figure 4. (b) The layout returned by strip_to_slot(), with ports drawn as arrows.
The decorator @gf.cell adds three behaviors. First, the decorator derives a unique and deterministic cell name from the function name and the arguments, for example strip_to_slot_WI0p5_WI0p8_G0p1_L5 for strip_to_slot(L=5). Second, the decorator caches the result. Calling the function again with the same arguments returns the existing component instead of a duplicate, so that all references of shared geometry point to the same cell. Third, the decorator locks the returned component. A shared component may be used by many parents, and a later modification would silently change every parent, so GDSFactory raises an error instead. A modified variant is obtained by calling the function with different arguments or by modifying a copy (c.copy()).
The second new element in Figure 5 is the port. A port is a named point on the boundary of a component, together with a direction (pointing out of the component), a width, a layer or cross-section, and a type such as optical or electrical. Ports turn a collection of polygons into a building block, because ports state where and how a component may be connected. By convention, optical ports are named o1, o2, … and electrical ports e1, e2, …, clockwise, starting from the bottom-left (west) port.
Connecting components¶
With ports in place, components are easily assembled without manually calculating coordinates. ref.connect("o2", other_port) moves and rotates the reference until port o2 of the reference sits on other_port, facing other_port. In Figure 6 the phase shifter of the modulator is built from a straight slot waveguide and two converters, and c.add_port("o1", port=...) re-exports a port of a reference as a port of the new cell. The slot waveguide uses an extended cross-section xs_pm, which adds thin silicon slabs below the rails that extend outwards on both sides and leave the slot open. In a real device, the doped slabs connect the silicon rails electrically to the metal electrodes, so that the drive voltage drops across the narrow, polymer-filled slot. The doping, as well as the taper that usually introduces the slab gradually, is omitted for brevity.
# slot + thin silicon slabs below the rails, reaching
# outwards below the electrodes (the slot stays open)
xs_pm = xs_slot.append_sections(sections=tuple(
gf.Section(width=5.1, offset=s * (w_II / 4 + 2.55),
layer="SLAB90") for s in (-1, 1)))
@gf.cell
def eo_phase_shifter(length: float = 100.0,
cross_section=xs_pm) -> gf.Component:
c = gf.Component()
slot = c << gf.components.straight(
length=length, cross_section=cross_section)
s2s_in = c << strip_to_slot()
s2s_out = c << strip_to_slot()
# move & rotate references until ports meet
s2s_in.connect("o2", slot.ports["o1"])
s2s_out.connect("o2", slot.ports["o2"])
# expose the outer ports of the converters
c.add_port("o1", port=s2s_in.ports["o1"])
c.add_port("o2", port=s2s_out.ports["o1"])
return c
eo_phase_shifter(length=10)Figure 6:Connecting components by their ports. (a) The phase shifter consists of a straight slot waveguide with silicon slabs on both sides (cross-section xs_pm) and two strip-to-slot converters attached with connect. The outer ports of the converters become the ports of the phase shifter. (b) A 10 µm long phase shifter.
Hierarchy and reuse in a modulator¶
Hierarchical design hides the details of a building block behind ports and parameters. The library function gf.components.mzi builds a Mach-Zehnder interferometer from a splitter, bends and straight sections, and accepts other component factories as arguments. Passing the phase shifter as straight_x_top and straight_x_bot directly yields a Mach-Zehnder modulator (Figure 7).
import numpy as np
def gsg(w_s, gap, w_g, **kw) -> gf.CrossSection:
"""Coplanar ground-signal-ground line on metal 3."""
o = (w_s + w_g) / 2 + gap # offset of the grounds
return gf.CrossSection(sections=( # names: for tapers
gf.Section(width=w_s, layer="M3", name="s",
port_names=("e1", "e2"),
port_types=("electrical",) * 2),
gf.Section(width=w_g, offset=+o, layer="M3", name="g1"),
gf.Section(width=w_g, offset=-o, layer="M3", name="g2"),
), **kw)
@gf.cell
def mzm(length: float = 300, gap: float = 4,
w_gnd: float = 20, offset: float = 0) -> gf.Component:
c = gf.Component()
# generic MZI, with our phase shifter in both arms
mzi = c << gf.components.mzi(
delta_length=0, length_x=length, length_y=0,
straight_x_top=eo_phase_shifter,
straight_x_bot=eo_phase_shifter,
cross_section_x_top=xs_pm,
cross_section_x_bot=xs_pm,
add_optical_ports_arms=True,
auto_rename_ports=False)
y = mzi.ports["top_o1"].y - mzi.ports["in_o1"].y
# GSG electrodes along the arms, with via stacks
# down to the slabs along the path
via = gf.components.via_stack_slab_m3(size=(3, 3))
vias = tuple(gf.ComponentAlongPath(component=via,
spacing=5, padding=2.5, # vias inside the path
offset=s * (y + d * (gap / 2 + 1.6)))
for s in (-1, 1) for d in (-1, 1))
xs = gsg(2 * y - gap, gap, w_gnd)
line = c << gf.components.straight(length,
cross_section=xs.copy(components_along_path=vias))
line.center = (mzi.x, mzi.ports["in_o1"].y)
# feed beyond the output: a taper into GSG probe pads
# at 100 µm pitch, sheared sideways by `offset`
xs_pad = gsg(80, 20, 80)
taper = gf.components.taper_cross_section(
xs, xs_pad, length=300, npoints=101)
shift = lambda x: offset / 2 * (1 - np.cos(np.pi * x / 300))
sheared = gf.Component()
for layer, polygons in taper.get_polygons_points(
by="tuple").items():
for pts in polygons:
sheared.add_polygon([(x, y + shift(x))
for x, y in pts], layer=layer)
sheared.add_ports(taper.ports)
sheared.ports["e2"].center = (300, offset)
feed = c << sheared
pads = c << gf.components.straight(
80, cross_section=xs_pad)
feed.connect("e1", line.ports["e2"])
pads.connect("e1", feed.ports["e2"])
c.add_port("o1", port=mzi.ports["in_o1"])
c.add_port("o2", port=mzi.ports["ou_o1"])
return c
mzm()Figure 7:A Mach-Zehnder modulator. (a) The generic MZI receives the phase shifter as component factory for both arms. The function gsg returns a GSG cross-section of three metal sections. Along the arms, the GSG line carries via stacks that connect the metal to the silicon slabs. Beyond the output end of the electrodes, a feed line tapers into three probe pads at 100 µm pitch and moves sideways by offset. (b) The 300 µm long modulator without offset, drawn rotated by 90°. The two slot arms lie in the gaps between the signal electrode and the grounds, so that the arms are driven in push-pull.
The electrodes are another example of a cross-section, this time on the metal layer M3. A section of a cross-section can also define ports, as the signal line does here. With ComponentAlongPath, a cross-section additionally places a component at regular intervals along the path, here the via stacks that connect the electrodes to the silicon slabs below. The dimensions of the electrodes are computed from the positions of the MZI arms, which the MZI exposes as ports with add_optical_ports_arms=True. The arguments delta_length=0 and length_y=0 make the two arms equally long and place the arms as close together as the bends allow. Positions are never provided explicitly as numbers but derived from the ports of the components involved, so that the design remains correct when parameters change. Only the ports needed at the next level of the hierarchy are exported, namely the optical input and output.
The same cross-section function also describes the feed line. taper_cross_section interpolates the width and offset of each section between two cross-sections with matching section names, here from the electrode dimensions to the pitch of a GSG probe. The polygons of the taper are then sheared sideways along a cosine over the 300 µm length of the taper, so that every cross-section keeps its orientation and only moves sideways. An extrusion of the taper along a curved path would fold the outer edge of a ground back onto itself wherever the bend radius is smaller than the distance of that edge from the center line, which happens for a short feed line with a large offset. The transmitter in Figure 10 uses the offset to place the probe pads of neighboring modulators at a wider pitch than the modulators. The probe pads are a short straight of the pad cross-section. Because the signal line lies between the two arms and the arms join at both ends of the MZI, the feed line necessarily crosses a waveguide, here the output combiner and the output waveguide of the MZI. In the transmitter of Figure 10, the routes from the modulators to the multiplexer also pass below the feed lines of the modulators further east. The metal layer M3 lies 3.2 µm above the waveguides, so that these crossings do not affect the light. The electrode is short compared with the electrical wavelength at 50 GHz, and the modulator is therefore driven as a lumped element without termination, as in the link simulation of Time-domain simulation of the optical link.
Routing¶
Connections take up a large part of the area of a typical photonic chip. A waveguide connection has to preserve the cross-section, respect a minimum bend radius and avoid crossings. GDSFactory routing functions generate such connections between pairs of ports or lists of ports. gf.routing.route_single connects two ports with a Manhattan route of straight sections and bends, using the bend radius defined by the cross-section. In Figure 8 route_single connects a chain of add-drop ring filters into a ring filter bank.
@gf.cell
def ring_bank(lengths: tuple = (1, 1.06, 1.12, 1.18),
gap: float = 0.2,
pitch: float = 40) -> gf.Component:
"""Bus waveguide with one add-drop ring per length."""
c = gf.Component()
previous = c << gf.components.straight(10)
c.add_port("o1", port=previous.ports["o1"])
for i, length_x in enumerate(lengths):
# longer ring -> red-shifted resonance
ring = c << gf.components.ring_double(
gap=gap, length_x=length_x)
ring.x = 30 + i * pitch
bend = c << gf.components.bend_euler()
bend.connect("o1", ring.ports["o3"], mirror=True)
c.add_port(f"d{i + 1}", port=bend.ports["o2"])
# waveguide from the previous ring to this one
gf.routing.route_single(
c, previous.ports["o2"], ring.ports["o1"],
cross_section="strip")
previous = ring
c.add_port("o2", port=previous.ports["o2"])
return c
ring_bank()Figure 8:Ring filter bank. (a) A loop places one add-drop ring filter (library component ring_double) per entry of lengths along a bus, after a short input waveguide. Each ring is 2 × 0.06 µm longer than the previous ring, which shifts the resonance by about 1.6 nm. Euler bends turn the drop ports north, and route_single connects consecutive rings. (b) Bank of four rings with input o1, through port o2 and drop ports d1 to d4.
A single ring has a Lorentzian response and suppresses distant channels only weakly. The demultiplexer of the transceiver therefore has two stages (Figure 9). A coupled-resonator optical waveguide (CROW), a series of coupled rings, has a flatter pass band and steeper edges than a single ring and first splits the four channels into two bands. The CROW drop port delivers channels 1 and 2, and the CROW through port delivers channels 3 and 4. A ring bank for each band then separates the channels within the band. The library cell ring_crow_couplers builds the CROW from three racetrack resonators and four straight directional couplers (coupler_straight). The circumference of the racetracks sets the free spectral range to four channel spacings, so that the periodic pass band of the CROW covers channels 1 and 2 and blocks channels 3 and 4. The coupling gaps are optimized in Gradient-based optimization. The buses of both ring banks lie level with the drop port of the CROW, so that all drop ports lie at the same height. The drop ports lie at one pitch, with the CROW centered between d1 and d3. At a small pitch, the gap between d1 and d3 widens, so that the inputs of the ring banks keep at least 30 µm from the CROW. The drop port of the CROW therefore continues straight into the first ring bank. route_single connects the through port of the CROW to the second ring bank along a vertical section 10 µm east of the CROW, set by the parameter steps. The ring bank of the first band is mirrored, because the light leaves the CROW drop port towards the west.
from functools import partial
def crow(gaps=(0.123, 0.153)) -> gf.Component:
"""Three racetracks of 90.87 µm circumference: FSR of
4 channels, pass band between channels 1 and 2."""
cs = [partial(gf.components.coupler_straight,
length=23.443, gap=g)
for g in (gaps[0], gaps[1], gaps[1], gaps[0])]
return gf.components.ring_crow_couplers(
radius=(7, 7, 7), couplers=tuple(cs))
@gf.cell
def wdm_demux(n: int = 4, dl: float = 0.06,
gap: float = 0.2,
pitch: float = 300) -> gf.Component:
"""CROW band splitter followed by two ring banks."""
c = gf.Component()
band = c << crow()
lx = tuple(1 + i * dl for i in range(n))
lo = c << ring_bank(lx[:n // 2], gap, pitch)
hi = c << ring_bank(lx[n // 2:], gap, pitch)
lo.mirror_x() # light runs west
# bank buses level with the CROW drop port, drops at
# one pitch, but inputs at least 30 µm beside the CROW
for bank in (lo, hi):
bank.movey(band.ports["o3"].y - bank.ports["o1"].y)
lo.movex(min(band.x - pitch / 2 - lo.ports["d1"].x,
band.xmin - 30 - lo.ports["o1"].x))
hi.movex(max(band.x + pitch / 2 - hi.ports["d1"].x,
band.xmax + 30 - hi.ports["o1"].x))
route = partial(gf.routing.route_single, c,
cross_section="strip")
route(band.ports["o3"], lo.ports["o1"]) # straight
route(band.ports["o2"], hi.ports["o1"], steps=[ # up
{"x": band.xmax + 10}, {"y": hi.ports["o1"].y}])
c.add_port("o1", port=band.ports["o1"])
c.add_port("o2", port=hi.ports["o2"])
for i in range(n // 2):
c.add_port(f"d{i + 1}", port=lo.ports[f"d{i + 1}"])
c.add_port(f"d{i + n // 2 + 1}",
port=hi.ports[f"d{i + 1}"])
return c
wdm_demux(pitch=150) # compact, for printFigure 9:Two-stage wavelength demultiplexer. (a) The function crow returns a CROW band filter from the library, with the couplers passed as partially applied component factories. The PCell wdm_demux attaches one ring bank to the drop port and one ring bank to the through port of the CROW. (b) Four-channel demultiplexer with input o1, through port o2 and drop ports d1 to d4, drawn with a pitch of 150 µm instead of the default 300 µm. The CROW in the center sends channels 1 and 2 to the western ring bank and channels 3 and 4 to the eastern ring bank.
Routing many waveguides one by one is error-prone. gf.routing.route_bundle routes lists of ports as a bundle with a constant pitch and avoids collisions within the bundle, as used for the receiver in Describing circuits in YAML. Where a route has to follow a given path, the argument steps of the routing functions prescribes the path as a sequence of absolute or relative coordinates. In the transmitter (Figure 10), four modulators stand upright at a pitch of 150 µm. The S-bends of the feed lines fan out to probe pads at a pitch of 350 µm, which leaves 70 µm between the pads of neighboring modulators. The demultiplexer lies west and a second demultiplexer east of the modulators, both turned so that the drop ports face the modulators. The two demultiplexers are mirror images of each other. Because the light paths are reciprocal, the eastern demultiplexer acts as multiplexer and combines the channels into port o1. No ring therefore lies below the metal of the feed lines, where the metal would add loss. route_single routes each channel along steps below the modulators from a drop port to a modulator input and above the modulators from the modulator output to the multiplexer. The routes are nested at a spacing of 10 µm, with the highest drop port connected to the nearest modulator, so that no routes cross. Both optical ports of the lane face south, towards the grating couplers added in Figure 23.
@gf.cell
def tx_lane(n: int = 4, pitch: float = 150,
pad_pitch: float = 350) -> gf.Component:
c = gf.Component()
mods = [c << mzm(offset=((n - 1) / 2 - i)
* (pad_pitch - pitch)) for i in range(n)]
for i, m in enumerate(mods): # upright, side by side
m.rotate(90)
m.movex(i * pitch - m.ports["o1"].x)
o1, o2 = mods[0].ports["o1"], mods[0].ports["o2"]
x_w = o1.x - pitch / 2 # west and east of the
x_e = mods[-1].ports["o1"].x + pitch / 2 # modulators
# filters beside the modulators, drops facing them
demux = c << wdm_demux(n=n, pitch=80)
demux.rotate(90)
demux.mirror_x()
mux = c << wdm_demux(n=n, pitch=80)
mux.rotate(90)
demux.xmax, mux.xmin = x_w - 60, x_e + 60
demux.y = mux.y = (o1.y + o2.y) / 2
# nested routes below and above the modulators
drops = sorted((demux.ports[f"d{i + 1}"]
for i in range(n)), key=lambda p: -p.y)
for k, (d, m) in enumerate(zip(drops, mods)):
s, t = 10 * k, 10 * (n - 1 - k)
gf.routing.route_single(c, d, m.ports["o1"],
cross_section="strip", steps=[{"x": x_w - s},
{"y": o1.y - 20 - s}, {"x": m.ports["o1"].x}])
gf.routing.route_single(c, m.ports["o2"],
mux.ports[d.name], cross_section="strip",
steps=[{"y": o2.y + 20 + t}, {"x": x_e + t},
{"y": mux.ports[d.name].y}])
c.add_port("o1", port=demux.ports["o1"])
c.add_port("o2", port=mux.ports["o1"])
return c
tx_lane()Figure 10:The transmitter lane. (a) Four upright modulators at 150 µm pitch receive feed line offsets that fan out to probe pads at 350 µm pitch. The demultiplexer west and the multiplexer east of the modulators are connected to the modulators by nested routes, prescribed by steps below and above the modulators. (b) The transmitter lane. All rings lie beside the metal of the feed lines, and both optical ports face south.
Describing circuits in YAML¶
A PCell written in Python offers loops, conditions and arithmetic. Many circuits, however, consist of a list of components, their positions and their connections. For such circuits, GDSFactory offers a declarative description in YAML, which is easy to read and easy to generate with other tools, for instance a schematic editor. Figure 11 describes the receiver lane in YAML. A YAML netlist consists of instances (components and settings), placements (absolute or relative to a port of another instance), connections (ports joined by moving the first instance), routes (connections to be routed, grouped into bundles) and exported ports. Instances without placement or connection, such as demux, sit at the origin. Any component factory can be used as long as the factory is known to the active PDK, and PDK.register_cells adds Python PCells to the active PDK.
instances:
demux: {component: wdm_demux, settings: {pitch: 350}}
pd1: {component: ge_detector_straight_si_contacts}
pd2: {component: ge_detector_straight_si_contacts}
pd3: {component: ge_detector_straight_si_contacts}
pd4: {component: ge_detector_straight_si_contacts}
gsg1: {component: gsg_pads}
gsg2: {component: gsg_pads}
gsg3: {component: gsg_pads}
gsg4: {component: gsg_pads}
input: {component: straight}
through: {component: straight}
connections: # photodiodes on the drops, pads on the contacts
pd1,o1: demux,d1
pd2,o1: demux,d2
pd3,o1: demux,d3
pd4,o1: demux,d4
gsg1,e1: pd1,top
gsg2,e1: pd2,top
gsg3,e1: pd3,top
gsg4,e1: pd4,top
placements:
# optical ports at the bottom east, level with the transmitter
input: {port: o1, x: 595, y: -462.788, rotation: 90}
through: {port: o1, x: 605, y: -462.788, rotation: 90}
routes:
input: # around the CROW and below the filter to the east
routing_strategy: route_bundle
settings: {cross_section: strip, start_straight_length: 10}
links: {"demux,o1": "input,o2"}
through:
routing_strategy: route_bundle
settings: {cross_section: strip, start_straight_length: 10}
links: {"demux,o2": "through,o2"}
ports:
o1: input,o1
o2: through,o1Figure 11:The receiver lane in YAML. (a) Germanium photodiodes (ge_detector_straight_si_contacts) are connected directly to the drop ports of a demultiplexer with a pitch of 350 µm, and a set of GSG probe pads (the Python PCell gsg_pads) is connected directly to the two contacts of each photodiode. Two short straights mark the optical ports at the east end of the lane, 462.8 µm below the input of the demultiplexer, which gives the receiver lane the height of the transmitter lane. route_bundle routes the input and the through port of the demultiplexer to the two straights. (b) The receiver lane. Both waveguides run along the east edge, and the space west of the waveguides remains free.
Both contacts leave the photodiode on the same side, as signal and ground at a pitch of 15 µm. In gsg_pads, taper_cross_section widens a cross-section of the signal line and one ground over 60 µm into the signal pad and one ground pad, and the two ground pads of the GSG probe are joined behind the signal pad. The feed is much shorter than the electrical wavelength at 50 GHz, so that the photodiode remains a lumped load for the GSG probe. The function gf.read.from_yaml turns the YAML file into a component, which can be used like any other component. Conversely, c.get_netlist() extracts the instances, connections and ports of any component in the same structure, which is the basis of circuit simulation in Circuit simulation.
Regression testing¶
A PDK or a cell library is software and should be tested like software. A typical failure is a change to a basic building block that silently alters every cell using the block. For example, a designer increases the default length of the converter taper from 3 µm to 5 µm to build a second device. The change is harmless for the new device but also modifies every phase shifter and modulator, which may already have been characterized on a previous tape-out.
# Rev. 1 was taped out: store its layout as reference
short = dict(length=2, cross_section=xs_slot) # compact
ref_gds = eo_phase_shifter(**short).write_gds(
workdir / "ref.gds")
strip_to_slot = strip_to_slot_rev2 # switch to Rev. 2
gf.clear_cache() # forget cells built with Rev. 1
run_gds = eo_phase_shifter(**short).write_gds(
workdir / "run.gds")
# compare: layout diff, then XOR of every layer
result = gf.diff(ref_gds, run_gds,
out_file=workdir / "diff.gds")
assert result # True: the layout has changed
# old (top), new (middle) and their XOR (bottom)
xor = gf.import_gds(workdir / "diff.gds", cellname="_xor")
old, new = gf.import_gds(ref_gds), gf.import_gds(run_gds)
gf.grid([xor, new, old], shape=(3, 1), spacing=(1, 1))Figure 12:Detecting a geometric regression. (a) A short phase shifter without slabs, generated with the modified converter (revision 2), is compared with the reference GDS file of revision 1, stored in the temporary directory workdir. (b) Old layout (top), new layout (middle) and XOR (bottom). Only the converters differ.
GDSFactory detects such regressions by comparing the generated layout with a stored reference. In Figure 12 the phase shifter of revision 1 is stored as ref.gds. After switching to the modified converter strip_to_slot_rev2, the phase shifter is regenerated and compared with the reference by gf.diff. The phase shifter looks up strip_to_slot when called and therefore picks up revision 2, while gf.clear_cache() makes sure that no cached copy of revision 1 is reused. gf.diff first compares the two layouts cell by cell and, if differences are found, computes the geometric XOR of every layer.
In an appropriately set up project, such checks run automatically in continuous integration. With the pytest framework, a test module can be as short as Listing 13.
import gdsfactory as gf
import pytest
from my_pdk import PDK
PDK.activate()
cells = ["strip_to_slot", "eo_phase_shifter", "mzm"]
@pytest.mark.parametrize("name", cells)
def test_gds(name):
gf.difftest(gf.get_component(name), test_name=name)
@pytest.mark.parametrize("name", cells)
def test_settings(name, data_regression):
c = gf.get_component(name)
data_regression.check(c.to_dict(with_ports=True))Figure 13:Regression tests with pytest. The first test compares the geometry of each cell with a stored reference GDS file. The second test compares settings and ports with stored references, using the pytest-regressions plugin.
On the first run, gf.difftest stores the reference GDS file and fails once. Afterwards, gf.difftest fails whenever the geometry changes, shows the XOR in KLayout and offers to accept the change. The second test also detects changes in settings and ports that do not show up in the geometry. A deliberate change is accepted by regenerating the references and committing the references together with the code, so that every change to the layout is visible in code review.
Simulation and optimization¶
A layout is only useful if the fabricated device works. GDSFactory is not a solver but supplies simulators with geometry, materials and connectivity, keeping the layout the single source of truth. Plugins in the gplugins package connect GDSFactory to mode solvers, finite-difference time-domain (FDTD) and eigenmode-expansion (EME) solvers, technology computer-aided design (TCAD), thermal and radio-frequency (RF) solvers and circuit simulators (SAX, SPICE, circulax).
Mode solving from the layout¶
The field distribution in the slot is computed with the finite-element mode solver femwell Gehring, n.d., which is built on scikit-fem Gustafsson & McBain, 2020 and gmsh Geuzaine & Remacle, 2009. The geometry of the waveguide cross-section comes from two sources. The lateral dimensions come from the cross-section xs_pm of Figure 6. The vertical dimensions, namely the thicknesses of the silicon core and the slab and their materials, come from the layer stack of the PDK, which records the height, thickness and material of each layer. The function xs_to_polygons combines both into polygons for a mesher, and the slot itself is added as a separate region.
from femwell.maxwell.waveguide import compute_modes
from femwell.mesh import mesh_from_OrderedDict
from skfem import Basis, ElementTriP0
from skfem.io.meshio import from_meshio
import shapely
from gf_photonics_paper import plot_mode, xs_to_polygons
# lateral geometry from the cross-section,
# heights and materials from the PDK layer stack
shapes, material = xs_to_polygons(
xs_pm, PDK.layer_stack, clad="polymer", xspan=12)
t = PDK.layer_stack.layers["core"].thickness
slot = {"slot": shapely.box(-g, 0, g, t)} # own region
cores = {k: v for k, v in shapes.items() if "core" in k}
shapes = cores | slot | shapes # rails take precedence
material["slot"] = "polymer"
mesh = from_meshio(mesh_from_OrderedDict(shapes,
{k: {"resolution": 0.01, "distance": 0.4}
for k in shapes if k.startswith("core")},
default_resolution_max=0.3))
basis = Basis(mesh, ElementTriP0())
n = {"si": 3.48, "sio2": 1.44, "polymer": 1.7}
eps = basis.zeros()
for name in shapes:
dofs = basis.get_dofs(elements=name)
eps[dofs] = n[material[name]] ** 2
mode = compute_modes(basis, eps, wavelength=1.55,
num_modes=1)[0]
# share of the mode in the slot, where the field is
gamma = mode.calculate_confinement_factor("slot").real
plot_mode(mode)---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Cell In[16], line 2
1 from femwell.maxwell.waveguide import compute_modes
----> 2 from femwell.mesh import mesh_from_OrderedDict
3 from skfem import Basis, ElementTriP0
4 from skfem.io.meshio import from_meshio
5 import shapely
File ~/work/photonics_paper/photonics_paper/.venv/lib/python3.13/site-packages/femwell/mesh/__init__.py:1
----> 1 from femwell.mesh.mesh import mesh_from_Dict, mesh_from_OrderedDict
2 from femwell.mesh.meshtracker import MeshTracker
4 __all__ = [
5 "MeshTracker",
6 "mesh_from_OrderedDict",
7 "mesh_from_Dict",
8 ]
File ~/work/photonics_paper/photonics_paper/.venv/lib/python3.13/site-packages/femwell/mesh/mesh.py:5
2 from itertools import combinations, product
3 from typing import Dict, List, Optional, Tuple
----> 5 import gmsh
6 import numpy as np
7 import pygmsh
File ~/work/photonics_paper/photonics_paper/.venv/lib/python3.13/site-packages/gmsh.py:92
88 print("Warning: could not find Gmsh shared library " + libname +
89 " with ctypes.util.find_library() or in the following locations: " +
90 str(possible_libpaths))
91
---> 92 lib = CDLL(libpath)
93
94 try_numpy = True # set this to False to never use numpy
95
File ~/.local/share/uv/python/cpython-3.13.18-linux-x86_64-gnu/lib/python3.13/ctypes/__init__.py:361, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
358 if name:
359 name = _os.fspath(name)
--> 361 self._handle = self._load_library(name, mode, handle, winmode)
File ~/.local/share/uv/python/cpython-3.13.18-linux-x86_64-gnu/lib/python3.13/ctypes/__init__.py:403, in CDLL._load_library(self, name, mode, handle, winmode)
401 if handle is not None:
402 return handle
--> 403 return _dlopen(name, mode)
OSError: libGLU.so.1: cannot open shared object file: No such file or directoryFigure 14:Mode solving from the layout. (a) The cross-section of the phase shifter and the PDK layer stack are converted into polygons, meshed and solved for the fundamental mode at 1550 nm, with an electro-optic polymer cladding of refractive index 1.7. (b) Magnitude of the horizontal electric field of the quasi-TE mode, with silicon and slot outlined in white. The field is strongly enhanced inside the 100 nm slot.
The mode in Figure 14 shows the defining property of a slot waveguide Almeida et al., 2004. The normal component of the electric displacement is continuous at the silicon-polymer interfaces, so the electric field in the low-index slot exceeds the field in the rails by the ratio of the permittivities. The drive voltage drops across the slot, so the electro-optic interaction takes place in the slot. The confinement factor of the mode in the slot, Γ ≈ 0.14, together with the narrow slot width determines the efficiency of the modulator.
Circuit simulation¶
Full-wave simulations of an entire circuit are usually prohibitively expensive. Circuits are instead simulated by combining the scattering matrices (S-matrices) of the components. In the circuit simulator SAX Laporte, n.d., a component model is a plain Python function that returns the S-parameters as a function of wavelength and design parameters (Listing 15).
import jax.numpy as jnp
import sax
L_bend = gf.components.bend_euler().info["length"]
def straight(wl=1.55, length=10.0, **kw):
s = sax.models.straight(wl=wl, wl0=1.55, neff=2.44,
ng=4.2, length=length)
return sax.rename_ports(s, {"in0": "o1",
"out0": "o2"})
def bend_euler(wl=1.55, **kw):
return straight(wl, length=L_bend)
def coupler_ring(wl=1.55, gap=0.2, length_x=4.0, **kw):
k2 = 0.6 * jnp.exp(-gap / 0.12) # toy |kappa|^2(gap)
t, k = jnp.sqrt(1 - k2), 1j * jnp.sqrt(k2)
# phase from the coupling point to a ring port
# (one bend + half the straight = 1/4 of the ring)
q = straight(wl, L_bend + length_x / 2)["o1", "o2"]
return sax.reciprocal({
("o1", "o4"): t, ("o1", "o3"): k * q,
("o2", "o4"): k * q, ("o2", "o3"): t * q**2,
})
models = dict(straight=straight, bend_euler=bend_euler,
coupler_ring=coupler_ring)Figure 15:Compact models for SAX. The straight waveguide uses the dispersive waveguide model of SAX with effective and group index of the strip waveguide. The length of an Euler bend is taken from the layout. The ring coupler combines an exponential dependence of the power coupling on the gap with the phase accumulated in the ring part of the coupler. The dictionary models maps the component names of the netlist to the models.
The ring coupler model includes the phase between coupling point and ring ports, because the GDSFactory cell coupler_ring contains the bent waveguides of the lower half of the ring. The models in Listing 15 are intentionally simple, and the coupling coefficient follows a toy model. In practice, compact models are fitted to simulation results, for example from FDTD, or supplied by the foundry as part of the PDK. The circuit itself, however, is not written by hand. get_netlist(recursive=True) extracts the instances, settings and connections from the layout of the ring bank, including the internal structure of each ring, and sax.circuit turns the netlist and the models into a function of wavelength (Figure 16).
from gf_photonics_paper import plot_spectra
# netlist extracted from the layout (incl. hierarchy)
netlist = ring_bank().get_netlist(recursive=True)
circuit, _ = sax.circuit(netlist, models=models)
wl = jnp.linspace(1.546, 1.556, 2001)
S = circuit(wl=wl)
ports = ["o2", "d1", "d2", "d3", "d4"]
plot_spectra(wl, {p: jnp.abs(S["o1", p]) ** 2
for p in ports}, db=True)Figure 16:Circuit simulation from the layout. (a) The netlist of the ring bank of Figure 8 is extracted from the layout and simulated with SAX. (b) Transmission from the input to the through port o2 and to the four drop ports d1 to d4. The channels are spaced by 1.6 nm.
Because the netlist is extracted from the layout, the simulation reflects the actual lengths of all routes and bends, and every change to the layout automatically shows up in the spectrum.
Gradient-based optimization¶
SAX circuits are differentiable with respect to all model parameters, which enables gradient-based optimization. In Figure 17 the coupling gap of the ring filters is chosen such that the drop port has a pass band of 0.5 nm full width, wide enough to tolerate a small drift of the laser wavelength. Parameters of individual instances are passed by the instance names of the extracted netlist, here coupler_ring and coupler_ring2 for the two couplers of the ring. The objective function compares the simulated drop spectrum with a target Lorentzian. JAX Bradbury et al., 2018 provides the exact gradient of the objective, and a quasi-Newton optimizer from SciPy finds the optimum within a few iterations.
from scipy.optimize import minimize
ring = gf.components.ring_double(gap=0.2, length_x=1)
sim, _ = sax.circuit(ring.get_netlist(recursive=True),
models=models)
wl = jnp.linspace(1.5475, 1.5515, 801)
def drop(gap): # drop-port spectrum vs. coupling gap
S = sim(wl=wl, coupler_ring={"gap": gap},
coupler_ring2={"gap": gap})
return jnp.abs(S["o1", "o3"]) ** 2
wl0 = wl[jnp.argmax(drop(0.2))] # resonance
target = 1 / (1 + ((wl - wl0) / 0.25e-3) ** 2)
@jax.jit
def loss(x): # mismatch to the target spectrum
return jnp.mean((drop(x[0]) - target) ** 2)
res = minimize(loss, x0=[0.2], bounds=[(0.1, 0.4)],
jac=jax.jit(jax.grad(loss)))
gap = round(float(res.x[0]), 3) # snap to the 1 nm grid
plot_spectra(wl - wl0, {"gap = 0.200 µm": drop(0.2),
f"gap = {gap:.3f} µm": drop(gap), "target": target},
detuning=True)Figure 17:Optimizing the coupling gap of a ring filter. (a) The netlist of a single add-drop ring is simulated as a function of the coupling gap, and the mismatch to a target pass band is minimized with gradients from JAX. (b) Drop-port transmission for the initial gap of 200 nm, for the optimized gap and for the target.
Reducing the gap from 200 nm to 151 nm increases the coupling and broadens the resonance to the desired width. The optimized value is rounded to the 1 nm design grid and fed back into the PCell gf.components.ring_double(gap=gap), which closes the loop between simulation and layout.
The same approach scales to several parameters. In Figure 18 the gaps of the CROW band filter of Figure 9 are optimized, with one gap shared by the two bus couplers and one gap shared by the two couplers between the rings. The objective requires full transmission to the drop port over channels 1 and 2 and suppression of channels 3 and 4, each with a margin of ±0.3 nm. In the extracted netlist, the bus couplers are the instances coupler_straight and coupler_straight2.
def coupler_straight(wl=1.55, gap=0.2, length=10.0, **kw):
kappa = 0.06 * jnp.exp(-(gap - 0.1) / 0.1) # toy
k2 = jnp.sin(kappa * length) ** 2
t, k = jnp.sqrt(1 - k2), 1j * jnp.sqrt(k2)
p = straight(wl, length)["o1", "o2"]
return sax.reciprocal({
("o1", "o4"): t * p, ("o2", "o3"): t * p,
("o1", "o3"): k * p, ("o2", "o4"): k * p})
def bend_circular(wl=1.55, radius=10.0, **kw):
return straight(wl, length=jnp.pi * radius / 2)
sim, _ = sax.circuit(crow((0.15, 0.3)).get_netlist(),
models={"coupler_straight": coupler_straight,
"bend_circular": bend_circular})
wl0 = 1.55028 # band center, between channels 1 and 2
wl = wl0 + jnp.linspace(-3.15e-3, 3.15e-3, 1261) # 1 FSR
dwl = (wl - wl0) * 1e3 # detuning in nm
def drop(x): # bus couplers: instances 1 and 2
bus, inner = {"gap": x[0]}, {"gap": x[1]}
S = sim(wl=wl, coupler_straight=bus,
coupler_straight2=bus,
coupler_straight3=inner,
coupler_straight4=inner)
return jnp.abs(S["o1", "o3"]) ** 2
# channels 1, 2 at ±0.79 nm pass, 3, 4 at ±2.36 nm
# are blocked, each with a margin of ±0.3 nm
inside, outside = abs(dwl) < 1.1, abs(dwl) > 2.05
loss = jax.jit(lambda x: (
jnp.mean((1 - drop(x)) ** 2, where=inside)
+ jnp.mean(drop(x) ** 2, where=outside)))
res = minimize(loss, x0=[0.15, 0.3],
bounds=[(0.1, 0.5)] * 2,
jac=jax.jit(jax.grad(loss)))
gaps = [round(float(x), 3) for x in res.x] # 1 nm grid
spectra = {"initial gaps": drop([0.15, 0.3]),
"optimized gaps": drop(gaps)}
layout = crow(gaps) # layout with optimized gaps
plot_spectra(wl - wl0, spectra, db=True, detuning=True)Figure 18:Synthesis of a flat-top band filter. (a) The netlist of the CROW is extracted from the layout and simulated with additional models for the straight coupler and the circular bend. The bus gap and the gap between the rings are optimized for transmission within ±1.1 nm and suppression beyond ±2.05 nm of the band center, with 100 nm as minimum gap. (b) Drop-port transmission over one free spectral range for the initial and the optimized gaps. (c) The optimized CROW filter.
With the initial gaps, the pass band is narrow and rounded. The optimizer reduces both gaps, which strengthens the coupling and flattens the pass band. The bus gap ends at 123 nm and the gap between the rings at 153 nm. The optimized filter has a ripple of 0.62 dB and a 1 dB pass band of 2.29 nm and suppresses channels 3 and 4 by 14.1 dB. The same PCell turns the optimized gaps directly into a layout (Figure 18c), and the optimized gaps are the default values of crow in Figure 9. Simulated with the same models, the complete demultiplexer delivers each channel to its drop port with a loss below 0.22 dB. The crosstalk from the neighboring channel within a band is −19.4 dB, limited by the single rings, and the crosstalk from the other band is below −33.6 dB.
Time-domain simulation of the optical link¶
Frequency-domain simulations determine how much light of a given wavelength reaches a port. A data link, however, is a time-domain problem. A bit pattern drives the modulator through the electrical parasitics, light needs time to build up in the rings (the photon lifetime), and the receiver converts the detected power into a voltage. The differentiable circuit simulator circulax GDSFactory contributors, n.d., also built on JAX, solves such mixed electrical and optical problems in the time domain. Optical signals are represented by the complex envelope at the carrier wavelength, so that the time step follows the data rate rather than the optical frequency.
The simulation covers one wavelength channel of the transceiver end to end. The optical path consists of a laser, a grating coupler, the demultiplexer ring, the push-pull slot modulator with driver, the multiplexer ring, a second grating coupler, 2 dB of fiber loss (with dispersion neglected), a third grating coupler, the receiver ring and the germanium photodiode on a 50 Ω load. Each ring consists of two directional couplers and two waveguides with a true propagation delay, with circumference and coupling of the filters designed in Circuit simulation and Gradient-based optimization. The CROW band filters, with a 1 dB pass band of 2.29 nm (about 290 GHz), are much wider than the signal spectrum and are omitted. The parameters of the modulator follow from the earlier results. The slot width, an electro-optic coefficient r₃₃ = 100 pm/V of the polymer and the confinement factor of the slot (Figure 14) give a voltage-length product of VπL = 2.3 V mm, and thus Vπ = 7.8 V for the 300 µm long arms of the MZM (Figure 7). Each arm is electrically a slot capacitor charged through the two doped silicon slabs, with an RC time constant of 2.7 ps.
The netlist of the link has about 40 instances and uses the same format as GDSFactory netlists. A seventh-order pseudo-random bit sequence (PRBS7) at 50 Gbit/s drives the modulator with a voltage swing of Vπ/2, which corresponds to a full π phase swing between the arms in the push-pull configuration. Figure 19 shows the received signal with an eye height of 21.6 mV.
from gf_photonics_paper import plot_eye
baud, spu = 50e9, 16 # symbol rate, samples per UI
link = compile_circuit(link_netlist(baud), link_models,
is_complex=True)
y0 = link.dc(params=carrier) # operating point, t = 0
ts = jnp.arange(144 * spu + 1) / (baud * spu)
sol = link.transient(t0=0.0, t1=float(ts[-1]),
dt0=float(ts[1]) / 2, y0=y0, saveat=ts,
params=carrier, max_steps=40 * len(ts))
v_rx = link.port(sol.ys, "rx").real * 1e3 # mV
plot_eye(v_rx, samples_per_ui=spu)Figure 19:Eye diagram of the complete optical link. (a) The circuit is compiled, the operating point is solved, and the circuit is integrated over 144 bits. The received voltage is folded into windows of two unit intervals (UI) at the clock phase with the largest vertical eye opening. (b) Eye diagram at 50 Gbit/s with non-return-to-zero (NRZ) modulation.
The eye is wide open, but the edges are visibly slowed, and isolated bits do not reach the full level. The bandwidth is limited by the three rings in the signal path, each with a pass band of 0.5 nm (about 60 GHz), and by the RC time constants of the modulator and the photodiode. Because the whole simulation is differentiable, the eye height can be optimized with respect to ring gaps, drive swing or electrode resistance in the same way as the filters above. The ring filters additionally need thermal tuning onto the channel grid, which is simulated in Appendix. Thermal tuning of the ring filters.
Process design kits¶
A PDK is the interface between a foundry and the designers. The PDK captures the information a designer needs about a fabrication process, namely the layers and layer numbers, the vertical structure of the wafer, the design rules and a library of validated components with simulation models. In GDSFactory, a PDK is a Python object, gf.Pdk, that bundles
layers, a map from layer names to GDS layer and datatype numbers,
layer views, colors and fill patterns for visualization, compatible with the layer properties of KLayout,
layer stack, the height, thickness, material and process information such as sidewall angles of each layer, used by simulators and for 3D visualization,
cross-sections, the waveguide and wire types, as factory functions,
cells, the component library, as factory functions, and
models, compact models for circuit simulation.
A PDK package usually also ships design-rule information, such as minimum widths, spacings and densities, in the form of KLayout DRC decks. When a PDK is activated, string names such as "WG", "strip" or "mzm" are resolved through the PDK. The indirection makes designs portable. A circuit that refers to "strip" and "mmi1x2" can be retargeted to another foundry by activating a different PDK that provides cells and cross-sections with the same names.
def slot(width: float = 0.8, gap: float = 0.1):
"""Slot waveguide cross-section factory."""
w_rail = (width - gap) / 2
return gf.CrossSection(sections=(
gf.Section(width=width, layer="WG", hidden=True,
port_names=("o1", "o2")),
*[gf.Section(width=w_rail, layer="WG",
offset=s * (w_rail + gap) / 2)
for s in (-1, 1)]))
tx_pdk = gf.Pdk(
name="transceiver",
layers=PDK.layers, # layer names <-> GDS numbers
layer_stack=PDK.layer_stack, # heights, materials
layer_views=PDK.layer_views, # colors, patterns
cross_sections=PDK.cross_sections | {"slot": slot},
cells=PDK.cells | {"strip_to_slot": strip_to_slot,
"eo_phase_shifter": eo_phase_shifter, "mzm": mzm,
"wdm_demux": wdm_demux, "tx_lane": tx_lane,
"rx_lane": rx_lane},
models=models, # compact models for SAX
)
tx_pdk.activate()
# PDK content is now addressable by name, e.g.
mod = gf.get_component("mzm", length=100)
xs = gf.get_cross_section("slot", gap=0.12)
# the layer stack: where each layer sits in 3D (µm)
for name in ["core", "slab90", "metal3"]:
lvl = tx_pdk.layer_stack.layers[name]
print(f"{name:6} z={lvl.zmin:4.2f} "
f"t={lvl.thickness:4.2f} {lvl.material}")Figure 20:A PDK for the transceiver. (a) A new PDK reuses the layers, layer stack and layer views of the generic PDK, replaces the generic slot cross-section by a custom factory, adds the PCells of the paper and attaches the SAX models of Listing 15. After activation, all PDK content is addressable by name. (b) Height (z), thickness (t) and material of three levels of the layer stack.
In Figure 20 the cells of the case study become a small PDK. Cross-sections are registered as functions (here slot), so that cross-sections can be parametrized by name, for example gf.get_cross_section("slot", gap=0.12). While PDK.register_cells in Describing circuits in YAML extended the active PDK on the fly, a separate gf.Pdk object makes the library explicit, versionable and shareable. In a real project, a PDK is a Python package under version control. The layer map and the layer stack are often generated from the documentation of the foundry or in collaboration with the foundry, and the cells are covered by the regression tests of Regression testing.
Several PDKs for GDSFactory are openly available. Photonic PDKs include the Cornerstone, SiEPIC EBeam (UBC), VTT and Luxtelligence PDKs. The Quantum RF PDK covers quantum circuits, and the IHP SG13G2, GlobalFoundries 180 nm MCU and SkyWater 130 nm PDKs cover RF, analog and digital design.
Verification¶
Before tape-out, a design must be verified. The design must satisfy the manufacturing constraints of the process (design rule check, DRC) and implement the intended circuit (layout versus schematic, LVS). GDSFactory performs such checks with the geometry engine and the report database of KLayout, so that every finding can be inspected in the marker browser of KLayout.
Design rule check¶
Design rules express the limits of the fabrication process, such as the minimum width of a feature, the minimum spacing between features, minimum enclosures of one layer by another, and minimum and maximum pattern densities. KLayout evaluates such rules efficiently on large, hierarchical layouts. For illustration, Figure 21 implements a minimum-width and a minimum-space rule in a few lines of Python. GDSFactory components are KLayout cells, so the full KLayout API is available. c.begin_shapes_rec iterates over all shapes of a layer through the hierarchy, and c.kcl.dbu is the database unit that converts micrometers into the integer coordinates of KLayout.
import klayout.db as kdb
def drc(c, layer="WG", min_width=0.15, min_space=0.15):
"""Minimal width and spacing rules with KLayout."""
to_dbu = lambda x: round(x / c.kcl.dbu)
region = kdb.Region(
c.begin_shapes_rec(gf.get_layer(layer)))
errors = (region.width_check(to_dbu(min_width))
+ region.space_check(to_dbu(min_space)))
# copy the layout and draw the error markers
marked = gf.Component()
marked << c
marked.shapes(gf.get_layer("DRC_MARKER")).insert(
errors.polygons(to_dbu(0.03)))
return marked
drc(strip_to_slot())Figure 21:A minimal design rule check. (a) The waveguide layer is merged into a KLayout Region and checked for widths and gaps below 150 nm. Violations are marked on the layer DRC_MARKER. (b) The converter violates both rules at the 50 nm tip and along the slot.
The violations in Figure 21 mark features at the limit of lithography, whose feasibility must be clarified with the foundry. Processes for slot waveguides therefore define dedicated rules for such regions in the PDK, often by marking the regions with an extra layer on which different rules apply.
Width and spacing rules do not detect a route that runs over another waveguide, because the merged region of the crossing waveguides has neither a narrow feature nor a narrow gap. Such collisions arise easily when an automatic router lacks the space for its bends. The check in Figure 22 therefore uses the hierarchy of the layout. In every cell, the waveguides of different instances may touch at their ports but must not overlap. Designed couplers keep a gap and therefore pass the check. Each cell is checked once, however often it is instantiated, and kdb.RecursiveInstanceIterator maps the overlaps found in a cell to all instances of the cell in the top cell. The complete chip of Figure 25 asserts the absence of collisions, so that a placement or routing error stops the generation of the chip.
from itertools import combinations
def collisions(c, layer="WG", skip=()):
"""Overlaps between the waveguides of different
instances, checked once in every cell below c."""
ly, li = c.kcl.layout, gf.get_layer(layer)
shapes = lambda ci: kdb.Region(
ly.cell(ci).begin_shapes_rec(li))
found = {}
for ci in (c.cell_index(), *c.kdb_cell.called_cells()):
if c.kcl[ci].function_name in skip:
continue
cell = ly.cell(ci)
parts = [kdb.Region(cell.shapes(li))] + [
shapes(i.cell_index).transformed(i.cplx_trans)
for i in cell.each_inst()]
found[ci] = kdb.Region()
for a, b in combinations(parts, 2):
if a.bbox().overlaps(b.bbox()):
found[ci] += a & b
# collect the overlaps in the coordinates of c
errors = found.get(c.cell_index(), kdb.Region())
it = kdb.RecursiveInstanceIterator(ly, c.kdb_cell)
while not it.at_end():
ci = it.inst_cell().cell_index()
if not found.get(ci, kdb.Region()).is_empty():
errors += found[ci].transformed(
it.trans() * it.inst_trans())
it.next()
return errors.merged()
# a route whose end lies too close beside its start
c = gf.Component()
band = c << crow()
bus = c << gf.components.straight(50)
bus.move((45, 75))
gf.routing.route_single(c, band.ports["o2"],
bus.ports["o1"], cross_section="strip",
start_straight_length=10)
c.shapes(gf.get_layer("DRC_MARKER")).insert(
collisions(c).sized(round(0.5 / c.kcl.dbu)))
cFigure 22:A collision check. (a) The function collisions intersects the waveguides of all pairs of sibling instances in every cell of the hierarchy. The test case routes the through port of a CROW to a bus whose input lies only 22 µm east of the through port. (b) The router lacks the space for two bends and loops back over the CROW. The check marks the three crossings.
Layout versus schematic¶
Measurement and validation¶
The design cycle does not end at tape-out. The fabricated chips must be characterized, and the results compared with the design. Wafer-scale testing with automated probe stations is only efficient if the test plan is known when the layout is made. GDSFactory therefore supports design for test (DFT) by treating test structures and test metadata as part of the design, and design for manufacturing (DFM) by test structures that monitor the fabrication process.
Test sites¶
Light is coupled into and out of the chip through grating couplers, which allow optical probing anywhere on the wafer with a fiber array. gf.routing.add_fiber_array routes all optical ports of a device to a row of grating couplers at the 127 µm pitch of a standard fiber array and optionally adds a loop-back between two couplers to calibrate the coupling loss. With straight_separation=10, the fiber array routes keep the same spacing of 10 µm as the routes within the transmitter. The argument x_grating_offset shifts the row of grating couplers sideways, which keeps the grating couplers of the receiver below the receiver lane. The transmitter and the receiver become test sites with metadata that tells the measurement software what to measure, as shown for the transmitter in Figure 23.
@gf.cell
def test_site(dut: str = "tx_lane",
measurement: str = "spectrum",
x_grating_offset: float = 0):
c = gf.Component()
# route the optical ports to grating couplers
c << gf.routing.add_fiber_array(
gf.get_component(dut), with_loopback=True,
straight_separation=10, # as the bundles
x_grating_offset=x_grating_offset)
# metadata for the measurement & analysis pipeline
c.info["doe"] = dut
c.info["measurement"] = measurement
return c
test_site("tx_lane")Figure 23:A test site. (a) A PCell routes the optical ports of any device in the PDK to grating couplers, with a loop-back for calibration, and records the device under test and the measurement as metadata in c.info. (b) The test site of the transmitter.
Test structures¶
Besides the circuits, a chip contains structures that monitor the fabrication and extract the parameters of individual components. Figure 24 adds three kinds of test structures.
Cut-back structures contain a device under test 16, 48 and 80 times in series. A linear fit of the transmission versus the number of devices yields the insertion loss per device, independent of the fiber coupling loss. Here the device is a short phase shifter, a pair of strip-to-slot converters with 2 µm of slot waveguide in between. Each cut-back structure is folded into rows, so that the structure is not wider than the fiber array, and becomes a test site with grating couplers.
Ring resonators with coupling gaps of 150 nm to 300 nm yield the coupling coefficient versus gap, which calibrates the toy coupler models of Circuit simulation.
Process control monitors measure the fabrication itself, for each layer of the process (waveguide, slab and three metal layers). Line steps of decreasing width measure the resolution, calipers the overlay with the waveguide layer and metal meanders the sheet resistance. A via chain, verniers, structures for line-width measurement in a scanning electron microscope (SEM) and an alignment mark complete the set.
# cut-back structures: 16, 48 and 80 short phase
# shifters in series, each one a test site
for rows in (1, 3, 5): # 16 devices per row
tx_pdk.register_cells(**{f"cutback_{16 * rows}":
partial(gf.components.cutback_component, cols=4,
rows=rows, component=eo_phase_shifter(length=2))})
cutbacks = [test_site(f"cutback_{n}", "insertion_loss")
for n in (16, 48, 80)]
# ring resonators with four coupling gaps
for n in (150, 200, 250, 300): # gap in nm
tx_pdk.register_cells(**{f"ring_{n}": partial(
gf.components.ring_single, gap=n / 1e3)})
rings = [test_site(f"ring_{n}", "spectrum")
for n in (150, 200, 250, 300)]
# process control monitors for each layer
layers = ("WG", "SLAB90", "M1", "M2", "M3")
process_control = [
*[gf.components.litho_steps(layer=layer) # resolution
for layer in layers],
*[gf.components.litho_calipers(layer1="WG", layer2=layer)
for layer in layers[1:]], # overlay with WG
*[gf.components.resistance_meander(name=layer, # sheet R
res_layer=layer, pad_layer=layer) for layer in layers[2:]],
gf.components.via_chain(), # via resistance M1/M2
gf.components.verniers(), # WG width and gap
gf.components.cdsem_all(), # WG widths for the SEM
gf.components.align_wafer(), # alignment mark
]
test_structures = cutbacks + rings + process_control
gf.pack(test_structures, spacing=20)[0] # an overviewFigure 24:Test structures. (a) Cut-back structures with 16, 48 and 80 phase shifters and ring resonators with four coupling gaps are registered in the PDK and wrapped into test sites. Together with process control monitors for each layer, the test sites form the list test_structures. (b) Overview of the test structures, packed by gf.pack.
The complete chip¶
The chip is assembled from the test sites and test structures (Figure 25). The test sites of the two lanes are placed side by side, relative to the bounding boxes of each other. Both lanes have the same height, with the optical ports at the bottom and the probe pads at the top, so that the grating couplers of both lanes form one row at the bottom of the die and the probe pads of both lanes one row at the top. The probes and the fiber array therefore approach from opposite sides. The function place_free then places the test structures, largest first, at the lowest free position. The free space is the bounding box of the two lanes minus all shapes of the lanes, enlarged by a spacing of 20 µm, so that the test structures fill the gaps between the actual structures of the lanes rather than between their bounding boxes. Before the placement, the shapes of the lanes are grown by 100 µm and shrunk again by 100 µm. This closing fills all gaps narrower than 200 µm, such as the gaps between the modulators and within the routing of the transmitter, so that no test structure lands inside a circuit. Waveguides are only 0.5 µm wide, so the shapes are grown by 1 µm before the curves are simplified, which would otherwise remove thin waveguides from the region. The function collisions of Figure 22 finally confirms that no waveguide overlaps another. The alignment mark align_wafer is skipped, because the marks overlap by design. The possible centers of a cell are all points whose distance from the occupied space exceeds half the cell size. A Minkowski sum of the occupied space with the cell box yields these points exactly, whereas a plain shrinking of the free space cuts the corners and lets a cell reach into the spacing. The Boolean and sizing operations come from KLayout regions (kdb.Region). The chip name is placed in the same way as the test structures, and a die frame marks the chip boundary. The chip is written to a GDS file, the file sent to the foundry, and the metadata of all test sites is collected in a test manifest.
import klayout.db as kdb
def place_free(c, cells, spacing=20, closing=100):
"""Place cells, largest first, at the lowest free
spot between the existing structures of c."""
dbu = c.kcl.dbu
s, d = round(spacing / dbu), round(closing / dbu)
taken = kdb.Region()
for layer in c.kcl.layer_indexes():
taken += kdb.Region(c.begin_shapes_rec(layer))
taken = taken.sized(round(1 / dbu)).smoothed(round(0.5 / dbu))
# closing: gaps below 2 * closing count as taken
taken = taken.sized(d).sized(-d)
free = kdb.Region(c.ibbox()) - taken.sized(s)
taken = kdb.Region(c.ibbox().enlarged(c.ibbox().width())) - free
for cell in sorted(cells, key=lambda x: -x.ibbox().area()):
w, h = cell.ibbox().width(), cell.ibbox().height()
box = kdb.Box(-w // 2, -h // 2, w - w // 2, h - h // 2)
spots = free - taken.minkowski_sum(box) # centers
p = min((p for poly in spots.each()
for p in poly.each_point_hull()),
key=lambda p: (p.y, p.x))
ref = c << cell
ref.center = (p.x * dbu, p.y * dbu)
taken += kdb.Region(ref.ibbox()).sized(s)
@gf.cell
def transceiver_chip() -> gf.Component:
content = gf.Component()
tx = content << test_site("tx_lane")
rx = content << test_site("rx_lane", "photocurrent",
x_grating_offset=-200)
rx.xmin, rx.ymin = tx.xmax + 100, tx.ymin # side by side
name = gf.components.text("TRX-1", size=50, layer="WG")
place_free(content, [name, *test_structures])
chip = gf.Component()
die = chip << gf.components.die(die_name=None,
size=(content.xsize + 300, content.ysize + 300))
chip.add_ref(content).center = die.center
assert collisions(chip, skip=("align_wafer",)).is_empty()
return chip
chip = transceiver_chip()
chip.write_gds(workdir / "transceiver.gds")
gf.labels.write_test_manifest(
chip, workdir / "manifest.csv",
parameters=["doe", "measurement"])
chipFigure 25:The transceiver chip. (a) The two lanes side by side, the test structures in the free space between the lanes, all in a die. The layout and the test manifest are written to files. (b) Layout of the complete chip.
The test manifest (Figure 26) lists every cell that carries a doe (design of experiment) entry, with the absolute position of the cell origin on the chip, the settings, the ports and the measurement metadata. A wafer prober moves to each test site and aligns the fiber array to the grating couplers based on the manifest. The analysis pipeline relates each measurement to the design parameters through the settings.
Figure 26:Test manifest. The manifest is a CSV file, read here with pandas. The table lists the device under test, the position of the cell origin in micrometers and the requested measurement for each test site.
Dummy fill¶
Chemical-mechanical polishing and etching require a relatively uniform pattern density across the wafer. Large empty areas are therefore filled with small, electrically and optically inactive dummy tiles. c.fill places a fill cell wherever enough space is available and keeps a defined distance from existing structures (Figure 27). Fill is usually generated per layer and as late as possible, often only on the final chip, and is checked by the density rules of the DRC.
from gf_photonics_paper import show_zoom
c = gf.Component()
c << chip # the chip of the previous section
tile = gf.components.rectangle(size=(4, 4), layer="M3")
c.fill(tile, fill_layers=[("FLOORPLAN", -50)],
exclude_layers=[("M3", 10), ("WG", 8)],
x_space=4, y_space=4)
# inset: the last modulator and part of the multiplexer
show_zoom(c, center=(-420, -90), size=300)Figure 27:Dummy fill. (a) A 4 µm × 4 µm tile is placed on a regular grid inside the die, at least 50 µm from the die boundary, 10 µm from existing metal and 8 µm from waveguides. (b) The transceiver chip with metal fill. The inset in the top left corner magnifies a square of 300 µm around the easternmost modulator and part of the multiplexer.
Conclusion¶
The paper developed a WDM transceiver from a single polygon to a complete chip. Several topics were left out to keep the tutorial short, among them schematic-driven design with a graphical editor, electronic-photonic co-design with electrical PDKs, 3D visualization, and computationally expensive FDTD, EME, TCAD and RF simulations. The documentation of GDSFactory covers these aspects GDSFactory contributors, n.d., and questions are welcome on the GitHub discussion board of the project.
A few principles run through all examples. Components, cross-sections and models are created by Python functions with recorded parameters, which makes designs reproducible, cacheable and easy to explore. Components are positioned and connected through ports rather than coordinates, so designs adapt automatically when parameters change, and the connectivity can be extracted, simulated and checked. The Python or YAML description of the layout is the single source of truth for simulators, verification and test plans. Finally, designs live in version control, are reviewed and tested continuously and benefit from the scientific Python ecosystem, from NumPy and JAX to pandas and Jupyter.
The models and design rules in the paper are deliberately simple, and an industrial design relies on the validated components, models and rule decks of a foundry PDK. The workflow, however, stays the same. The authors hope that the tutorial lowers the barrier for students, researchers and engineers to design photonic chips and invite readers to contribute to GDSFactory and the surrounding ecosystem.
Appendix. Thermal tuning of the ring filters¶
The resonances of ring filters shift with fabrication tolerances and temperature, so rings are equipped with heaters. Figure 28 solves the heat equation for the heater cross-section of the generic PDK, strip_heater_metal, with femwell. As in Figure 14, the cross-section and the layer stack define the geometry, and the silicon substrate below the 3 µm buried oxide acts as a heat sink.
from collections import OrderedDict
import shapely
from femwell.thermal import solve_thermal
from gf_photonics_paper import plot_field
shapes, material = xs_to_polygons("strip_heater_metal",
PDK.layer_stack, xspan=40, zspan=(-3, 3))
sink = shapely.LineString([(-20, -3), (20, -3)])
mesh = from_meshio(mesh_from_OrderedDict(
OrderedDict(sink=sink, **shapes), {},
default_resolution_max=0.4))
basis0 = Basis(mesh, ElementTriP0())
kappa = {"si": 148, "sio2": 1.38, "TiN": 28} # W/(m K)
k = basis0.zeros()
for name, mat in material.items(): # W/(µm K)
k[basis0.get_dofs(elements=name)] = kappa[mat] * 1e-6
p = 1e-5 # heater power per length: 10 mW/mm, in W/µm
q = p / shapes["heater_1"].area # W/µm³
basis, T = solve_thermal(basis0, k,
specific_conductivity={"heater_1": 1.0},
current_densities={"heater_1": np.sqrt(q)},
fixed_boundaries={"sink": 0.0})
plot_field(basis, T, "ΔT (K)", width=16)Figure 28:Thermal simulation of a metal heater. (a) The cross-section strip_heater_metal and the layer stack are converted into polygons, and femwell solves the heat equation in micrometer units for a TiN heater dissipating 10 mW per millimeter of length, with the substrate at constant temperature. (b) Temperature rise above ambient, with heater and waveguide core outlined in white.
The heater sits 0.88 µm above the waveguide core, which warms by 2.3 K. With the thermo-optic coefficient of silicon, dn/dT ≈ 1.8 × 10⁻⁴ K⁻¹, a π phase shift requires Pπ ≈ 19 mW, independent of the heater length, which is a typical value for metal heaters on silicon. For the 68.6 µm circumference of the rings, the tuning efficiency is 0.22 nm/mW, so a shift of one channel spacing (1.6 nm) takes about 7 mW.
Acknowledgments¶
We would like to acknowledge all other contributors to the GDSFactory project who at the time of writing are Simon Bilodeau (Google), Niko Savola (Google, Aalto University), Marc de Cea Falco (Google), Helge Gehring (Google), Yannick Augenstein (FlexCompute), Ryan Camacho (BYU), Sequoia Ploeg (BYU), Prof. Lukas Chrostowski (UBC), Erman Timurdogan (Lumentum), Damien Bonneau (PsiQuantum), Alec Hammond (Meta), Thomas Dorch (HyperLight), Alex Sludds (Lightmatter), Igal Bayn (Quantum Transistors), Skandan Chandrasekar (UWaterloo), Tim Ansell, Ardavan Oskooi (Meta), Bradley Snyder (Superlight) and Amro Tork (Mabrains). Erman Timurdogan contributed the GDSFactory design, verification and validation cycle figure.
We would also like to acknowledge the foundational work of other open-source developers, namely Adam McCaughan (PHIDL), Juan Sanchez (DEVSIM), Matthias Köfferlein (KLayout), Ardavan Oskooi, Alec Hammond, Steven G. Johnson (MEEP), Jesse Lu (FDTDZ), Dan Fritchman (VLSIR), Dario Quintero (PIEL) and Floris Laporte (SAX, MEOW).
Data Availability¶
GDSFactory is available on GitHub under the MIT license and can be installed from the Python package index. All examples of the paper are contained in an executable notebook in the paper repository. The documentation contains further tutorials and the full API reference.
c.show()requires the KLayout extension klive, which is installed from the KLayout package manager.
- Bogaerts, W., & Chrostowski, L. (2018). Silicon Photonics Circuit Design: Methods, Tools and Challenges. Laser & Photonics Reviews, 12(4), 1700237. 10.1002/lpor.201700237
- Chrostowski, L., & Hochberg, M. (2015). Silicon Photonics Design: From Devices to Systems. Cambridge University Press. 10.1017/CBO9781316084168
- Köfferlein, M. (n.d.). KLayout: GDS and OASIS file viewer and editor. https://www.klayout.de
- McCaughan, A. N., Tait, A. N., Buckley, S. M., Oh, D. M., Chiles, J. T., Shainline, J. M., & Nam, S. W. (2021). PHIDL: Python-based layout and geometry creation for nanolithography. Journal of Vacuum Science & Technology B, 39(6), 062601. 10.1116/6.0001203
- Chrostowski, L., Lu, Z., Flueckiger, J., Wang, X., Klein, J., Liu, A., Jhoja, J., & Pond, J. (2016). Design and simulation of silicon photonic schematics and layouts. Silicon Photonics and Photonic Integrated Circuits V, 9891, 989114. 10.1117/12.2230376
- Ploeg, S., Gunther, H., & Camacho, R. M. (2021). Simphony: An Open-Source Photonic Integrated Circuit Simulation Framework. Computing in Science & Engineering, 23(1), 65–74. 10.1109/mcse.2020.3012099
- Nazca Design: photonic integrated circuit design framework. (n.d.). https://nazca-design.org
- Luceda Photonics. (n.d.). IPKISS photonic design framework. https://www.lucedaphotonics.com
- Matres, J., Bilodeau, S., Savola, N., De Cea, M., Yeung, W. K., Timurdogan, E., Fischbach, J. D., Gehring, H., Grosjean, L., Mahlau, Y., Laporte, F., Goeldi, S., & Tamas, T. (2026). GDSFactory: An Open-Source Python Library for Chip Design and Simulation. 2026 IEEE Photonics Society Summer Topicals Meeting Series (SUM), 1–3. 10.1109/sum69529.2026.11660109
- Zhou, H., Yang, H., Ren, H., Matres, J., & Gu, J. (2026). End-to-End Physical Design Automation Flow for Yield-Optimized Inverse-Designed Large-Scale Electronic-Photonic Integrated Circuits. https://arxiv.org/abs/2604.15493
- Sharma, A., Fu, Y., Ansari, V., Iyer, R., Kuang, F., Mistry, K., Aishy, R. I., Ahmad, S., Matres, J., Englund, D. R., & Poon, J. K. S. (2025). AI Agents for Photonic Integrated Circuit Design Automation. https://arxiv.org/abs/2508.14123
- Jiang, X., Li, Z., Zhang, W., & Xu, J. (2026). PICopilot: An LLM-based Agentic Framework for Assisting Photonic Integrated Circuit Design via Script Generation. https://arxiv.org/abs/2608.01791
- Wu, Y., Yu, X., Chen, H., Luo, Y., Tong, Y., & Ma, Y. (2025). PICBench: Benchmarking LLMs for Photonic Integrated Circuits Design. https://arxiv.org/abs/2502.03159
- Kharel, P., Khavasi, A., Chen, X., & Hughes, T. W. (2026). Autonomous agentic design for photonics. https://arxiv.org/abs/2606.00915
- Little, B. E., Chu, S. T., Haus, H. A., Foresi, J., & Laine, J.-P. (1997). Microring resonator channel dropping filters. Journal of Lightwave Technology, 15(6), 998–1005. 10.1109/50.588673