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, API usage, and browser-based experiments, start with the documentation site and the online playground.

Metadata

Release files for laylight 0.3.0

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.0
File Size Uploaded Provenance
laylight-0.3.0.tar.gz 58.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 132.8 kB

Release files / laylight-0.3.0.tar.gz

Download URL laylight-0.3.0.tar.gz
Size 58.3 kB
Tags Source
SHA-256 checksum
How to use checksums
629ef6989cc95aad5cd3fbf26506ce2299a6fdfa15f90973a1979765fa213571
BLAKE2b-256 checksum
How to use checksums
d0153d50c549831295919f7ed28c0e5d5a78b1aa896c5f316ecc1d94b21e3fe1
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.0-py3-none-any.whl

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

Security for laylight 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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