Skip to main content

Layout scripting for photonic and electronic chip design

Project description

Lumicron API

Layout scripting for photonic and electronic chip design.

Define cells, place components, route waveguides, and export to GDS/OASIS — all in Python.

Install

pip install lumicron_api

Requires Python 3.12+.

Quick Start

import lumicron_api.all as lm
import lumicron_api.pdks.elyon_demo.all as pdk

@lm.cell_params
def MZI(arm_length: float = 100, arm_spacing: float = 10):
    c = lm.CELL("MZI")

    # Components
    splitter = pdk.YSplitter(layer=pdk.LAYER.SILC)
    combiner = pdk.YSplitter(layer=pdk.LAYER.SILC)

    # Add and place
    s = c.add(splitter)
    k = c.add(combiner)
    c.Place(s).at((0, 0))
    c.Place(k).using("i1").at((arm_length + 50, 0)).rotate_by(180)

    # Route
    c.Route(s.port["o1"], k.port["o1"], radius=10)
    c.Route(s.port["o2"], k.port["o2"], radius=10)

    return c

mzi = MZI()
mzi.to_layout().to_gds("mzi.gds")

Features

  • Hierarchical cells — build complex designs from reusable parametric components
  • Placement system — anchor-based positioning with directional helpers (.above(), .below(), .right_of())
  • Routing — auto-router with manual override via .go(), bend radius validation, tapers with positional placement
  • Bend types — circular (default), euler (clothoid), and custom bend PCells with adjustable p parameter
  • Custom bend PCells — use your own 90° bend cells in routes: c.Route(a, b, bend=my_bend)
  • Waveguide — standalone path primitive for spirals, delay lines, and tapered structures
  • Arrays — 1D and 2D arrays with per-element rotation
  • Port promotion — access deeply nested ports from any level in the hierarchy
  • Port types — optical and electrical ports for future auto layer transitions
  • Shapes — Rectangle, Circle, Ring, Oval, Arc, Triangle, Parallelogram, Trapezoid
  • PDK support — ships with Elyon Demo PDK (17 layers, 11 components, 3 route profiles)
  • Export — GDS-II, OASIS, and JSON formats

Placement

# Absolute
c.Place(shape).at((100, 200))

# Relative
c.Place(pad).right_of(coupler)
c.Place(stalk).below(segment).move_by(dy=5)

# Anchor + rotate
c.Place(splitter).using("i1").at(frame.NW).rotate_by(90)

Routing

# Auto-route with circular bends
c.Route(port_a, port_b, radius=10)

# Euler bends (smooth curvature transition)
c.Route(port_a, port_b, radius=10, bend="euler")
c.Route(port_a, port_b, radius=10, bend="euler", p=0.3)  # adjust euler fraction

# Custom bend PCell (user-defined 90° bend geometry)
c.Route(port_a, port_b, bend=my_euler_bend_cell)

# Manual with GPS-style directions
c.Route(port_a, port_b, radius=15) \
    .go("E", by=50) \
    .go("N", to=port_b, dy=-20)

# Positional taper — place taper 50µm from port A
c.Route(port_a, port_b, radius=10).start_taper(length=10, at=50)

# With route profile
c.Route(port_a, port_b, profile=pdk.RPROF.siln_strip)

Waveguide

# Standalone path from points — auto-generates i1/o1 ports
wg = lm.Waveguide(
    points=[(0, 0), (50, 0), (50, 100), (100, 100)],
    layer=pdk.LAYER.SILC, width=0.5, radius=10,
)

# Tapered waveguide (width interpolates linearly)
wg = lm.Waveguide(
    points=spiral_points,
    layer=pdk.LAYER.SILC, width=0.2, width_end=1.0, radius=10,
)

ref = c.add(wg)
c.Route(some_port, ref.port["o1"], radius=10)

Arrays

couplers = lm.ARRAY(coupler, count=8, pitch=(0, 127), rotation=90)
arr = c.add(couplers)
c.Place(arr).at((0, 0))

# Access individual element ports
arr[0].port["o1"]
arr[3].C

Parametric Cells

@lm.cell_params
def Ring(radius: float = 50, width: float = 5):
    c = lm.CELL("Ring")
    c.add(lm.Ring(outer_radius=radius, width=width, layer=pdk.LAYER.SILC))
    return c

Ring()              # cell name: "Ring"
Ring(radius=100)    # cell name: "Ring_radius=100"

Documentation

See docs/user_guide.md for the full API reference.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lumicron_api-0.2.0.tar.gz (97.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lumicron_api-0.2.0-py3-none-any.whl (81.8 kB view details)

Uploaded Python 3

File details

Details for the file lumicron_api-0.2.0.tar.gz.

File metadata

  • Download URL: lumicron_api-0.2.0.tar.gz
  • Upload date:
  • Size: 97.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for lumicron_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 340dd851c54f5fe7dcf51f83a1834b6b3543331b580bc7a28191d769343eb031
MD5 746888b92452c884e6af1da95db649d0
BLAKE2b-256 78b8bd35a3b43d1bda765abb78b286fb30bd6f2b1e481f96d75c26f7e225fb71

See more details on using hashes here.

File details

Details for the file lumicron_api-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lumicron_api-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 81.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for lumicron_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d23d1b32c52f5106327b5d1d8a4e529046b8e001fae740f4fb8c644f96dd0495
MD5 4e8357d1b0965925d527d752c6e6b851
BLAKE2b-256 4de0fe51edb5ce125ebb46159d311ffd34cd640247af8f4c5f6e124e5dc795cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page