Source, hosted and readable
Full source for the from-scratch projects — browsable by file, syntax-highlighted, with line permalinks. Files that have been walked through show an Annotated toggle: hover any marked line for the reasoning behind it.
Hartree–Fock in C++ (from scratch)
Closed-shell RHF with zero external dependencies: Obara–Saika integrals, Boys function, Cholesky + Jacobi generalized eigensolver, DIIS-accelerated SCF. Converges H₂/STO-3G to Szabo’s −1.1167 Hartree. The electronic sibling of the nuclear Skyrme–HF solver — same fixed-point loop, different force.
Read the writeup →CSV engine, one idea at a time (modern C++)
Five self-contained C++20 programs, each one idea faster: getline baseline (130 MB/s) → mmap state machine → zero-copy string_views (proven: 0 allocations/row) → SWAR scanning → a typed GROUP-BY query at 900 MB/s, 7× the naive pipeline. RFC-4180 correct at every step, benchmark numbers in the README.
m-scheme shell model CI (from scratch)
283 lines of Python: sd-shell configuration interaction with the USDB interaction — bitstring basis, fermionic phase rules, sparse Lanczos. Validated against two production codes run on the same machine: ¹⁸O matches cosmo to every printed digit; ²⁴Mg (dim 28,503) matches cosmo and BIGSTICK to 4 decimals. Results files included.
Read the writeup →Build your own shell model (tutorial steps)
The six runnable steps of the shell-model tutorial: valence space → bitstring basis → the interaction file → fermionic phases → 18O exactly → 24Mg at scale. Each step is a complete Python program that prints its own checks against production codes.
Read the writeup →Build your own nuclear DFT (tutorial steps)
The seven runnable steps of the build-it-in-stages Vautherin–Brink tutorial: grid → one bound state → shell structure → densities → Skyrme fields → SCF loop → the real binding energy. Each step is a complete Knot program that runs in the browser IDE.
Read the writeup →Knot by example
Real scientific programs in Knot, the numerical language from knotkit (a Rust compiler kit): a full Hartree–Fock SCF, FEM Poisson, reverse-mode autodiff, a flat-array mini-CAS. Each compiles to plain C — try them live in the playground, or download the generated .c and gcc it.
Read the writeup →Skyrme–Hartree–Fock (Vautherin–Brink)
Spherical Skyrme–Hartree–Fock nuclear-structure solver in Python — reproduces Vautherin & Brink (1972) and extends it to the SLy4 / SkM* functionals. Binding energies, charge radii, single-particle spectra, and effective mass across the doubly-magic chain.
Read the writeup →