Skip to main content

lightsim

docs license: MIT version 0.1.1 rust wheels

Rust-native simulation engine for photonic chips, with a Python API.

lightsim's core is a GPU-first FDTD solver. Around it are waveguide mode solvers, eigenmode expansion, finite-element heat, electrostatics and modes, circuit simulation and inverse design, all without external programs. On one RTX PRO 6000 it runs at 22–27 Gcells/s, 2.2–2.4× faster than FDTDX from 17 M cells up (benchmarks).

Features

  • CUDA: kernels written in Rust and compiled to PTX with NVIDIA's cuda-oxide; one build runs on Ampere through Blackwell (tested on RTX PRO 6000 and GB10), on one GPU, several GPUs (peer-to-peer halos) or several machines (TCP halos).
  • Vulkan and Metal: a portable GPU backend for AMD, Intel and NVIDIA GPUs through Vulkan and Apple GPUs through Metal (Rust kernels compiled to SPIR-V with rust-gpu, run through wgpu).
  • FDTD in 3-D and 2-D on non-uniform meshes, with dispersive, nonlinear (χ², χ³), anisotropic and magneto-optic media, gain media and conducting sheets; CPML, Bloch and mirror-symmetry boundaries.
  • Inverse design: adjoint gradients and exact gradients through reverse mode, density and shape optimisation.
  • RF and electro-optics: antennas, transmission lines and RF circuits; the Pockels chain from the RF field to the optical response.
  • gdsfactory: layout import, port-driven S-parameters, and lightsim.gplugins with the interface of gdsfactory's Meep plugin.
  • Process design kits: load a fab's kit (gdsfactory, KLayout technology, lightsim's technology file, a licensed kit on disk) and simulate its cells.
  • Fabrication Monte Carlo: width, thickness, etch, sidewall and overlay spreads and tiny defects (line-edge roughness, particles, missing elements) per sample, run in batches on CPUs and GPUs, with yield.
  • Quantum light (lightsim.quantum): photons and Gaussian states through circuits built from simulated or measured S-matrices, with loss, partly distinguishable photons, sources, detectors and heralded gates; permanents and hafnians on CPUs and GPUs; gradients for inverse design.

Install

pip install lightsim

Wheels for Linux (x86-64 and arm64: the CPU, NVIDIA GPUs through CUDA with only the driver installed, and any GPU with a Vulkan driver) and macOS (Apple silicon and Intel: the CPU and the Mac's GPU through Metal), for Python 3.10 and newer. The package holds the Python API and the lightsim command:

python -c "import lightsim; print(lightsim.__version__, lightsim.devices())"
lightsim info

From source (Rust 1.99.1; for NVIDIA GPUs, CUDA 13):

git clone https://github.com/su3co/lightsim && cd lightsim
pip install maturin
maturin develop --release                     # CPU only
maturin develop --release --features cuda     # with GPU support (NVIDIA, CUDA)
maturin develop --release --features vulkan   # portable GPU backend (metal on macOS)
cargo build --release -p lightsim-cli         # the `lightsim` program alone (same --features)

Details: installation guide.

Example

S-parameters of a gdsfactory component (pip install "gdsfactory>=8"), on a laptop CPU in seconds:

import gdsfactory as gf
import numpy as np
from lightsim.sparams import write_sparameters

gf.gpdk.PDK.activate()                               # gdsfactory's generic PDK
c = gf.components.straight(length=2)                 # 2 um of 500 x 220 nm silicon strip
sp = write_sparameters(c, wavelengths=np.linspace(1.5e-6, 1.6e-6, 5),
                       steps_per_wavelength=12, device="cpu")

print(sorted(k for k in sp if "@" in k))
print(np.round(np.abs(sp["o2@0,o1@0"]) ** 2, 3))     # power transmission o1 -> o2
print(round(sp["mode_neff"]["o1"].real, 3))          # effective index of the port mode
['o1@0,o1@0', 'o1@0,o2@0', 'o2@0,o1@0', 'o2@0,o2@0']
[0.999 1.    1.    1.    0.999]
2.422

With device="cuda:0" the same call runs on a GPU. The quick start continues with a simulation built by hand.

MIT licence.

Metadata

Release files for lightsim 0.1.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 lightsim 0.1.1
File Size Uploaded Provenance Actions
lightsim-0.1.1.tar.gz 1.9 MB With provenance Details for lightsim-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for lightsim 0.1.1
File Actions
lightsim-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for lightsim-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl
lightsim-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for lightsim-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl
lightsim-0.1.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for lightsim-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
lightsim-0.1.1-cp310-abi3-macosx_10_13_x86_64.whl CPython 3.10 abi3 macOS 10.13+ x86-64 Details for lightsim-0.1.1-cp310-abi3-macosx_10_13_x86_64.whl

Total release size: 41.1 MB

Release files / lightsim-0.1.1.tar.gz

Download URL lightsim-0.1.1.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
b0c8150c8e5297a6ebb900805a1f5f59cc0d38bbccd0703491582d9cff55f94c
BLAKE2b-256 checksum
How to use checksums
9e2621393d7b2837d026ea5c719af9ff90c2e174dfbbb1713afe6cc967d5c3b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / lightsim-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL lightsim-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl
Size 11.0 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
348791ad7f76c85d824830c70637cd7b8b6aaeb9b28a077eb583deb37dd54a55
BLAKE2b-256 checksum
How to use checksums
48f83a124533fdc9e3dcaed85eeb87d9343a9a55355ed52ed2945d64c6ea41bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / lightsim-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL lightsim-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl
Size 9.9 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
1e6cb66fc8c7448c2ffcc108748e2e325266560516d28dde1e9a1005f353fbad
BLAKE2b-256 checksum
How to use checksums
8a0c41b0616749c6eab178de6b6010c488ad280d9e8713d4e1aa0d78aa0d1a5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / lightsim-0.1.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL lightsim-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Size 8.7 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
421ec5c8c75fcf8c06472a2580069b905ac4f6555f3347b9961b815d4d21be84
BLAKE2b-256 checksum
How to use checksums
fa3a4baffa8099f84edbf387bb4c3b43b67a1d94935db9215a2d944b2bb47cfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / lightsim-0.1.1-cp310-abi3-macosx_10_13_x86_64.whl

Download URL lightsim-0.1.1-cp310-abi3-macosx_10_13_x86_64.whl
Size 9.6 MB
Tags CPython 3.10 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
3949cb7f59c2608cf886be1add0b1ff43a41750fa114324bcd456a26c616966b
BLAKE2b-256 checksum
How to use checksums
17eae6c26333c686dd37524b16de00b6de378dd115913012c377d30df8b0eb2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for lightsim 0.1.1

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for lightsim-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

5 release files Full provenance

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