Skip to main content

laylight

laylight is a Python toolkit for photonic layout design. Devices are Python classes; the library builds the Laylight IR from them, and the Laylight compiler, the laylight command line, turns the IR into GDSII.

laylight is a sub-product of PhotonStack, focused on making photonic design more programmable, composable, and easier to explore.

Why laylight

Photonic layout work often mixes device geometry, parameter sweeps, custom scripts, and visualization. laylight provides a Python-first way to:

  • define photonic structures with reusable, parameterized devices
  • chain devices port to port with Placer
  • write layouts that carry their cells' parameters, ports and connections, through the same compiler as the Laylight DSL

Documentation and tools

Installation

pip install laylight

This installs the laylight command line too (the laylight-cli package), which sends anonymous usage statistics unless LAYLIGHT_TELEMETRY=0 is set. PNG previews and KLayout PCells need KLayout:

pip install "laylight[klayout]"

Simple example

import laylight
from laylight.render import new_layout
from laylight.structure.wg import WGStraight

layout, top, tech = new_layout("DEMO")

device = WGStraight(
    length=200,
    width=0.5,
    layout=layout,
    tech=tech,
)

laylight.Placer(device).into(top)
layout.write("demo.gds")

This creates a straight waveguide and writes the result to demo.gds. layout.to_ir() returns the Laylight IR, and layout.write("demo.lyir") writes it to a file that Laylight DSL code can import.

Learn more

For guided examples and API usage, start with the documentation site.

Metadata

Release files for laylight 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for laylight 0.3.1
File Size Uploaded
laylight-0.3.1.tar.gz 58.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for laylight 0.3.1
File Interpreter ABI Platform
laylight-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 132.7 kB

Release files / laylight-0.3.1.tar.gz

Download URL laylight-0.3.1.tar.gz
Size 58.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e72ca2de14949be8a0c17b67e20f83b48e9b80f3df4052026064e30e0d77c5e8
BLAKE2b-256 checksum
How to use checksums
46406decba2246506d41304bbbbdd63e3d3b803658303a9d2dec4faa1c0a8134
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / laylight-0.3.1-py3-none-any.whl

Download URL laylight-0.3.1-py3-none-any.whl
Size 74.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2c105e0c72cd6c3b220c864fdf6d039efa9354c002c1af13fb962a5e1d229d8
BLAKE2b-256 checksum
How to use checksums
fdda188165cbbfdbb1cb4682d797ce732f497be5e61f4b16a1864245954ae097
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.0.2

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page