A library, not just an app
The simulator is a Rust crate you can use on its own. Circuits compile per wavelength into a flat program: straight-through parts become SIMD multiply-adds over whole batches of inputs, and feedback loops get an LU factorisation computed once.
Exact
Steady state solved as a linear system; loops and resonances need no iteration limit.
Fast
Batched SIMD kernels with runtime CPU dispatch; wavelength sweeps run in parallel.
Composable
Rings, meshes, switch trees and WDM demultiplexers are blocks you can nest.
Compact files
Projects save in a binary .shine format, about five times smaller than JSON.
A Mach–Zehnder in a few lines
use shine::photonics::*;
let mut c = Circuit::new();let laser = c.add(Laser::new(1.0, 1550.0));let split = c.add(DirectionalCoupler::balanced());let heat = c.add(PhaseShifter::new(std::f64::consts::PI));let join = c.add(DirectionalCoupler::balanced());let pd = c.add(Detector::new());c.connect(laser.output(0), split.input(0))?;c.connect(split.output(0), heat.input(0))?;c.connect(heat.output(0), join.input(0))?;c.connect(split.output(1), join.input(1))?;c.connect(join.output(0), pd.input(0))?;
let power = c.simulate(1550.0, &[])?.detected_power(pd); // 1.0