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

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

Built distribution (wheel)

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

Total release size: 132.7 kB

Release files / laylight-0.3.2.tar.gz

Download URL laylight-0.3.2.tar.gz
Size 58.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ceb2670a2ecbaf2727969001b8c7798a4d92dd3cf7d7b739d7e5be3d6505b86f
BLAKE2b-256 checksum
How to use checksums
c4ad73452adb1a013eed47f19ed2551078407fcb384265d43fa8d179bfc69047
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.2-py3-none-any.whl

Download URL laylight-0.3.2-py3-none-any.whl
Size 74.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21cce2bba4c2ca8ebe8f37f0900e8a9b0cd0d5686b4908fbdd36eb25b2552bbd
BLAKE2b-256 checksum
How to use checksums
311f1cfb1281d13fc59ea38c2a4fe468605252b4243466fd6ca0d7ba7ecf7d05
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.2

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