nonlocally

Notebook Gallery

22 interactive marimo notebooks. Ones marked runs in your browser execute right here with no account; rendered preview shows every output as it ran on the platform; sign in to edit and run any of them next to a chat assistant.

Feedback

Integrated photonics

Start here — design a photonic circuit in one notebook

A working Mach–Zehnder interferometer built with the full stack in one notebook: gdsfactory draws the layout, sax simulates the S-parameters, and the GDS is ready for fabrication. Move the sliders and the layout and the spectrum update together.

Rendered previewphotonicsmzigdsfactorysax

Ring resonator — the workhorse of integrated photonics

A waveguide loop side-coupled to a bus: on resonance light builds up in the ring and the bus transmission shows sharp notches. Sweep radius, coupling and loss to find critical coupling, with the layout in gdsfactory and the spectrum in sax.

Rendered previewringresonatorgdsfactorysaxphotonics

Directional coupler — the 2×2 building block

Two waveguides brought close together exchange power along the coupling region. The 2×2 element that splits and combines light inside every MZI and ring, laid out in gdsfactory and modelled as the same sax element the other notebooks use.

Rendered previewcouplersplittergdsfactorysaxphotonics

The standard quantum limit of an optical neural network — verifying Hamerly et al. (PRX 2019)

A verification run of Hamerly et al., Phys. Rev. X 9, 021032 (2019): the shot-noise law of homodyne photoelectric multiplication checked by simulating the photon counting, every energy figure behind Fig. 3(c) and Tables S1-S2 recomputed, and (opt-in, about 3 min) the MNIST standard quantum limit of Fig. 2(c) re-measured on networks trained in the notebook. Sliders move detector capacitance, temperature, electronics energy and per-layer photon budgets off the paper's operating point.

Sign in to runoptical-neural-networkphotonicssimulationvalidation

Silicon strip waveguides and the directional coupler — a verified mode-solver workflow

Effective index of the 500 × 220 nm silicon strip and the coupling length of a directional coupler, computed with femwell (FEM), MPB and MEEP FDTD and checked against the exact slab dispersion relation, a cross-solver extrapolation and an exact supermode beat length. Ends with a gdsfactory 3 dB coupler layout and a machine-readable validation table.

Sign in to runwaveguidecouplerfemwellmpbmeepgdsfactoryvalidationphotonics

Microring add-drop filters — from waveguide dispersion to a verified FDTD spectrum

Silicon microring resonators end to end: strip dispersion and group index (femwell, MPB), all-pass and add-drop transfer functions, FSR/Q/finesse and critical coupling, ring-bus coupling from supermodes and coupled-mode theory, a sax circuit model, and MEEP 2-D FDTD of an exactly solvable ring (Bessel-function reference) with Harminv and Lorentzian Q extraction, resolution convergence and a gdsfactory layout. Every number is checked in a machine-readable validation table.

Sign in to runmicroringresonatoradd-dropfemwellmpbmeepsaxgdsfactory

Silicon Photonic Ring Modulator — Digital Twin

A digital twin of a silicon PN-junction microring modulator. One set of design parameters drives the Soref–Bennett plasma-dispersion physics, the gdsfactory layout, the SAX S-parameters, a JAX gradient optimisation of the coupling, and the live spec table.

Rendered previewringmodulatorelectro-opticsphotonics

Photonic Integrated Circuit Derivations

Transfer functions of the ring resonator (all-pass and add-drop) and the Mach–Zehnder interferometer, derived from first principles with SymPy and plotted. Sliders for coupling, loss, effective index and arm-length difference let you explore each spectrum in the browser.

Runs in your browserderivationsringmzisympyphotonics

Layout with gdsfactory

Introduction to gdsfactory

A first look at gdsfactory, the Python library for photonic layout: draw a straight waveguide, an Euler bend and a taper with slider-controlled dimensions, see how components nest, and browse the generic PDK's standard cells.

Rendered previewgdsfactorylayoutwaveguidephotonics

Components and routing in gdsfactory

Ports are how gdsfactory joins components: read a waveguide's ports, then route two MMIs with a Manhattan waveguide whose bend radius and spacing you set with sliders, and finish with a grating coupler that brings light on and off the chip.

Rendered previewgdsfactoryroutingportslayout

PDK and technology in gdsfactory

What a Process Design Kit defines and how to read it from gdsfactory: the generic PDK's cells and cross-sections, its GDS layer map, strip versus rib waveguides, and how minimum spacing shapes an array of waveguides.

Rendered previewgdsfactorypdklayerscross-section

Simulation Integration with gdsfactory

Choose a gdsfactory component and inspect its ports, then set up a wavelength sweep and read the S-parameter spectrum and mode profile a solver would return. The spectra here are synthetic; the closing table points to the real FDTD, EME and FEM plugins.

Rendered previewgdsfactorysimulations-parametersfdtd

End-to-End Full Chip Design with gdsfactory

Floorplan a die, place grating couplers and a row of ring resonators, route two MMIs, report the layout statistics and write the chip to GDS. Sliders set the die size and the ring count, radius and coupling gap.

Rendered previewgdsfactorylayoutroutingchip-design

Ray optics

Single thin lens (f = 50 mm)

A collimated beam passes through a thin lens and every ray converges at the focal plane. Move the focal-length, ray-count and beam-size sliders and watch the Optiverse ray trace update; replicates DCC-Lab RayTracing example 1.

Rendered previewlensthin-lensray-opticsoptiverse

4f telescope (two lenses)

Two thin lenses separated by the sum of their focal lengths form a 4f relay: the image is inverted with magnification −f₂/f₁. Change either focal length and watch the Optiverse ray trace and the magnification update together.

Rendered previewlenstelescope4f-relayray-opticsoptiverse

Optiverse ray optics demo

Interactive 2D ray tracing with the Optiverse engine: a collimated beam passes through a thin lens and reflects off a flat mirror. Change the focal length, ray count and beam size and watch the rays converge, diverge and bounce back.

Rendered previewray-opticsray-tracinglensmirroroptiverse

Quantum optics

NV center in a diamond cavity — cavity QED tutorial

The NV center's zero-phonon line carries only about 3% of its emission; this tutorial shows how a diamond cavity changes that, with interactive parameters.

Runs in your browserquantum-opticscavity-qed

Photon blockade and cascaded cavities — reproducing quantum-dot cavity QED with QuTiP

Rebuilds Englund et al. (Nature 2007) dipole-induced-transparency reflectivity spectra and saturation, Faraon et al. (Nat. Phys. 2008) photon blockade and tunnelling g2(0) and their high-Q projections, and Choi et al. (PRL 2019) cascaded-cavity indistinguishability with an exact closed-form solver. Jaynes–Cummings, Purcell and weak-drive limits are checked exactly, and every paper figure number is tested against a stated tolerance.

Sign in to runcavity-qedquantum-dotphoton-blockadesingle-photon-sourcequtipvalidationquantum

Faster and slower quantum dots in a photonic crystal — verifying Englund et al. (PRL 2005)

A verification run of Englund et al., Phys. Rev. Lett. 95, 013904 (2005): the Purcell and band-gap formula (Eqs. 1-2) checked against every lifetime the paper quotes and against Fig. 6(a), digitized from the published PDF. Sliders for Q, mode volume, dot placement and photonic-crystal background show where the 8x speed-up and 5x slow-down come from, and where the weak-coupling picture breaks.

Runs in your browserquantum-dotphotonic-crystalcavity-qedquantum-opticsvalidation

Verification run: Zak phase without global symmetry (arXiv:2610.13250)

A verification run of Hwang & Rhim's claim that the Zak phase stays exactly quantized when the protecting symmetry is broken, provided the symmetry-breaking orbital couples only through destructive interference. Every number is recomputed in your browser; what-if controls move off the paper's operating point and a leak sweep shows where the claim breaks.

Runs in your browserverification-runtopological-bandsquantum-opticsformal-verification

Photonic–electronic circuits

Introduction to piel — Photonic-Electronic Integration Library

A tour of piel, the photonic-electronic co-design library: what it bridges (gdsfactory, JAX S-parameter models, hdl21, qutip), an interactive MZI modulator estimate, and how to run real piel code server-side from the OpenWebUI piel tools.

Runs in your browserpielelectro-opticsco-designmzi

Correcting a fabricated MZI mesh — hardware error correction for programmable photonics

Reproduces Bandyopadhyay, Hamerly & Englund (Optica 2021) and Hamerly, Bandyopadhyay & Englund (Nat. Commun. 2022): Clements and Reck mesh programming verified to 1e-12, exact local correction of imperfect beamsplitters, the order-of-magnitude matrix-error reduction, self-configuration with the 3-splitter MZI whose error falls with mesh size, and the fabrication tolerance of an MNIST optical neural network, each compared with the papers' figures and formulas.

Sign in to runprogrammable-photonicsmzi-mesherror-correctionoptical-neural-networkjaxvalidationcircuits