Quarkonium-System

4. N bodies

The few-body solver (src/few) reuses the ideas of the two-body one and almost none of its code, because the natural objects are different: matrices of Gaussian exponents instead of single widths.

Order of construction

  1. Coordinates (jacobi): from masses, an ordering and a tree shape, build the linear map to Jacobi vectors. Test: the kinetic energy comes out diagonal.
  2. One bra–ket pair (cg): everything an operator needs is computed once per pair of Gaussians.
--8<-- "src/few/cg.cpp:kernel"

Then any pair potential is (\langle f\rangle_c) with c_of(w). Fixed-capacity Eigen matrices (at most 4×4) keep the inner loop free of heap allocations.

  1. Colour and spin (colourspin): explicit vectors and Kronecker products. Slower than hand-derived tables, immune to their sign errors. Sum rules check them.
  2. The system (system): generate channel functions and random functions with a fixed seed; build the antisymmetriser over the group of identical particles and apply it to the ket only; drop functions it annihilates; assemble one-dimensional radial averages × spin–colour matrix elements; solve with the same canonical orthogonalisation.
  3. Standard problems (standard): which channels belong to which particle content, in one place, used by the command line, the API and every binding.

A cancellation found by a test

(\langle e^{-\mu r}\rangle_c) has a closed form with two terms that cancel for large (\mu/\sqrt c). The code switches to the stable moment recursion of chapter 1 there.

Cost

Matrices are dense. Size grows as (ranges per coordinate)(^{N-1}) × channels × spin–colour states, the eigensolver as its cube. max_dim refuses requests that would not finish, and the tests with hundreds of correlated Gaussians are labelled heavy and skipped under the sanitizers.

Validation ladder

Harmonic forces with unequal masses (exact), the positronium ion and molecule (known to many digits), (N=2) against the GEM solver, separated clusters giving the threshold, the Pauli principle, published AL1 mesons, and complex scaling on problems where it must do nothing to bound states.