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.3

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.3
File Size Uploaded Provenance Actions
laylight-0.3.3.tar.gz 58.3 kB Without provenance Details for laylight-0.3.3.tar.gz

Built distribution (wheel)

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

Total release size: 132.7 kB

Release files / laylight-0.3.3.tar.gz

Download URL laylight-0.3.3.tar.gz
Size 58.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2dcc18a58e70293a3d0e4a47d5d23163206635bc10a5d8109108d65a8c0a5cbd
BLAKE2b-256 checksum
How to use checksums
cde286f71b4d2f819fe38f6cc6eeb658f063027365f6f98f2936bfde131e00e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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

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

Security for laylight 0.3.3

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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