Real-time plasma confinement stability in a single binary. 343 tests. Seven physics modules. Tokamaks + stellarators. Under 6 milliseconds. Now on PyPI.
Today I'm releasing CHIHIRO v2.0 — Confinement Hierarchy via Invariant Harmonic Instability Recognition Operator. She's a real-time plasma confinement stability monitor built on the Davis Field Equations. Single Rust binary. 321 unit tests + 22 integration tests. Built-in interactive dashboard. Reads your EFIT files. Runs in your Jupyter notebook. Under 6 milliseconds per diagnostic. Now available on PyPI: pip install chihiro.
v2.0 ships with seven physics modules: CHT ballooning with Cheeger constants, DCON external kink (confirming C_kink = 1/(2π)), NT ELM-free regime detection, spherical tokamak corrections, spectral Greenwald density limits, 100 Hz continuous monitoring with time-to-boundary prediction, full 3D/stellarator support with RMP suppression scans, and ML interpretability with two-alarm arbitration.
She replaces five codes with one equation — and now she handles tokamaks and stellarators both.
Every tokamak control room runs a patchwork. EFIT reconstructs the equilibrium. MISHKA checks ballooning. DCON checks kink modes. ELITE checks the edge. GATO does the comprehensive analysis. Each takes minutes to hours. Each needs different inputs. None talk to each other in real time.
When a disruption is 50 milliseconds away, your five-code pipeline hasn't finished its first eigenvalue.
She computes the spectral gap λ₁ of the Connor-Hastie-Taylor ballooning operator at every flux surface and returns a traffic light. GREEN means stable. YELLOW means watch it. RED means mitigate now.
The math: 4,250 eigenvalue problems solved via Sturm bisection on a tridiagonal matrix. O(N_θ) per eigenvalue instead of O(N_θ³) for dense QR. That's a 2,000× algorithmic speedup, which is how a single laptop outperforms the HPC cluster running GATO.
One number summarizes everything: the disruption proximity metric $\mathcal{D} = 1 - C_{\min}/C_{\text{crit}}$. It tells the operator how much margin remains before the stability boundary, with rate-of-approach $d\mathcal{D}/dt$ giving advance warning. No mode numbers to interpret. No eigenvalue spectra to read. One number, one traffic light.
The CHIHIRO interactive dashboard showing real-time plasma cross-section, s-α stability diagram, and traffic light status.
Click any card to see detailed physics, equations, parameters, and API documentation.
Ballooning + kink + ELM + density + 3D + ML + continuous. Seven modules unified. One binding constraint. One traffic light.
Riccati/Δ' solver. C_kink = 1/(2π), CoV 2.4% across 47 databases. Troyon coefficient from topology.
δ_crit formula validated against TCV, DIII-D, MAST-U (<0.3% error). Automatic ELM-free regime flagging.
High-ε geometry corrections for ε~0.3–0.6. MAST-U, ST40, STEP, SMART presets. C_max enhancement.
Ring-buffer Welford regression. Time-to-boundary prediction. Hysteretic alarm states. chihiro watch for control rooms.
VmecEquilibrium struct, W7-X (n_fp=5) presets, Mercier criterion, full (s,α) stability maps, RMP suppression scans.
Physics-derived n_crit from transport eigenvalue crossing. C/W/N/Be impurity tables. MARFE location prediction.
Binding constraint + urgency + action. Two-alarm arbitration between physics and ML. Confidence scoring.
ITER, DIII-D, W7-X, MAST-U, SPARC, TCV, ST40, STEP, SMART. Tokamaks + spherical + stellarators.
pip install chihiro — diagnose(), from_geqdsk(), sweep_delta(), explain_with_ml(). Full type stubs.
React 18 served from the Rust binary. No npm. No node_modules. Animated tokamak with real-time particle simulation.
Six JSON endpoints with CORS: /api/diagnose, /api/combined, /api/sweep, /api/compare, /api/devices, plus dashboard.
pip install chihiro import chihiro result = chihiro.from_params(kappa=1.7, delta=0.33).diagnose(beta_n=1.8) print(result.status) # → GREEN | YELLOW | RED
Or from a G-EQDSK file:
eq = chihiro.load_geqdsk("shot.geqdsk") result = eq.diagnose(beta_n=2.1) print(result.c_max, result.cheeger_cut) # → 4.07, 0.55
Combined seven-module stability:
chihiro combined --device ITER --beta-n 1.8 --n-bar 0.8
Real-time 100 Hz monitoring:
chihiro watch --dir /path/to/efit --rate 100
Or serve the dashboard:
chihiro serve --port 3000
Fine Tune mode: full parameter controls for exploring the stability landscape.
22 integration tests across 7 devices (ITER, DIII-D, MAST-U, TCV, EAST, WEST, W7-X). 321 unit tests. 1 proved theorem. 2 documented failures kept as lessons. 343 total tests — all passing.
The central discovery: at β_N = 0.01, the Suydam local stability criterion is violated at 100% of the plasma radius. Every surface fails the local test. But the global CHT eigenvalue is positive — the plasma is Type I stable. Toroidal coupling provides 15.6× more stability than the cylindrical model predicts. No other code in the fusion stability ecosystem computes the Cheeger constant or detects this effect.
| Code | Speed | What CHIHIRO Adds |
|---|---|---|
| CHIHIRO v2.0 | <6ms | 7 modules unified, stellarators, ML, 100 Hz monitor, PyPI |
| HELENA | Fast | Solves equilibria only, not stability |
| MISHKA | Hours | Mode-by-mode analysis required |
| DCON | Minutes | CHIHIRO's kink module implements Riccati/Δ' in <6ms |
| ELITE | Minutes | Edge only — CHIHIRO sees the whole plasma |
| GATO | Minutes | Requires HPC resources |
| BOUT++ | Days | Simulation code, not real-time diagnostic |
CHIHIRO v2.0 is the only tool that computes a universal confinement invariant (C_max), detects the Cheeger effect (global stability where local criteria fail), proves a theorem about its own output (Plateau Maximum), handles both tokamaks and stellarators, provides ML-physics arbitration, and runs in real time (<6ms). Everything else is mode-by-mode or machine-specific.
CHIHIRO is one product in the Davis Geometry Lab, which applies $C = \tau/K$ across domains:
HERALD, GEODESIC, and TESSERA are live at parallax.sh — viral surveillance, multi-cancer detection, and antimicrobial resistance monitoring. PSYCHOHISTORY (geopolitical conflict prediction, F1=0.73, Russia-Ukraine 72 days early) is live at helicity.io#exp. HELICITY (financial market risk detection) is live at helicity.io.
Nine domains. One law. 25 patents. Six products shipping. The spectral gap doesn't care whether it's measuring plasma stability, viral evolution, or the HOMO-LUMO gap of a twisted molecule. It measures the distance to the nearest phase transition on the manifold.
Real-time stability analysis across the full β_N sweep range.
This work is dedicated to Professor Nuno Loureiro, Director of the MIT Plasma Science and Fusion Center, who was taken from us on December 15, 2025 at the age of 47.
I never had the privilege of meeting him. But I read everything he wrote. His work on magnetic reconnection, turbulence in magnetized plasmas, and the mathematical foundations of plasma confinement shaped how I think about every problem in this field. When I was building the spectral geometry framework that became CHIHIRO, it was his papers I returned to again and again — his clarity, his rigor, his insistence that the mathematics must be honest.
I had hoped that one day this work might reach his desk. That he might see the Cheeger effect, the Plateau Maximum, the 1/(2π) in the Troyon limit, and recognize in them the same geometric structure he spent his career illuminating. That conversation will never happen now.
The fusion community lost one of its finest minds. I lost the collaborator I never got to have. Rest in peace, Professor Loureiro. The spectral gap remembers what we build.
GEOMETRIC INTELLIGENCE SERIES · BOOK 6
The equation C = τ/K that powers CHIHIRO comes from this book. Five Millennium Prize problems are one problem in five languages. One law governs them all.
Curvature is obstruction. The same geometry that prevents a superfluid from nucleating vortices is the same geometry that keeps plasma stable. Zero coefficient of variation. The universality is exact.
Read on Amazon →pip install chihiro
Paper: "The Spectral Geometry of Plasma Confinement" — DOI 10.5281/zenodo.18883834
Patent: U.S. Provisional Application filed March 2026