Examples

Ring Coupler

Build and export a coupled ring resonator with an integrated heater.

This example creates a RingCoupled device with a 20 µm radius, a 0.2 µm coupling gap, and a heater. The device is placed into a top-level cell with the same Placer API used by the straight-waveguide example.

Code

Run this snippet from the repository root after installing the workspace packages:

from pathlib import Path

import laylight
from laylight.render import export_layout_png, new_layout
from laylight.structure.ring import RingCoupled


layout, top, tech = new_layout("RING_COUPLER_EXAMPLE")
device = RingCoupled(
    radius=20,
    width=0.5,
    gap=0.2,
    with_heater=True,
    layout=layout,
    tech=tech,
)

laylight.Placer(device).into(top)

output_dir = Path("build/examples")
output_dir.mkdir(parents=True, exist_ok=True)
layout.write(str(output_dir / "ring_coupler.gds"))
export_layout_png(
    layout,
    output_dir / "ring_coupler.png",
    cell=top,
    max_pixels=960,
)

The code writes both ring_coupler.gds and ring_coupler.png to build/examples.

Rendered layout

Rendered ring coupler with heater pads

The lower curved path is the ring. The upper straight path is the bus waveguide, and the square structures are the heater contacts.

On this page