Skip to content

Repository files navigation

Interferometry Lab

CI

An interactive physical-optics simulation of the three interferometers every optics course covers — Michelson, Mach-Zehnder and Fabry-Pérot — built with SceneryStack, Vite 8, TypeScript 7, and Biome 2.

Geometric-optics simulators are common. This one is a physical optics simulator: it tracks optical path length, phase and partial coherence, and renders the interference pattern those produce rather than drawing a picture of one.

Launch the simulation →

Features

  • Michelson — coarse and micrometer mirror travel, mirror tilt to drive circular fringes into straight ones, an evacuable gas cell for the classic index-of-refraction measurement, a compensator plate, a fringe counter, an intensity trace across the detector, and a visibility curve that shows the coherence envelope — flat for a laser, a needle for white light, and the sodium doublet's nulls and revivals
  • Mach-Zehnder — both complementary output ports shown at once, an insertable sample slide with adjustable thickness, index and tilt, and a single-photon mode that builds the pattern one detection at a time (pausable and steppable), with a which-path marker that erases it — and a trace of both ports whose dashed total stays flat, so interference visibly moves light rather than destroying it
  • Fabry-Pérot — mirror reflectance from 0.04 to 0.99, absorption, cavity spacing and a scanning mode you can pause and step onto a transmission peak, with live finesse, free spectral range and resolving power, plus a transmission spectrum showing whether two lines are resolved
  • Six light sources from a helium-neon laser to white light, spanning 200 mm to 1 µm of coherence length — including the sodium doublet and its visibility beats
  • Physically computed colour: white-light fringes come out with the correct achromatic centre and coloured orders, summed in linear light through CIE XYZ
  • An optional Preferences overlay labelling each optical element with what it contributes to the optical path difference — including the factor of two a Michelson arm carries and a Mach-Zehnder's does not
  • Full keyboard access and live screen-reader descriptions of the pattern and of both charts
  • English, Spanish, and French localization via StringManager
  • Default and projector color profiles
  • Progressive Web App (installable, offline-capable)
  • Shared GitHub Actions CI via OpenPhysics/Baton

Documentation

DocumentContents
doc/model.mdThe physics: coherence, path difference, the three instruments
doc/implementation-notes.mdArchitecture, the renderer, the colour pipeline

Quick Start

npm install
npm run icons # generate PNG icons from public/icons/icon.svg
npm start # dev server → http://localhost:5173

Scripts

CommandDescription
npm start / npm run devStart Vite dev server
npm run buildType-check + production build → dist/
npm run previewPreview the production build locally
npm testRun Vitest unit tests (includes memory-leak suite)
npm run test:fuzzOptional Playwright fuzz smoke (?fuzz, default 15s)
npm run test:fuzz:quickShorter fuzz smoke (10s)
npm run checkTypeScript type check
npm run lintBiome lint check
npm run formatAuto-format all files
npm run fixLint + auto-fix
npm run iconsRegenerate PNG icons from public/icons/icon.svg
npm run cleanRemove dist/

New sims start at version: "0.0.0" in package.json. Bump only when cutting a release (for example npm version patch and a matching git tag). Keep name in kebab-case; it is separate from the SceneryStack sim identifier in src/init.ts.

Tech Stack

ToolVersionPurpose
SceneryStack^3.0.0Simulation framework
Vite^8Build tool + dev server
TypeScript^7Type-safe JavaScript
Biome^2.5Linting + formatting
vite-plugin-pwa^1PWA + service worker

License

GNU Affero General Public License v3.0 — see OpenPhysics org license.

Contributing

See OpenPhysics contributing guidelines. Report bugs via GitHub Issues; use org issue templates.

About

Physical-optics simulation of Michelson, Mach-Zehnder, and Fabry-Perot interferometers: optical path length, phase, coherence, and fringe formation.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages