1# Concept Collection
3This is a collection of small projects, experiments, and demos, most of which run entirely in the web browser (client side). Many of them are centered around the [numbl project](https://numbl.org). Things here are meant to show that an approach works, not to be finished software; projects that have grown into polished, generally useful tools live in [tools](https://vault1.magland.org/tools).
5## Interactive numerical methods
7Methods from the numerical literature that you can watch run and adjust, computed client side by numbl (MATLAB syntax in the browser).
9- **[hitandrun-interactive](https://vault1.magland.org/proof-of-concept/hitandrun-interactive)** · [live](https://hitandrun-interactive--proof-of-concept.vault1-sites.magland.org/#figure/sampler) · the hit-and-run MCMC sampler
10- **[walnuts-interactive](https://vault1.magland.org/proof-of-concept/walnuts-interactive)** · [live](https://walnuts-interactive--proof-of-concept.vault1-sites.magland.org/#figure/sampler) · the WALNUTS sampler, running the paper's own companion MATLAB code
11- **[barycentric-rational](https://vault1.magland.org/proof-of-concept/barycentric-rational)** · [live](https://barycentric-rational--proof-of-concept.vault1-sites.magland.org/) · Floater-Hormann rational interpolation, pole-free on any nodes; the method is a MATLAB script you edit in the page
13## numbl tooling: Jupyter, embedding, IDEs
15Ways to write, run, and share MATLAB-syntax code in the browser, all client side (plus a Stan variant of the IDE).
17- **[jupyterlite-numbl-kernel](https://vault1.magland.org/proof-of-concept/jupyterlite-numbl-kernel)** · [live](https://jupyterlite-numbl-kernel--proof-of-concept.vault1-sites.magland.org/) · MATLAB syntax in Jupyter, no kernel server
18- **[numbl-embed-example](https://vault1.magland.org/proof-of-concept/numbl-embed-example)** · [live](https://numbl-embed-example--proof-of-concept.vault1-sites.magland.org/) · embed numbl in your own page
19- **[numbl-project-example](https://vault1.magland.org/proof-of-concept/numbl-project-example)** · [live](https://numbl-project-example--proof-of-concept.vault1-sites.magland.org/) · host a numbl project as a static site
20- **[numbl-web-ide](https://vault1.magland.org/proof-of-concept/numbl-web-ide)** · [live](https://numbl-web-ide--proof-of-concept.vault1-sites.magland.org/) · a VS Code–style IDE for MATLAB syntax
21- **[stan-web-ide](https://vault1.magland.org/proof-of-concept/stan-web-ide)** · [live](https://stan-web-ide--proof-of-concept.vault1-sites.magland.org/) · the same IDE for Stan
23## surfacefun & chunkie examples
25[Surfacefun](https://surfacefun.readthedocs.io/en/latest/) (functions and PDEs on surfaces) and [chunkie](https://chunkie.readthedocs.io/en/latest/) (boundary integral equations in 2D) are MATLAB packages; these examples run them in the browser via numbl.
27- **[numbl-surfacefun-intro](https://vault1.magland.org/proof-of-concept/numbl-surfacefun-intro)** · [live](https://numbl-surfacefun-intro--proof-of-concept.vault1-sites.magland.org/)
28- **[surfacefun-interactive](https://vault1.magland.org/proof-of-concept/surfacefun-interactive)** · [live](https://surfacefun-interactive--proof-of-concept.vault1-sites.magland.org/)
29- **[mesh-pde-solver](https://vault1.magland.org/proof-of-concept/mesh-pde-solver)** · [live](https://mesh-pde-solver--proof-of-concept.vault1-sites.magland.org/)
30- **[numbl-chunkie](https://vault1.magland.org/proof-of-concept/numbl-chunkie)** · [live](https://numbl-chunkie--proof-of-concept.vault1-sites.magland.org/)
32## MRI pulse sequences
34[Pulseq](https://pulseq.github.io/) 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.
36- **[seqlab](https://vault1.magland.org/proof-of-concept/seqlab)** · [live](https://seqlab--proof-of-concept.vault1-sites.magland.org/)
37- **[mri-scanner](https://vault1.magland.org/proof-of-concept/mri-scanner)** · [live](https://mri-scanner--proof-of-concept.vault1-sites.magland.org/)
39## Spherical harmonics on the GPU
41Here are spherical harmonic transforms reimplemented from scratch as WebGPU compute shaders, modeled on [SHTNS](https://nschaeff.bitbucket.io/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.
43- **[shtns-webgpu](https://vault1.magland.org/proof-of-concept/shtns-webgpu)** · [live](https://shtns-webgpu--proof-of-concept.vault1-sites.magland.org/)
44- **[turing-sphere](https://vault1.magland.org/proof-of-concept/turing-sphere)** · [live](https://turing-sphere--proof-of-concept.vault1-sites.magland.org/)
45- **[turing-surface](https://vault1.magland.org/proof-of-concept/turing-surface)** · [live](https://turing-surface--proof-of-concept.vault1-sites.magland.org/)
46- **[turing-surface-cache](https://vault1.magland.org/proof-of-concept/turing-surface-cache)** · [live](https://turing-surface-cache--proof-of-concept.vault1-sites.magland.org/)
48## Browser compute benchmarks
50How fast the browser can crunch numbers.
52- **[math-webgpu-sandbox](https://vault1.magland.org/proof-of-concept/math-webgpu-sandbox)** · [live](https://math-webgpu-sandbox--proof-of-concept.vault1-sites.magland.org/) · 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
53- **[matmul-bench](https://vault1.magland.org/proof-of-concept/matmul-bench)** · [live](https://matmul-bench--proof-of-concept.vault1-sites.magland.org/) · GEMM in plain JavaScript, WebGPU, SIMD and threaded WASM, and a WASM BLAS, with a native reference
55## Lazy reading of remote HDF5 files
57Here's a demo of reading large remote HDF5 files, such as [NWB](https://www.nwb.org/) neurophysiology files, directly in the browser using HTTP range requests, with no full download and no backend. It shows the approach that [neurosift](https://neurosift.app/) uses to browse these files.
59- **[remote-hdf5-lazy-read](https://vault1.magland.org/proof-of-concept/remote-hdf5-lazy-read)** · [live](https://remote-hdf5-lazy-read--proof-of-concept.vault1-sites.magland.org/)
61## Scientific data compression
63Here are a few projects on compressing scientific data: a step-by-step visualizer for the [Asymmetric Numeral Systems (ANS)](https://ieeexplore.ieee.org/abstract/document/7170048) 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.
65- **[ans-visualizer](https://vault1.magland.org/proof-of-concept/ans-visualizer)** · [live](https://ans-visualizer--proof-of-concept.vault1-sites.magland.org/)
66- **[timeseries-compressibility](https://vault1.magland.org/proof-of-concept/timeseries-compressibility)** · [live](https://timeseries-compressibility--proof-of-concept.vault1-sites.magland.org/)
67- **[benchcompress](https://vault1.magland.org/proof-of-concept/benchcompress)** · [results](https://benchcompress--proof-of-concept.vault1-sites.magland.org/) · [paper (WIP)](https://benchcompress--proof-of-concept.vault1-sites.magland.org/paper)
68- **[ephys_compression_tests](https://vault1.magland.org/proof-of-concept/ephys_compression_tests)** · [results](https://ephys_compression_tests--proof-of-concept.vault1-sites.magland.org/)
70## Speech to text in the browser
72Here's a dictation notepad that transcribes as you speak and never sends your audio anywhere: Whisper and Moonshine run locally via [transformers.js](https://github.com/huggingface/transformers.js), on WebGPU where it's available. The transcript accumulates into a document you can edit and copy.
74- **[voicenote](https://vault1.magland.org/proof-of-concept/voicenote)** · [live](https://voicenote--proof-of-concept.vault1-sites.magland.org/)
76## Other projects
78### Peer-to-peer shared state
80- **[commonroom-recorder](https://vault1.magland.org/proof-of-concept/commonroom-recorder)**
81 ([run with npx](https://commonroom-recorder--proof-of-concept.vault1-sites.magland.org/)).
82 Command-line bot that joins a [commonroom](https://vault1.magland.org/tools/commonroom) call as a visible muted participant
83 and records each participant's audio (plus the chat) to files for
84 transcription.
85- **[commoncall](https://vault1.magland.org/proof-of-concept/commoncall)**
86 ([live](https://commoncall--proof-of-concept.vault1-sites.magland.org/)).
87 Serverless video calls: enter an ID, see who else is on the page, and call
88 them — call setup rides over nostr relays, media flows peer-to-peer via WebRTC.
89- **[hitandrun-commonview](https://vault1.magland.org/proof-of-concept/hitandrun-commonview)**
90 ([live](https://hitandrun-commonview--proof-of-concept.vault1-sites.magland.org/)).
91 The hit-and-run figure with a single live view shared by all visitors over a
92 WebRTC mesh; one peer runs the sampler via numbl and broadcasts to the rest.
93- **[commonview](https://vault1.magland.org/proof-of-concept/commonview)**
94 ([live](https://commonview--proof-of-concept.vault1-sites.magland.org/)).
95 A minimal peer-to-peer page where every visitor shares one state (a counter):
96 nostr discovery, a WebRTC mesh, and a central-peer authority. The basis for
97 hitandrun-commonview.
99### Geometry, meshing & PDE solvers
101- **[fastandaccurate](https://vault1.magland.org/proof-of-concept/fastandaccurate)**
102 ([live](https://fastandaccurate--proof-of-concept.vault1-sites.magland.org/)).
103 Speed and accuracy benchmarks for PDE solvers: problems posed in the
104 continuum with exact ground truth, compared by work-precision curves,
105 runnable in the browser or from the command line, with results submitted
106 by pull request.
107- **[qhull-wasm-demo](https://vault1.magland.org/proof-of-concept/qhull-wasm-demo)**
108 ([live](https://qhull-wasm-demo--proof-of-concept.vault1-sites.magland.org/)).
109 Demos and benchmarks for [qhull-wasm](https://github.com/magland/qhull-wasm),
110 which compiles [Qhull](http://www.qhull.org) to WebAssembly. Includes 2-D
111 Delaunay triangulation, 3-D convex hull, and a Delaunay benchmark with
112 matching scripts for MATLAB, Octave, and numbl.
113- **[numbl-distmesh](https://vault1.magland.org/proof-of-concept/numbl-distmesh)**
114 ([live](https://numbl-distmesh--proof-of-concept.vault1-sites.magland.org/)).
115 Every example from Persson and Strang's
116 [DistMesh](https://github.com/popersson/DistMesh), meshing 2-D regions and
117 surfaces from signed distance functions.
118- **[abc-step-1000](https://vault1.magland.org/proof-of-concept/abc-step-1000)**
119 ([live](https://abc-step-1000--proof-of-concept.vault1-sites.magland.org/)).
120 The first 1000 STEP files from the
121 [ABC dataset](https://deep-geometry.github.io/abc-dataset/) of CAD models
122 (Koch et al., CVPR 2019), served gzip-compressed with a JSON manifest for
123 direct download.
125### Neurophysiology data & remote access
127- **[dandiset_000986](https://vault1.magland.org/proof-of-concept/dandiset_000986)**
128 ([visualizations](https://dandiset_000986--proof-of-concept.vault1-sites.magland.org/)).
129 Reproducible figures and visualizations for
130 [DANDI Dandiset 000986](https://dandiarchive.org/dandiset/000986), a set of
131 mouse auditory cortex recordings.
133### Physics & quantum systems
135- **[mri-spins](https://vault1.magland.org/proof-of-concept/mri-spins)**
136 ([live](https://mri-spins--proof-of-concept.vault1-sites.magland.org/)).
137 Interactive MRI physics: a 3D sample of spins evolving under the Bloch
138 equations, with RF pulses, gradients, relaxation, a live signal trace, and a
139 spoiled gradient echo sequence with scanner-like gradient sounds.
140- **[acoustic-scattering-2d](https://vault1.magland.org/proof-of-concept/acoustic-scattering-2d)**
141 ([live](https://acoustic-scattering-2d--proof-of-concept.vault1-sites.magland.org/)).
142 Sound scattering off a room, a disk, slits, or a lens, solved live on the
143 GPU; the solver and the medium are MATLAB you can edit in the page. Drop a
144 microphone anywhere and listen back.
145- **[acoustic-scattering-3d](https://vault1.magland.org/proof-of-concept/acoustic-scattering-3d)**
146 ([live](https://acoustic-scattering-3d--proof-of-concept.vault1-sites.magland.org/)).
147 The same physics in three dimensions: spheres, a circular aperture, or a
148 random medium, volume-rendered with a clip plane to see inside, microphone
149 included.
150- **[dulcimer](https://vault1.magland.org/proof-of-concept/dulcimer)**
151 ([live](https://dulcimer--proof-of-concept.vault1-sites.magland.org/)).
152 A plucked string and the box it sounds over, as two coupled wave equations
153 in editable MATLAB compiled to WebGPU. Render a note and listen to it.
154- **[numbl-quantum-optics](https://vault1.magland.org/proof-of-concept/numbl-quantum-optics)**
155 ([live](https://numbl-quantum-optics--proof-of-concept.vault1-sites.magland.org/)).
156 Runnable scripts accompanying the article "Quantum optics in MATLAB"
157 ([arXiv:2309.14354](https://arxiv.org/abs/2309.14354)), covering quantum
158 states, operators, and dynamics.
159- **[numbl-open-quantum-systems](https://vault1.magland.org/proof-of-concept/numbl-open-quantum-systems)**
160 ([live](https://numbl-open-quantum-systems--proof-of-concept.vault1-sites.magland.org/)).
161 Code from "Coding closed and open quantum systems in MATLAB"
162 ([arXiv:1911.04906](https://arxiv.org/abs/1911.04906)), including Ising
163 dynamics, cavity-QED phase transitions, and Lindblad and non-Markovian
164 evolution.
166### Image processing
168- **[numbl-image-filter](https://vault1.magland.org/proof-of-concept/numbl-image-filter)**
169 ([live](https://numbl-image-filter--proof-of-concept.vault1-sites.magland.org/)).
170 Upload an image, write a MATLAB-syntax filter, and run it on the image in the
171 browser.
173### Number theory & visual math
175- **[finite-field-visualizer](https://vault1.magland.org/proof-of-concept/finite-field-visualizer)**
176 ([live](https://finite-field-visualizer--proof-of-concept.vault1-sites.magland.org/)).
177 Color-coded multiplication tables over finite (prime) fields. Step through the
178 primes to watch the structure change.
179- **[gcd-visualizer](https://vault1.magland.org/proof-of-concept/gcd-visualizer)**
180 ([live](https://gcd-visualizer--proof-of-concept.vault1-sites.magland.org/)).
181 A heatmap of the greatest common divisor of every pair (i, j), laid out as a
182 color-coded table.
183- **[random-points-in-disk](https://vault1.magland.org/proof-of-concept/random-points-in-disk)**
184 ([live](https://random-points-in-disk--proof-of-concept.vault1-sites.magland.org/)).
185 How many random points does it take before a disk looks like a disk? Voxel-density
186 heatmaps of uniform random sampling, next to the 1/√μ noise prediction.