Exact diagrammatic calculus for spectroscopy — the Origami ISA for angular momentum recoupling
Project description
spectrafold
Exact diagrammatic calculus for spectroscopy.
The colours of fireworks, computed exactly.
Spectrafold implements the Origami ISA — five opcodes (FLIP, FLOP, SPLIT, SPLAT, TWIST) that form a universal, compositional language for angular momentum recoupling. Every result is an exact sympy expression. No floats, no rounding errors, no guessing whether a near-zero is actually zero.
from spectrafold import flop, flip
# The 6j symbol at the heart of the Pandya theorem (exact rational)
flop(0, 1, 1, 1, 1, 1)
# → -1/3
# Prove that V^{2pi,SW} is orthogonal to the octonion associator
from spectrafold.spectroscopy.analysis import associator_projection
cos_AB = associator_projection()
# → 0 (exact — not 1.4e-16)
Why exact arithmetic matters
Legacy spectroscopy codes (NuShellX, Cowan's Fortran) use floating-point arithmetic in alternating Racah summation loops. Catastrophic cancellation is common. Spectrafold uses sympy throughout: it can prove things rather than compute things.
The difference matters. When we computed the Frobenius inner product of the Illinois-7 three-nucleon force with the octonion-associator operator, the answer was exactly zero — not 1.4e-16. That zero is a theorem, not a measurement.
The five opcodes
| Opcode | Operation | Physical meaning |
|---|---|---|
flip(j) |
Evaluation map (cap) | Particle → hole conjugation; Pandya sign |
flop(j1,j2,j12,j3,j,j23) |
Wigner 6j F-move | Recoupling cost; E1/M1 selection rules |
split(j) |
Frobenius unit | Pair creation; quantum dimension √(2j+1) |
splat(j) |
Frobenius counit | Pair annihilation; bubble closure |
twist(j) |
Ribbon element | Spin-orbit phase; spin-statistics |
These are the Pachner moves of the 3-simplex. The Pentagon identity (five FLOPs compose to the identity) is Mac Lane's coherence theorem — the assertion that the Origami calculus is self-consistent.
Validated results
All results verified against published experimental data:
| Experiment | Result | Reference |
|---|---|---|
flop(0,1,1,1,1,1) = -1/3 |
X(3872)→J/ψγ amplitude | PDG 2024 |
g2_casimir(1,0) = 4 |
G₂ wall at 1g₉/₂ shell | ENSDF ⁹²Mo |
twist_eigenvalue(1) - twist_eigenvalue(0) = 1 |
J/ψ–η_c hyperfine Δ_TWIST | PDG 2024 |
associator_projection() = 0 |
3NF is purely SU(2)-Jacobi | Pieper et al. 2001 |
pandya_transform(...) |
Pandya theorem (exact) | Pandya 1956 |
Installation
pip install spectrafold
Requires Python ≥ 3.10 and sympy ≥ 1.12 (the only mandatory dependency).
For numerical applications:
pip install spectrafold[numerics] # adds numpy, scipy
pip install spectrafold[viz] # adds matplotlib
The regime taxonomy
Spectrafold classifies physical systems by their categorical structure:
- Regime 1 — strictly associative (qubit ZX calculus; F-moves = ±1)
- Regime 2 — associative-up-to-coherent-isomorphism (F-moves = 6j symbols; all standard spectroscopy lives here)
- Regime 3 — genuinely non-associative (Pentagon defect ≠ 0; the frog vertex; no physical system has been confirmed here yet)
The G₂ wall is the boundary within Regime 2 where the standard SU(2)/SU(4) seniority labelling overflows and the G₂ Casimir provides the missing label. It is physically observable as an energy splitting (δC₂ = 1 in ⁹²Mo).
Papers
The Origami ISA is developed in the following papers (all open access on Zenodo):
| Paper | Title | DOI |
|---|---|---|
| 347 | Spiders for Spectra | 10.5281/zenodo.20458996 |
| 348 | Spiders for Nuclei | 10.5281/zenodo.20490046 |
| 349 | The Origami Calculus | 10.5281/zenodo.20474914 |
| 350 | Spiders for Quarkonium | 10.5281/zenodo.20490294 |
Structure
spectrafold/
├── core/ # The five Origami ISA opcodes (flip, flop, split, splat, twist)
├── spectroscopy/ # Racah algebra: Pandya, G2 wall, seniority, 3NF analysis
└── molecular/ # IBM Vibron model, FMO exciton, Fermi resonance
Relation to racah
The roguetrainer/racah repository contains the spectroscopy-specialised layer. The Origami engine in spectrafold/core/ is the general foundation; racah is one instantiation of it. Future instantiations (financial gauge theory, loop quantum gravity) will share the same core opcodes.
License
MIT. See LICENSE.
Author
Ian R. C. Buckley — ian.r.c.buckley@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spectrafold-0.1.0.tar.gz.
File metadata
- Download URL: spectrafold-0.1.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc4ad1c9dc66878033eb2956bdd76b9756d443789045a09929dce2184fcf41e2
|
|
| MD5 |
2ae90e588b0abe093257abc7e6bf7124
|
|
| BLAKE2b-256 |
fb2a02f61eb3bec57090a6620347c6e6da8e7dd50b109fdfd2d870d9c68239e7
|
File details
Details for the file spectrafold-0.1.0-py3-none-any.whl.
File metadata
- Download URL: spectrafold-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f5fbdf035f79965c989628ddbd34c5a5589c9a35c7d8014b432701f009a706e
|
|
| MD5 |
78f0b35138864d8b659eda0971113b2d
|
|
| BLAKE2b-256 |
8710205353d0d9700f5efe68348bb9f74578cd01ddc6b9db4ac0d9fa2f230b36
|