QuantaSim

Kernel Specification v4.2

SDK & Photonic IR Reference

Embed QuantaSim's linear-optics engine in TypeScript notebooks, CI verification pipelines, or custom browser laboratories.

Quickstart · TypeScript Kernel Zero remote dependencies
import { PhotonicCircuit, KrausNoise } from "@quantasim/kernel";

const mesh = new PhotonicCircuit({ modes: 8, precision: "f64" })
  .hadamard(0)
  .beamSplitter(0, 1, { reflectivity: 0.5, phase: Math.PI / 4 })
  .crossKerr(1, 2, { chi3: 0.62 })
  .withNoise(KrausNoise.waveguideLoss({ dbPerCm: 0.18, lengthCm: 1.4 }));

const result = await mesh.simulate({ shots: 10_000, backend: "webgpu" });
console.log(result.fidelity, result.coincidenceHistogram);

Technical Questions

How does QuantaSim run exact Fock-space simulation inside a browser? +

QuantaSim compiles our Rust linear-optics engine to SIMD WebAssembly and dispatches batched beam-splitter rotations through WebGL2/WebGPU compute buffers. For 8 to 16 modes with bounded photon numbers, local memory bandwidth beats remote API roundtrips by two orders of magnitude.

Can we import foundry PDK measurements directly into the noise channel? +

Yes. Foundry Pro accepts CSV and JSON waveguide propagation loss tables, directional coupler splitting-ratio variance, and thermo-optic phase-shifter crosstalk matrices so your simulation matches wafer-level characterization.

Does any circuit topology leave our network during simulation? +

Never. Every unitary decomposition, Kraus noise evolution, and coincidence histogram runs locally in client memory. Even in team workspaces, you can enforce zero-cloud mode for export-controlled photonic designs.

Which intermediate representations are supported for export? +

Circuits export cleanly to OpenQASM 3, Perceval-compatible JSON, and calibrated Mach-Zehnder phase tables (theta/phi radians per coupler) ready for hardware control racks.