Concept Collection#
This is a collection of random small projects and demos, most of which can be run entirely in the web browser (client side). Many of them are centered around the numbl project.
Interactive numerical methods#
Methods from the numerical literature that you can watch run and adjust, computed client side by numbl (MATLAB syntax in the browser).
- hitandrun-interactive · live · the hit-and-run MCMC sampler
- walnuts-interactive · live · the WALNUTS sampler, running the paper's own companion MATLAB code
- barycentric-rational · live · Floater-Hormann rational interpolation, pole-free on any nodes; the method is a MATLAB script you edit in the page
numbl tooling: Jupyter, embedding, IDEs#
Ways to write, run, and share MATLAB-syntax code in the browser, all client side (plus a Stan variant of the IDE).
- jupyterlite-numbl-kernel · live · MATLAB syntax in Jupyter, no kernel server
- numbl-embed-example · live · embed numbl in your own page
- numbl-project-example · live · host a numbl project as a static site
- numbl-web-ide · live · a VS Code–style IDE for MATLAB syntax
- stan-web-ide · live · the same IDE for Stan
- numbl-figure-viewer · live · open a figure exported from numbl, underlying data included
surfacefun & chunkie examples#
Surfacefun (functions and PDEs on surfaces) and chunkie (boundary integral equations in 2D) are MATLAB packages; these examples run them in the browser via numbl.
- numbl-surfacefun-intro · live
- surfacefun-interactive · live
- mesh-pde-solver · live
- numbl-chunkie · live
MRI pulse sequences#
Pulseq is an open framework for defining MRI pulse sequences. Here you can write pulseq sequences in MATLAB syntax and run them in the browser via numbl to generate a .seq file, upload and interactively explore an existing one, or simulate one on a digital phantom to see the raw k-space it acquires.
- seqlab · live
- mri-scanner · live
Spherical harmonics on the GPU#
Here are spherical harmonic transforms reimplemented from scratch as WebGPU compute shaders, modeled on SHTNS, together with a live reaction-diffusion solver built on them: Turing patterns forming on a sphere, with diffusion handled implicitly in spectral space where the Laplace-Beltrami operator is diagonal. turing-surface extends the solver from the round sphere to closed surfaces given by spherical-harmonic embeddings, and turing-surface-cache narrows it to a discrete menu of parameter choices whose solutions at a chosen end time are shared between all visitors through a cloud cache.
Browser compute benchmarks#
How fast the browser can crunch numbers.
- math-webgpu-sandbox · live · MATLAB-syntax scripts compiled to fused WebGPU kernels, timed with the script's own
tic/toc; paste the same script into real MATLAB to compare - matmul-bench · live · GEMM in plain JavaScript, WebGPU, SIMD and threaded WASM, and a WASM BLAS, with a native reference
Lazy reading of remote HDF5 files#
Here's a demo of reading large remote HDF5 files, such as NWB neurophysiology files, directly in the browser using HTTP range requests, with no full download and no backend. It shows the approach that neurosift uses to browse these files.
Scientific data compression#
Here are a few projects on compressing scientific data: a step-by-step visualizer for the Asymmetric Numeral Systems (ANS) entropy-coding algorithm, an interactive study of how compressible quantized noisy time series are, a framework for benchmarking compression algorithms on scientific data arrays, and compression benchmarks for electrophysiology recordings.
- ans-visualizer · live
- timeseries-compressibility · live
- benchcompress · results · paper (WIP)
- ephys_compression_tests · results
Speech to text in the browser#
Here's a dictation notepad that transcribes as you speak and never sends your audio anywhere: Whisper and Moonshine run locally via transformers.js, on WebGPU where it's available. The transcript accumulates into a document you can edit and copy.
Other projects#
Documents#
- mdshare (live). A split-pane markdown editor (LaTeX math, highlighted code, mermaid diagrams) where the document is compressed into the URL itself, so sharing is just copying the link; no server, nothing uploaded.
Peer-to-peer shared state#
- commonroom (live). Serverless group video calls: pick a room name, share the link, and everyone in the room is connected over a full WebRTC mesh (up to 8 people), with room-wide shared settings.
- commonroom-recorder (run with npx). Command-line bot that joins a commonroom call as a visible muted participant and records each participant's audio (plus the chat) to files for transcription.
- commoncall (live). Serverless video calls: enter an ID, see who else is on the page, and call them — call setup rides over nostr relays, media flows peer-to-peer via WebRTC.
- hitandrun-commonview (live). The hit-and-run figure with a single live view shared by all visitors over a WebRTC mesh; one peer runs the sampler via numbl and broadcasts to the rest.
- commonview (live). A minimal peer-to-peer page where every visitor shares one state (a counter): nostr discovery, a WebRTC mesh, and a central-peer authority. The basis for hitandrun-commonview.
Geometry, meshing & PDE solvers#
- mesh-studio (live). Build CAD primitives or import STEP/IGES with OpenCASCADE.js, then inspect them in 3D — including each face's true NURBS surface (polynomials on faces), not just its triangulation.
- mesh-converter (live). Convert meshes between 19 formats (PLY, OBJ, STL, VTK, Gmsh, XDMF, …) with meshio running in-browser on Pyodide; inspect meshes in 3D and see what a lossy export would drop.
- qhull-wasm-demo (live). Demos and benchmarks for qhull-wasm, which compiles Qhull to WebAssembly. Includes 2-D Delaunay triangulation, 3-D convex hull, and a Delaunay benchmark with matching scripts for MATLAB, Octave, and numbl.
- numbl-distmesh (live). Every example from Persson and Strang's DistMesh, meshing 2-D regions and surfaces from signed distance functions.
- abc-step-1000 (live). The first 1000 STEP files from the ABC dataset of CAD models (Koch et al., CVPR 2019), served gzip-compressed with a JSON manifest for direct download.
Neurophysiology data & remote access#
- dandiset_000986 (visualizations). Reproducible figures and visualizations for DANDI Dandiset 000986, a set of mouse auditory cortex recordings.
Physics & quantum systems#
- mri-spins (live). Interactive MRI physics: a 3D sample of spins evolving under the Bloch equations, with RF pulses, gradients, relaxation, a live signal trace, and a spoiled gradient echo sequence with scanner-like gradient sounds.
- acoustic-scattering-2d (live). Sound scattering off a room, a disk, slits, or a lens, solved live on the GPU; the solver and the medium are MATLAB you can edit in the page. Drop a microphone anywhere and listen back.
- acoustic-scattering-3d (live). The same physics in three dimensions: spheres, a circular aperture, or a random medium, volume-rendered with a clip plane to see inside, microphone included.
- dulcimer (live). A plucked string and the box it sounds over, as two coupled wave equations in editable MATLAB compiled to WebGPU. Render a note and listen to it.
- numbl-quantum-optics (live). Runnable scripts accompanying the article "Quantum optics in MATLAB" (arXiv:2309.14354), covering quantum states, operators, and dynamics.
- numbl-open-quantum-systems (live). Code from "Coding closed and open quantum systems in MATLAB" (arXiv:1911.04906), including Ising dynamics, cavity-QED phase transitions, and Lindblad and non-Markovian evolution.
Image processing#
- numbl-image-filter (live). Upload an image, write a MATLAB-syntax filter, and run it on the image in the browser.
Number theory & visual math#
- finite-field-visualizer (live). Color-coded multiplication tables over finite (prime) fields. Step through the primes to watch the structure change.
- gcd-visualizer (live). A heatmap of the greatest common divisor of every pair (i, j), laid out as a color-coded table.
- random-points-in-disk (live). How many random points does it take before a disk looks like a disk? Voxel-density heatmaps of uniform random sampling, next to the 1/√μ noise prediction.