r/Optics • • 6d ago

Lightstone, an open-source optical link & multimode fiber simulator

I worked in photonics more than ten years ago and missed the physics. Lightstone started as a side project to refresh my knowledge and build a lightweight, open optical link simulator I could actually inspect and tweak.

At the moment, it models short-reach optical links (850–940 nm VCSELs, OM3/OM4/OM5 multimode fiber, connectors, WDM mux/demux, PIN/TIA, Bessel-Thomson filters, and a 5-tap FFE), the kind of 100G/200G-per-lane PAM-4 links used for short-reach interconnects inside modern data centers and GPU clusters.

Some details on the physics and design:

  • Mode-by-mode fiber model: Solves scalar LP modes of the graded-index profile, with overlap integrals for an incoherent Laguerre-Gauss VCSEL launch and connector offsets. Receiver noise (thermal, shot, RIN, jitter) is tracked analytically through the filters and equalizer, so symbol error rates are estimated semi-analytically down to low values without long Monte Carlo runs.
  • Validation: Every component has a model doc with equations and known limits (docs/model/). It includes a standalone NumPy/SciPy reference implementation (reference/) and comparisons against public IEEE 802.3ae/db link models (within ~0.15–0.2 dB; details in docs/validation.md).
  • Custom components: Can be added in Python or Rust. In Python, a decorator lets you register a transfer function $H(f)$, impulse response, FIR taps, or a nonlinear waveform function, and the engine handles signal and noise propagation (notebooks/, docs/model/example-component.md).
  • Tech stack: Rust core compiled to WASM (in a Web Worker behind a Svelte 5 / Svelte Flow graph editor) and exposed to Python via PyO3/maturin (pip install lightstone). Graphs saved in the browser run unchanged in Python.

Known limitation: The built-in fiber presets are calibrated at 850 nm and are currently optimistic at longer SWDM wavelengths (noted in validation check V18).

Future roadmap: Importing measured DMD fiber data, single-mode fiber, DFB/EML chirp, optical amplifiers, coherent links, and fiber nonlinearity.

Dual-licensed MIT/Apache-2.0. I'd love feedback from the optics community on the physical models or UI — and if anyone has measured multimode eye diagrams, SER, or TDECQ data we could benchmark against, an issue on GitHub would be hugely appreciated!

47 Upvotes

4 comments sorted by

3

u/Zifnab_palmesano 5d ago

lol tht is cool. I work with 850nm MM vcsels, and we can do eyes up very high in Baudrate, including TDECQ and so on. we can talk, what would you need for benchmarking? Tx performance + S21 ad then tdecq without taps, e.g.?

ps: will read in detail later

2

u/TadpoleOk2598 5d ago

Awesome, thanks! That's exactly what I was hoping for.

Tx response + S21 + TDECQ sounds like a great starting point. No rush at all, and obviously only share whatever isn't sensitive (anonymized/normalized is completely fine, and nothing gets published without your OK).

If you happen to have any of these, even a subset would already help a ton:

  1. A captured waveform + scope TDECQ:Just the averaged pattern (CSV/binary + sample rate, SSPRQ or PRBS13Q) and what your scope reports for TDECQ. That lets me run Lightstone's TDECQ directly on your trace first to make sure the math matches your scope before touching any device physics.
  2. VCSEL S21:Magnitude (and phase if available) around your bias point — Lightstone can load a measured S21 directly as a transfer function, so no fitting required.
  3. Basic operating point & setup: baud rate, average power, OMA/ER, wavelength, spectral width / RIN (if known), and rough O/E + scope bandwidth. (If it's over fiber, fiber type/length and launch condition too.)

Adding a no-taps option for TDECQ is super easy on my end. One thing to note: I've validated things at 53 GBd (100G/lane) so far — higher baud rates run, so any high-speed data you have would be extra interesting to compare!

Whenever you get around to reading through, feel free to ping me here or via DM/email. :-)

2

u/Zifnab_palmesano 5d ago

i will DM you in private, but i can supply the 100G data

1

u/TadpoleOk2598 5d ago

Fantastic! 😄