# ATOM⁴

**The official position on the universe we're building**: four dimensions of
space, with the force between charges pinned at 1/r. It's an understanding toy
like Lumen⁴, not a game. 3D is warm and 4D is ice.

`index.html` is the position: every conclusion, one card per chapter, and the
open questions. [`LITERATURE.md`](LITERATURE.md) holds the literature notes for the write-up (prior art, how far
each reference is verified, and what's new against it). [`WRITEUP.md`](WRITEUP.md) is the pinned plan for it: the kit
the repo has (wormhole's paper layout, dataviz figures, headless PDF), the decisions to make, and paper 1's outline. Then ten chapter pages, each showing its working:

| page | chapter |
|---|---|
| `force.html` | 1 · why 1/r, the five routes to it, the lens vacuum we take, the shell theorem's failure, a small fourth dimension |
| `light.html` | 2 · Lumen⁴'s light under the lens: what holds, what matter feels, the sky |
| `motion.html` | 3 · F = ma, orbits, rotation in planes, handed spin, tumbling bodies, three twists per bond |
| `hydrogen.html` | 4 · the exact atom, its spectrum, fine structure |
| `table.html` | 5 · the periodic table, trends, partial screening, how far to trust it |
| `shapes.html` | 6 · the six regular 4D polytopes |
| `darbon.html` | 7 · element 7: bonds, handedness, crystals |
| `forces.html` | 8 · the force field term by term: the permanent R⁻⁵, dispersion's 7/4, exponential repulsion, twisting, salt's power-law screening |
| `xater.html` | 9 · Pxygen (element 10) and Xater (H₂Px), by Hartree–Fock in any dimension, checked on our water |
| `census.html` | 10 · which water: every hydride of rows 2 and 3, their polarity, shapes and hydrogen-bonded networks |
| `search.html` | 11 · ten ways to meet: how the census missed the best pairs, counting a pair's ways to meet (d moves, d(d − 1)/2 turns), the live search (`js/search.js`), and what a search can promise |

Every page runs `js/main.js`, which draws only the figures whose elements are on
that page. Links to the old one-page version's anchors (`#maxwell`,
`#trends`, …) are forwarded from the landing to the chapter that now holds them.
The selftest checks that the nav is the same on all eleven pages, that no id
appears twice, and that every drawing has its element somewhere. When you add a
conclusion to a chapter, add it to the landing's cards too: the landing is the
position.

- `js/atom.js` (no DOM) is the solver: one electron by Numerov on a log grid,
  many by a self-consistent field (Hartree plus local exchange, each electron's
  own share out, spins by Hund's rule), and the search for each atom's ground
  configuration.
- `js/response.js` is generated by `tools/response.mjs` (about a minute): each noble gas's and hydrogen's α(iω)
  by the coupled response, and C₆. Re-run it after `bake.mjs`; the selftest recomputes one atom.
- `js/fields.js` (no DOM) is the field theory's closed forms.
- `js/periodic.js` (no DOM) lays the table out and holds our real table for
  the 3D check.
- `js/polytopes.js` (no DOM) is the shapes: the six regular 4D polytopes, sp^d hybrids, and the
  honeycomb → diamond → darbon's-diamond nets.
- `js/forces.js` (no DOM) is the forces between molecules: S = Σ⟨r²⟩ from the solver (the bake stores each
  orbital's ⟨r²⟩), the permanent −3S_AS_B/64R⁵, London's C₆ with tr T² = d + 3, β = 2√(2I), the 4D Fourier
  constants (Lanczos Γ), salt's tail, an exact two-Gaussian-atom integral (a 4D Hankel transform) for checking,
  and the twist energy across a bond.
- `js/turning.js` (no DOM) is motion and spin: the left/right split of 4D turns, spin rates, harmonic
  dimensions and fine structure, orbits (leapfrog, Runge–Lenz), and a free rigid body (Euler's equations
  in six components, RK4).
- `js/tile.js` is a small 4D viewer, many to a page, and the seed of a 4D molecular-dynamics view.
  It takes an idle spin (any planes), a `step` (a simulation run every frame), an `overlay`, and
  `onTurn` (told of every turn). `js/shapes.js` fills the shapes and darbon chapters with tiles, and
  `js/turningTiles.js` fills the motion chapter.
- `js/pairs.js` is generated by `tools/pairs.mjs` (about a minute): two like noble-gas atoms at 3–15 bohr, in 3D
  and 4D, by Gordon and Kim's electron-gas model on the solver's frozen clouds. Re-run it after `bake.mjs`;
  the selftest recomputes one point.
- `js/table.js` is generated by `tools/bake.mjs`, about six minutes on four
  cores.
- `js/gauss.js` (no DOM) is Hartree–Fock (restricted and unrestricted, DIIS) on Cartesian Gaussians in any
  dimension: McMurchie–Davidson integrals with G_n(T) in place of Boys's function (below), shell-pair batches,
  Schwarz screening, and J and K in one pass over the unique integrals.
- `js/molecules.js` is generated by `tools/molecules.mjs` (about half an hour, four jobs in parallel): our oxygen
  and water and 4D's Pxygen and Xater, two basis sizes each, and the hydrogen-bonded pairs. It doesn't depend on
  `table.js`; the selftest recomputes Xater at the small basis.
- `js/md.js` (no DOM) is molecular dynamics in any dimension: rigid molecules by SHAKE/RATTLE, Bussi's canonical
  thermostat, short-range terms (Lennard-Jones or exp-6, truncated, with their analytic tail for the energy and
  shifted to zero at the cutoff for the motion), and charges by an Ewald sum written for any d. The split is of 1/r
  itself, erfc(αr)/r and erf(αr)/r. The textbook Gaussian-cloud split works only in 3D: elsewhere 1/r isn't
  harmonic, and the cloud leaves a 1/(4α²r³) tail. The smooth part's transform is K_d k^(1−d) Q((d−1)/2, k²/4α²).
  - **Checks.** Rock salt's Madelung constant (1.7475646). The 4D alternating lattice's, 1.8393991, which an Evjen
    sum gives independently. Forces against finite differences. NIST's SPC/E reference configurations, every Ewald
    part to all six published figures.
  - **Liquids.** SPC/E water at 298 K gives U = −46.9 kJ/mol. Energy is conserved to 0.012 kJ/mol per molecule over
    a picosecond (3D) and 0.0016 over 0.2 ps (4D).
  - A damped-shifted-force Coulomb mode (`dsf`) is for live views only: it drops Ewald's smooth part.
- **Force fields (in progress).**
  - `tools/forcefield.mjs` bakes `js/ffdata.js`: Hartree–Fock pair energies (counterpoise-corrected, the census's
    basis rule) at seeded random placements, a scan along the census's hydrogen bond, and a tighter-packed set, for
    our water and for Xater. `refine <round>` then runs the liquid with the current fit, harvests the closest pairs it
    visits (300 and 900 K), and adds their energies.
  - `tools/fitff.mjs` fits `js/ffmodel.js` (charges on the nuclei, Born–Mayer-exponent repulsions,
    Tang–Toennies-damped X–X attraction) to them by Levenberg–Marquardt and writes `js/forcefields.js`.
  - `js/liquid.js` is the live view (a water drop beside a Xater drop in 4D tiles). It's built but not on a page yet.
- **What it has found so far:**
  - Water from Hartree–Fock pairs has about half its real cohesion: U = −22.2 kJ/mol at 298 K and 0.997 g/cm³
    against about −41.5, with no dispersion and no many-body polarization. In the drop it boils off at 300 K.
  - Xater's liquid comes out very dense and cohesive (heavy atoms 4.3 bohr apart, U ≈ −280 kJ/mol). Pairs harvested
    from it reached −15.5 kcal/mol under Hartree–Fock, deeper than chapter 10's 13.3. The census optimized each pair
    over distance and one tilt only, hence:
- **The full pair search** (`tools/pairsearch.mjs <key> [rounds]`, then `bake` into `js/pairmin.js`).
  - Every relative pose (exp(Ω) turns, 3 numbers in 3D and 6 in 4D, plus d to move), searched from thousands of
    starts by BFGS on the fitted force field. The distinct minima are scored by Hartree–Fock, and the best relaxed
    under it by rounds of parabolas along each pose number. That last step is coarse (~0.2 kcal/mol), so a census
    pair that's lower stands.
  - Element 9's XH₃ got its own training data and fit for this (key 4.9; the force-field tools now take any HₙX).
  - **Results:**
    - Our water: nothing deeper than its linear bond (search −4.22, census −4.35). That's the check.
    - Xater: −26.92 kcal/mol at heavy atoms 4.88 bohr apart (census −13.28).
    - XH₃: −27.54 at 5.30 bohr (census −13.73).
  - **The descent was fixed after these runs** (`js/landscape.js`). It used to stop when the energy stopped changing,
    and with the turn wound to tens of radians (exp(Ω) badly conditioned there) many descents stalled short of the
    bottom. Those stalls were counted as extra minima: the six "model minima" for each 4D molecule in
    `js/pairmin.js` are one basin reached six times. The descent (`poseSteps` / `descend`) now folds the turn into
    the reference orientation once |Ω| > 1.5 and stops only when |g| < 10⁻⁶. With it, 400 of 400 random starts find
    Xater's one pair basin, and 378 of 400 find our water's (the rest drift apart or run out of steps). The
    Hartree–Fock energies stand; `pairmin.js`'s `modelMinima` list is due a re-bake.
- **The live search** (`js/search.js`, chapter 11): the same descent, animated, on both worlds' force fields. It
  classes every start's end as a basin, *apart* or *unfinished*, and draws the discovery curve.
- **The cluster census** (`tools/clusters.mjs <key> <n> [starts]`, then `bake` into `js/clusters.js`; chapter 11's
  crowds section). Clusters of 3–6 molecules on the force field (pairwise additive), random starts, the same descent.
  Minima are counted two ways, which bracket the truth: by energy and sorted heavy-atom distances (can split a soft
  basin) and by energy alone (can merge near-degenerate ones). Chao1 estimates the unseen. Results are cached per job
  in the temp dir; about 1.5 h on 4 cores for 3/4/4.9 × n = 3–6. `--shard i/m` runs the starts s ≡ i (mod m) into its
  own file, and `bake` merges a complete set.
- **Long runs go to the runner** (`.github/compute/`): queue tool commands in `.github/compute/atom4.json`, push, and
  GitHub's runners do them (4 cores, 6 h a group, groups in parallel), resuming from the caches on the orphan branch
  `atom4-data`. In the sandbox, background jobs die about 5 minutes after the session goes idle. First run, for six molecules: our water 15–28 minima, Xater 44–104, XH₃ 51–232
  (Chao1 for XH₃ ≈ 670, not to be trusted: most seen once).
    - Both 4D best pairs are compact and antiparallel, each lending a hydrogen to the other (Xater's X–H···X at
      95°, water's near 165°). The tie stands, at twice the strength. Chapter 10 now says so (its "network" count,
      built on linear bonds, is marked as superseded by the liquid simulation).
  - The three-site model fits water's pairs to 0.3–0.5 kcal/mol but Xater's only to 1.7. The next steps are a fourth
    site (TIP4P-style, on the axis of Xater's lone-pair ring), a many-body check, then MP2 pairs and polarization for
    the numbers.
- `js/census.js` is generated by `tools/census.mjs` (about four and a half hours on four cores: 21 hydrides, then
  10 pairs three at a time). Each finished job is cached in the system temp directory (`atom4-census/`), so a run
  cut short by the sandbox reclaiming an idle container resumes; `CENSUS_FRESH=1` ignores the cache. The selftest
  recomputes element 11's HX.
- `test/atom4.selftest.mjs` checks all of it.

## The premise

Gauss's law in 4D makes the potential of a charge fall as 1/r². In the
radial equation that's the same power as the centrifugal term, so nothing
sets a length. Below a critical coupling there is no bound state, and above
it the electron falls in. There's no atom either way (Ehrenfest, 1917, for
the classical orbits). So the potential is **pinned at 1/r** in four
dimensions. Section 7 of the page asks what that costs.

## The solver

| piece | how |
|---|---|
| one electron | u = r^((d−1)/2) R satisfies the 3D radial equation with l → L = l + (d − 3)/2. On x = ln r with u = r^½ y: y″ = [2r²(V − ε) + (L + ½)²] y, Numerov on 700 points, r from 10⁻⁵ to 150 bohr |
| its energy | bisection on the outward solution's node count (Sturm). The lower bound is the bare nucleus's level, since the cloud only repels. Integration stops where h²f/12 > ½: past that Numerov flips sign every step and fakes nodes. That was the bug that broke 3D s-states at first |
| its wavefunction | outward to the classical turning point, inward from where Numerov is still stable, spliced |
| the cloud's pull | a unit charge spread over a sphere of radius s, felt at r: 1/max(r, s) in 3D (the shell theorem); k(min/max)/max in 4D, k(t) = (2/π)∫₀^π sin²θ dθ/√(1 + t² − 2t cos θ), tabulated |
| many electrons | each subshell solved in the nucleus's pull, plus the whole cloud minus its own one-electron share (Hartree), plus local exchange e_x = −Cρ^(1+1/d) (Dirac's C in 3D, 16/(15√π) in 4D), spin-polarized with spins by Hund's rule, minus its own electron's (Perdew–Zunger). Mixed 0.4 per iteration. E = Σ o ε − ½ΣΣ o o′ J + ½ Σ o J_self + E_x − ∫ρv_x − Σ o (E_x^pol[n] − ∫n v^pol). For helium the exchange cancels exactly, so it stays Hartree–Fock |
| the ground configuration | fill by the orbital energies of every subshell in the current field until it stops changing, then try moving one or two electrons among the open, top-filled and lowest-empty subshells, keeping the least total energy among those whose field converged (with exchange, a barely bound orbital can drift for hundreds of iterations and report an energy far too low: element 78 did) |
| ionization | ΔSCF: the relaxed ion's energy minus the atom's, taking the electron from whichever of the three least-bound subshells leaves the ion lowest |

## What it finds

- **Hydrogen**: E = −Z²/2(n + ½)², ground 6.05 eV, mean radius 3 bohr. Shells hold 2, 10, 28, 60, 110
  electrons ((l + 1)² orbitals per l). Its fall to n = 2 is red to orange, ending at 570 nm.
- **The 3D check**: 32 of Z = 1–36 match our real configurations, chromium and copper included (Hund's rule
  exchange). Ti, V, Co and Ni come out with one 4s electron moved into 3d, a known lean of local exchange.
  Helium's energy is −2.86168, Hartree–Fock's exactly; neon's −128.86 (HF −128.55). Ionization energies: median
  0.97 of measured, range 0.84–1.04, correlation 0.995, the N→O and P→S dips included. (Without exchange, the
  first version had 34 of 36, missing Cr and Cu, with ionization a third low.)
- **The 4D table**: rows of 2, 10, 10, 28, 28 (Z = 1–78). The noble gases are 2, 12, 22, 50 and 78. Element 7 (s² p³)
  is carbon-like, with five bonds at the corners of a 5-cell (104.48°). The solver leans 4D's transition metals hard
  toward d: runs with a single s electron, and elements 64–68 with none, like palladium. Those are the least
  trustworthy entries.
- **The shell theorem's failure, in the chemistry**: outside a shell k < 1, so inner electrons only partly
  screen the nucleus. 4D noble gases get harder to ionize down the column overall (18.4, 17.7, 20.9, 23.1 eV
  from element 12), where ours get easier. With the 3D kernel forced on (`scf(…, { shellTheorem: true })`) they
  sit flat near 10 eV, about half as tight. A neutral 4D atom
  pulls on a distant electron with −Σr²/8s³. Ours exerts no pull at all.

## The shapes (chapter 6)

The six regular 4D polytopes, built from coordinates:
- the 5-cell from the simplex;
- the tesseract from (±1)⁴;
- the 16-cell from ±eᵢ;
- the 24-cell from the permutations of (±1, ±1, 0, 0);
- the 600-cell from ±eᵢ, (±½)⁴ and the even permutations of ½(±φ, ±1, ±1/φ, 0);
- the 120-cell as the centres of the 600-cell's 600 tetrahedra.

Everything else is computed:
- edges are the least-distance pairs;
- faces are the planar k-cycles;
- cells are the vertices farthest along each vertex of the dual.

The selftest checks the f-vectors against Schläfli's and V − E + F − C = 0.

A tile draws a scene two ways:
- **shadow**: a perspective camera off along w, coloured kata pink to ana green;
- **slice**: the 3D cross-section at w = h. Each face crossing the hyperplane gives one edge, a ball gives a
  ball of radius √(r² − Δw²), and a bond gives the stretch of it within its radius of the hyperplane.

Drag turns it in 3D or through w. A touch turns it by its sideways drag only, so the page still scrolls.

## Darbon (chapter 7)

Element 7 of the 4D table (s² p³, half a shell) is named darbon.

- **Bonds.** sp⁴ hybrids are a fifth s each (sp³'s are a quarter: a² = 1/(d + 1)) and point to a 5-cell's
  corners, 104.48° apart. Its hydride is DH₅, and chains carry 3n + 2 hydrogens.
- **Handedness.** It's chiral with five different neighbours: the simplex's rotations are exactly its even
  shuffles, checked over all 120. Our own chiral molecules aren't chiral in 4D: half a turn through w is a mirror
  for anything with w = 0, and a tile shows it.
- **Crystals.** Its diamond is two copies of the lattice A₄, one bond apart, by the same construction as
  graphene's honeycomb (A₂) and diamond (A₃, the fcc lattice). It can't come from the hypercube: no tesseract
  corners make a regular 5-cell, checked over all 4368 choices. It has a five-fold rotation, which 4D crystals
  allow and 3D crystals don't.

All of this is hybrid-orbital geometry, not computed bonding.

## Rewriting Maxwell

A static r^−p in D_s dimensions is the transform of 1/(k²)^a with 2a = D_s − p. Maxwell's equations are a = 1: 1/r in 3D, 1/r² in 4D.
Pinning 1/r in 4D needs a = 3/2. The routes and what each one costs:

1. **Local, linear and relativistic**: impossible. □ gives 1/k², □² gives 1/k⁴ (a log in 4D).
2. **□^(3/2), relativistic but nonlocal**: positive probabilities (Källén–Lehmann) need the propagator to be a
   positive sum of 1/(p² + m²), never more singular than 1/p². The field's dimension Δ = 1 is below the
   scalar unitarity bound of 3/2. The result has ghosts, and light becomes a continuum with no photon.
3. **ε(k) = ε₀ℓk, a strange vacuum**: a new length ℓ, and light disperses as ω = c√(k/ℓ) like deep-water
   waves. There's no invariant speed, so relativity is gone.
4. **A nonlinear Gauss law**, ∇·(|E|^(m−2)E) = ρ with m = 5/2: superposition is gone.
5. **A compact fourth dimension** of size ℓ: (π/ℓr) coth(πr/ℓ). That's 1/r² close and 1/r far, but atoms
   bigger than ℓ are 3D atoms.

6. **The lens vacuum, the one this universe takes**: ε(k) = ε₀ℓk *and* μ(k) = μ₀/ℓk. Then E′ = D/ε₀ and
   B′ = μ₀H obey Maxwell's equations in empty 4D space exactly, with the usual sources: that is the light, and
   it's Lumen⁴'s. What pushes charges is E = E′/ℓ|k|, B = B′/ℓ|k|, the light blurred across space by a 1/r³
   kernel at each instant. Statics come out as 1/(ℓk³), the pinned 1/r; waves as ω = ck at every wavelength; the
   energy (E′² + c²B′²)ε₀/2ℓ|k| is never negative; fields add. The cost is relativity for the force: an absolute
   now, a preferred frame.

Every route keeps the shell-theorem problem: ∇²(1/r) = −1/r³ in 4D, flux that grows with radius, and no Faraday
cage (the potential at the centre of a charged shell is 3π/8 of the potential at its wall). The big problem: in
3D, locality, linearity, relativity and unitarity together force 1/r. In 4D they force 1/r², and there are no
atoms. This universe gives up relativity, for electromagnetism only.

## Light (chapter 2)

Under the lens vacuum Lumen⁴'s conclusions hold for the light itself: 1/r³, three polarizations, the wake,
1.43 λ/D, ν⁴ and T⁵, and the rainbow's conics as geometry (its 42° is our water's). Matter feels a
single frequency through the lens as one number, c/ℓω, so every pattern is unchanged; long waves push
harder. A flash, having every k at once, is felt faintly before its front arrives. This is argued, not
yet computed. Small-particle scattering goes as ω^(d+1)(c/ℓω)² = ω³ (ours ω⁴, 4D Maxwell ω⁵); the light
chapter draws the three skies from Lumen⁴'s Planck spectra and colour function, assuming a
frequency-independent polarizability. Lumen⁴'s page carries a note pointing here.

## Motion and spin (chapter 3)

- F = ma in four components. Central-force motion stays in a plane: under 1/r, Kepler's ellipses. The
  Runge–Lenz vector p²x − (x·p)p − x/r is conserved in any dimension. Under Gauss's 1/r³ force a nudged circle
  flies off (Ehrenfest).
- Turns act on six planes. An antisymmetric Ω splits by the Hodge star into self-dual and anti-self-dual halves,
  which commute and each close as so(3).
- **Spin.** In 4 + 1 the Euclidean γ₁…γ₄ give γ₁γ₂γ₃γ₄, which squares to 1 and anticommutes with each, so it
  *is* time's γ₀ (in one of the two irreducible representations). A slow electron (γ₀ = +1) is therefore one
  chirality of Spin(4) = SU(2) × SU(2): two states, turned by the left half of every rotation and blind to the
  right. The selftest builds the γ matrices and checks this. Pairing (two per orbital) assumes the electron is
  the smallest spinor and that spin-statistics holds; the lens vacuum isn't fully relativistic, so both are
  taken as part of the universe's definition. Only the self-dual half of a magnetic field can flip a spin.
- Fine structure: orbitals of angular momentum l are (l/2, l/2), (l + 1)² of them (harmonic polynomials, checked
  against `atom.js`); spin on the left half splits 2(l + 1)² into (l + 1)(l + 2) + l(l + 1).
- A rigid body: M_ab = (j_a + j_b)Ω_ab, dM/dt = [M, Ω] in the body frame, with the energy, tr M² and the
  Pfaffian conserved (checked); integrable (Manakov, 1976). The tile integrates orientation with a
  Cayley step, which stays exactly orthogonal.
- A bond's stabilizer is SO(3): three twist angles. In D₂H₈ each darbon carries four hydrogens.

## What it contains, and whether matter is stable (chapter 1)

The force chapter opens with the universe's inventory:
- **Electrons:** spin-½ fermions, the smallest spinors.
- **Nuclei:** heavy point charges, declared stable for Z ≤ 78. That isn't derived; nuclear radius ∝ A^¼ makes
  heavy nuclei harder to hold than ours.
- **Light:** the lens vacuum's photon, and no other long-range field.
- **Parameters:** a small fine-structure constant, which the non-relativistic solver silently needs.
- **Gravity:** open.

Nothing else is needed: the rest of the Standard Model reaches chemistry only through which nuclei exist and the
electron's mass.

Stability of matter is a theorem in our world, but its proof uses Newton's theorem, so here it's argued instead:
- the solver's energies scale as Z^2.54 (Thomas–Fermi 5/2);
- every neutral–neutral force falls faster than R⁻⁴, so it is integrable in 4D;
- scaling gives fermion matter −N and boson matter −N^(3/2).

## Forces between molecules (chapter 8)

All from one fact: the pinned potential is the 4D transform of 4π²/|k|³.

- **Permanent attraction.** A neutral atom's ρ̃(k) starts at Sk²/8 (S = Σ⟨r²⟩, the cloud's form factor
  1 − k²⟨r²⟩/2d). Two atoms meet through (π²S_AS_B/16)|k|, which transforms to −3S_AS_B/64R⁵. In 3D the same step
  is a contact term, so nothing. The check is two model atoms (a nucleus in a Gaussian cloud) integrated exactly
  as U = (Z²/R)∫(1 − e^(−k²σ²/2))²J₁(kR)dk/k: 1.14× the formula at 8σ, 1.013× at 24σ. At our noble gases'
  spacings, element 12's pull is 14× neon's whole well and element 22's is 7× argon's (measured LJ fits).
- **Dispersion** stays −C₆/R⁶, since the dipole tensor ∂ᵢ∂ⱼ(1/R) is dimension-free. tr T²R⁶ = 4 + (d − 1), so
  London's 3/2 becomes 7/4, checked by diagonalizing two coupled oscillators. **C₆ is computed** by Casimir–Polder,
  C₆ = ((d + 3)/2π)∫α_A(iω)α_B(iω)dω, with α(iω) from the **coupled response** (`tools/response.mjs`):
  - **Method.** A uniform field's potential is r x̂₁, so everything stays in the one harmonic x̂₁. Each orbital's
    distortion into channels l ± 1 (shares (l + d − 2)/(2l + d − 2) and l/(2l + d − 2)) is a complex
    tridiagonal solve, (H − ε ± iω)X = −P(w u₀), on the solver's grid, projected away from occupied orbitals.
    The induced cloud's potential uses the x̂₁ part of the kernel (Funk–Hecke), λ₁ = (4π/3)r</r>² in 3D and
    g₁(min/max)/max in 4D, g₁(τ) = 4π∫cos φ sin²φ dφ/√(1 + τ² − 2τ cos φ). Each electron's own distortion is taken
    out of what it feels, which for helium makes it exactly TDHF.
  - **Bugs fixed on the way.** A dropped minus sign (the cloud pushed with the field) raised helium's α instead of
    lowering it. Whole-matrix QL eigenvalues lose about 10⁻² absolute accuracy with a 10¹³ diagonal, which put 4D
    hydrogen 1% low; Sturm bisection fixes it.
  - **Checks.** Hydrogen exact: 4.5 in 3D, 34.805 in 4D by Dalgarno–Lewis in d dimensions, α = (2/d)[⟨r³⟩/2κ +
    (d + 1)⟨r²⟩/4κ²]. The sum rule ω²α → N. Helium 1.322 (TDHF). Our noble gases: α within 9% and C₆ within 11%
    of measured.
  - **4D results.** Hydrogen α = 34.8 (7.7× ours). Element 2 has α = 9.9 and C₆ = 33.8: soft, so dispersion beats
    its permanent pull out to 9 bohr. From element 12 on (C₆ 13–72), dispersion equals the permanent pull only
    about a bohr out, inside the atoms.
- **Repulsion** is exponential, β = 2√(2I), as in 3D. **Computed** for noble-gas pairs by Gordon–Kim
  (`tools/pairs.mjs`).
  - **Method.** The frozen clouds' electrostatics is exact: each grid point's charge is a thin shell, and ψ is
    evaluated exactly by summing shells, because interpolating ψ broke the Z²/R cancellation. The overlap costs
    t(ρA + ρB) − t(ρA) − t(ρB) of the free electron gas, and gains the same for exchange. In 4D those are
    t = (4π/3)ρ^(3/2) and e_x = −16/(15√π)ρ^(5/4), via ∫J₂²/x² = 4/15π; the same method gives Dirac's 0.7386 in 3D.
    Correlation is left out.
  - **Check in our world, end to end** (computed clouds and computed C₆, Tang–Toennies damped): Ne/Ar/Kr wells
    within 5% in place, and 1.43/1.76/1.77× too deep. So a 4D depth is read as depth/1.8 … depth (`OVERBIND`).
  - **4D.** Wells from element 12 on sit at 4.5–5.25 bohr. Dispersion adds 23–40%, and electrostatics alone is
    deeper than the whole well. By the 0.7 ε/k corresponding-states rule, element 12 boils at 400–730 K and
    element 22 at 1200–2200 K; element 2 stays a gas (43–77 K).
  - **For molecular dynamics.** A e^(−βR) − B/R⁵ is fitted over 3.5–6 bohr and reproduces each no-dispersion well
    within 0.2 bohr and ~20%; add −C₆f₆(βR)/R⁶.
- **Twisting.** Each end's other bonds, projected across the bond, are a regular simplex of the across-space.
  Staggered (inverted through the bond) is the least energy over random SO(3) twists and eclipsed the most;
  the selftest checks 20,000.
- **Salt.** 1/(|k|³/4π² + λ) = 1/λ − |k|³/4π²λ² + …: a −45/(16π⁴λ²r⁷) tail, of the opposite sign. This is argued
  from the Fourier asymptotics, with the constants checked. It isn't integrated: the tail is far too small to
  resolve beside the 1/r it cancels.

## Pxygen and Xater (chapter 9)

- **The solver.** Writing 1/r = (2/√π)∫e^(−t²r²)dt and doing the Gaussian integrals in d dimensions leaves
  G_n(T) = ∫₀¹ u²ⁿ(1 − u²)^((d−3)/2) e^(−Tu²) du where 3D has Boys's F_n, with the same dG_n/dT = −G_{n+1}, so the
  Hermite (E) and R recursions carry over unchanged. Prefactors: nuclear (2/√π)(π/p)^(d/2)√p, electron pair
  (2/√π)(π²/pq)^(d/2)√(pq/(p + q)). G_n by 64-point Gauss–Legendre in u = sin φ (T < 40), else on [0, 9/√T].
  In 4D, G₀(T) = (π/4)e^(−T/2)[I₀(T/2) + I₁(T/2)], which the selftest checks.
- **Checks.** Hydrogen exact (−1/2, −2/9, and 4D's 2p at −2/25 from p functions alone). Helium at the 3D
  Hartree–Fock limit, and in 4D equal to `atom.js`'s helium to 10⁻⁶ (for two electrons the radial solver *is*
  Hartree–Fock). A 4D H₂ with p and d functions gives the same energy along an axis and along a diagonal. Our water
  at the big basis: 1.778 bohr, 106.3°, dipole 0.77 (Hartree–Fock limit 1.776, 106.3°, 0.78); its dimer 5.73 bohr
  and 4.3 kcal/mol, counterpoise-corrected, at the small basis (limit about 3.6).
- **Bases.** Even-tempered, the same recipe in both worlds, exponents lower in 4D (its atoms are bigger). The 4D
  angle is basis-sensitive (the bend is soft): 123° at the small basis, about 120° at the big one (f on Pxygen, d on
  hydrogen), and adding functions past that moved it under a degree.
- **Bugs fixed on the way.** In the shell-pair batches, a quartet of a shell pair with itself counted its
  off-diagonal component pairs twice; caught by the Schwarz inequality failing. The minimizer's step clamp first
  stopped 4D's bond 0.02 bohr short; now it shrinks its grid only after an unclamped step.
- **Results.** Pxygen (1s² 2s² 2p⁶ of 8) has Hund's state 4↑2↓ as its ground. Xater is bent at 119.7° (not
  sp⁴'s 104.48°), its bonds 2.79 bohr, its dipole 1.64 (2.1× water's), straightening it 0.21 eV (water 1.42). Its top
  orbital is two-fold: the two 2p orbitals across the molecule's plane, a ring of lone-pair charge (turns in that
  plane are symmetries). The hydrogen-bonded pair, minimized over the X–X distance and the acceptor's tilt, binds
  3.1× water's at the same level (13.3 against 4.3 kcal/mol), and short: Pxygen to Pxygen 6.51 bohr, the shared
  hydrogen 1.3× as far from its neighbour as from its own (water 2.2×). A first guess of 8 bohr sat on the tail;
  a scan at the minimum's tilt confirms 6.5. 4D hydrogen's 6.05 eV against Pxygen's 13.1 is why: the bond is lopsided.

## Which water (chapter 10)

- **Counting.** An outer shell of d + 1 orbitals with v electrons makes v bonds up to d + 1, then 2(d + 1) − v bonds
  with v − (d + 1) lone pairs. Each hydride gets the symmetric shape: a simplex (all bonds), a pyramid tilted α from
  its axis, bent at θ, or straight. R and the angle are minimized (the step-held quadratic fits of
  `tools/molecules.mjs`, now with a `maxPass`), then three random 0.08-bohr nudges of every hydrogen must each raise
  the energy by more than −1e-5 (the minimizer's own leftover slope).
- **Basis rule.** The recipe that gave Xater and our water, as a rule: s from 0.1·I to 75Z², p from 0.12·I to
  0.15Z², one d at 1.25·I (4D; 3D 0.26·I, 280Z², 0.33·I, 0.57Z², 2.6·I), even-tempered at 2.5. It reproduces water's
  pair to 3e-6.
- **Results.** Hydrogen is positive in every 4D hydride but mithium's and todium's (Mulliken). Row 2's XH₄
  (element 8) is flat (α = 90°, no dipole; its lone pair a bare p across the slice); row 3's is a pyramid (67°).
  Pairs for every protic hydride with lone pairs (element 18's, 196 functions, is past `PAIR_MAX`). The network's
  pull, min(H, lone pairs) × one bond, orders our three as their boiling points (water 8.7, HF 4.1, ammonia 2.1
  kcal/mol) and puts element 9's XH₃ (27.5) and Xater (26.6) level at the top, ~3× water; then elements 20 and 19
  (~17), element 8 (10.8, one bond), 11 (7.6) and 21 (4.1, its big atom keeps the hydrogen 6.5 bohr off: a scan
  confirmed it is repulsive at 7.5 bohr in every tilt).
- **Fixes on the way.** Mithium hydride's 4.9-bohr bond used all 12 passes reaching it from 2.8 (now: start from the
  outer orbital's radius plus hydrogen's share); a not-a-bowl fit with zero slope stayed put (now steps onward).
  A background run dies when the sandbox reclaims an idle container, hence the cache.

## What it leaves out

Correlation (in the atom solver, and in the molecules, where Hartree–Fock misses about a third of a bond's
energy), non-spherical open shells (the response assumes closed shells: open-shell atoms like Pxygen, element 10,
are next), relativity (it matters past Z ≈ 50), and spin–orbit in the solver. Spin is two states per orbital
(chapter 3 says why). Subshells are limited to l ≤ 3, n ≤ 8, which is enough up to Z = 78. Open questions,
as on the landing: open-shell response, which nuclei exist, gravity (it has to be pinned too), correlation, spin-statistics without full relativity, and which water fills the oceans.
