# Concept Collection This 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). ## 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](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 - **[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 - **[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 ## 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](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 - **[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 - **[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 - **[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 - **[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 ## surfacefun & chunkie examples [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. - **[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/) - **[surfacefun-interactive](https://vault1.magland.org/proof-of-concept/surfacefun-interactive)** · [live](https://surfacefun-interactive--proof-of-concept.vault1-sites.magland.org/) - **[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/) - **[numbl-chunkie](https://vault1.magland.org/proof-of-concept/numbl-chunkie)** · [live](https://numbl-chunkie--proof-of-concept.vault1-sites.magland.org/) ## MRI pulse sequences [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. - **[seqlab](https://vault1.magland.org/proof-of-concept/seqlab)** · [live](https://seqlab--proof-of-concept.vault1-sites.magland.org/) - **[mri-scanner](https://vault1.magland.org/proof-of-concept/mri-scanner)** · [live](https://mri-scanner--proof-of-concept.vault1-sites.magland.org/) ## Spherical harmonics on the GPU Here 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. - **[shtns-webgpu](https://vault1.magland.org/proof-of-concept/shtns-webgpu)** · [live](https://shtns-webgpu--proof-of-concept.vault1-sites.magland.org/) - **[turing-sphere](https://vault1.magland.org/proof-of-concept/turing-sphere)** · [live](https://turing-sphere--proof-of-concept.vault1-sites.magland.org/) - **[turing-surface](https://vault1.magland.org/proof-of-concept/turing-surface)** · [live](https://turing-surface--proof-of-concept.vault1-sites.magland.org/) - **[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/) ## Browser compute benchmarks How fast the browser can crunch numbers. - **[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 - **[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 ## Lazy reading of remote HDF5 files Here'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. - **[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/) ## Scientific data compression Here 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. - **[ans-visualizer](https://vault1.magland.org/proof-of-concept/ans-visualizer)** · [live](https://ans-visualizer--proof-of-concept.vault1-sites.magland.org/) - **[timeseries-compressibility](https://vault1.magland.org/proof-of-concept/timeseries-compressibility)** · [live](https://timeseries-compressibility--proof-of-concept.vault1-sites.magland.org/) - **[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) - **[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/) ## 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](https://github.com/huggingface/transformers.js), on WebGPU where it's available. The transcript accumulates into a document you can edit and copy. - **[voicenote](https://vault1.magland.org/proof-of-concept/voicenote)** · [live](https://voicenote--proof-of-concept.vault1-sites.magland.org/) ## Other projects ### Peer-to-peer shared state - **[commonroom-recorder](https://vault1.magland.org/proof-of-concept/commonroom-recorder)** ([run with npx](https://commonroom-recorder--proof-of-concept.vault1-sites.magland.org/)). Command-line bot that joins a [commonroom](https://vault1.magland.org/tools/commonroom) call as a visible muted participant and records each participant's audio (plus the chat) to files for transcription. - **[commoncall](https://vault1.magland.org/proof-of-concept/commoncall)** ([live](https://commoncall--proof-of-concept.vault1-sites.magland.org/)). 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](https://vault1.magland.org/proof-of-concept/hitandrun-commonview)** ([live](https://hitandrun-commonview--proof-of-concept.vault1-sites.magland.org/)). 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](https://vault1.magland.org/proof-of-concept/commonview)** ([live](https://commonview--proof-of-concept.vault1-sites.magland.org/)). 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 - **[fastandaccurate](https://vault1.magland.org/proof-of-concept/fastandaccurate)** ([live](https://fastandaccurate--proof-of-concept.vault1-sites.magland.org/)). Speed and accuracy benchmarks for PDE solvers: problems posed in the continuum with exact ground truth, compared by work-precision curves, runnable in the browser or from the command line, with results submitted by pull request. - **[qhull-wasm-demo](https://vault1.magland.org/proof-of-concept/qhull-wasm-demo)** ([live](https://qhull-wasm-demo--proof-of-concept.vault1-sites.magland.org/)). Demos and benchmarks for [qhull-wasm](https://github.com/magland/qhull-wasm), which compiles [Qhull](http://www.qhull.org) 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](https://vault1.magland.org/proof-of-concept/numbl-distmesh)** ([live](https://numbl-distmesh--proof-of-concept.vault1-sites.magland.org/)). Every example from Persson and Strang's [DistMesh](https://github.com/popersson/DistMesh), meshing 2-D regions and surfaces from signed distance functions. - **[abc-step-1000](https://vault1.magland.org/proof-of-concept/abc-step-1000)** ([live](https://abc-step-1000--proof-of-concept.vault1-sites.magland.org/)). The first 1000 STEP files from the [ABC dataset](https://deep-geometry.github.io/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](https://vault1.magland.org/proof-of-concept/dandiset_000986)** ([visualizations](https://dandiset_000986--proof-of-concept.vault1-sites.magland.org/)). Reproducible figures and visualizations for [DANDI Dandiset 000986](https://dandiarchive.org/dandiset/000986), a set of mouse auditory cortex recordings. ### Physics & quantum systems - **[mri-spins](https://vault1.magland.org/proof-of-concept/mri-spins)** ([live](https://mri-spins--proof-of-concept.vault1-sites.magland.org/)). 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](https://vault1.magland.org/proof-of-concept/acoustic-scattering-2d)** ([live](https://acoustic-scattering-2d--proof-of-concept.vault1-sites.magland.org/)). 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](https://vault1.magland.org/proof-of-concept/acoustic-scattering-3d)** ([live](https://acoustic-scattering-3d--proof-of-concept.vault1-sites.magland.org/)). 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](https://vault1.magland.org/proof-of-concept/dulcimer)** ([live](https://dulcimer--proof-of-concept.vault1-sites.magland.org/)). 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](https://vault1.magland.org/proof-of-concept/numbl-quantum-optics)** ([live](https://numbl-quantum-optics--proof-of-concept.vault1-sites.magland.org/)). Runnable scripts accompanying the article "Quantum optics in MATLAB" ([arXiv:2309.14354](https://arxiv.org/abs/2309.14354)), covering quantum states, operators, and dynamics. - **[numbl-open-quantum-systems](https://vault1.magland.org/proof-of-concept/numbl-open-quantum-systems)** ([live](https://numbl-open-quantum-systems--proof-of-concept.vault1-sites.magland.org/)). Code from "Coding closed and open quantum systems in MATLAB" ([arXiv:1911.04906](https://arxiv.org/abs/1911.04906)), including Ising dynamics, cavity-QED phase transitions, and Lindblad and non-Markovian evolution. ### Image processing - **[numbl-image-filter](https://vault1.magland.org/proof-of-concept/numbl-image-filter)** ([live](https://numbl-image-filter--proof-of-concept.vault1-sites.magland.org/)). Upload an image, write a MATLAB-syntax filter, and run it on the image in the browser. ### Number theory & visual math - **[finite-field-visualizer](https://vault1.magland.org/proof-of-concept/finite-field-visualizer)** ([live](https://finite-field-visualizer--proof-of-concept.vault1-sites.magland.org/)). Color-coded multiplication tables over finite (prime) fields. Step through the primes to watch the structure change. - **[gcd-visualizer](https://vault1.magland.org/proof-of-concept/gcd-visualizer)** ([live](https://gcd-visualizer--proof-of-concept.vault1-sites.magland.org/)). A heatmap of the greatest common divisor of every pair (i, j), laid out as a color-coded table. - **[random-points-in-disk](https://vault1.magland.org/proof-of-concept/random-points-in-disk)** ([live](https://random-points-in-disk--proof-of-concept.vault1-sites.magland.org/)). 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.