Bethe ansatz solvers¶
C++23 tools and a scalar-templated library for finite-system and thermodynamic Bethe ansatz calculations, complementing Uni20 and the Matrix Product Toolkit.
Documentation and tutorials · Supported models · Build and install
Calculate ground states, selected excitation families, dispersions, continuum edges and supported spectral weights. The model guides state which boundaries, sectors and root families each calculation covers.
High precision is a first-class feature: fp64 by default, platform-native
long-double, fp80 where extended80 is native, optional fp128
(binary128, about 34 decimal digits), and explicit arbitrary precision
through MPFR/MPC in every numerical frontend. Run bethe-info to see what your
build provides. Precision controls
explain how arithmetic precision differs from numerical convergence.
First calculation¶
After building or installing, put the programs on PATH
and compare periodic and free-end four-site Heisenberg chains:
bethe-xxx-pbc 4
bethe-xxx-obc 4
The periodic chain has total energy \(E=-2\) for spin-\(1/2\) operators and \(J=1\). The reports include energy per site, convergence diagnostics and CPU time. The first-calculation guide explains these quantities, boundaries, quantum numbers, precision and exports.
Without PATH setup, use ./bethe-xxx-pbc from the build directory.
Python is only needed for the optional plotting and maintenance scripts.
Choose a route¶
- Run calculations: first steps, choose a supported model, then save and plot results.
- Compare with MPS or iMPS: start with a plotted tutorial. Each explains energy/momentum conventions and the physical contribution being calculated.
- Use C++: embed
bethe::bethe, use the synchronous APIs in the model guides, then compose independent work with Async where useful.
Tutorials with plots¶
- XXZ spinons and continua: gapless/gapped chains and two-site iMPS momentum conventions.
- Hubbard at half filling and away from half filling: spin/charge lines and the choice of energy zero.
- XXX spectral weights: finite-ring two-spinon intensities, sum rules and broadening.
- Four-spinon thermodynamic intensity: physical sector sums, separate order/cutoff checks and measured cost.
- Six-spinon sampling and the 2/4/6 comparison: higher-sector spectra with separate sampling, precision and soft-domain checks.
- Why high precision matters: small energy scales, stable formulas and arbitrary precision.
The full tutorial collection includes source data, plotting scripts and examples for every implemented model family.
Theory, development and attribution¶
Jean-Sébastien Caux's The Bethe Ansatz is a pedagogical companion for the underlying theory. CITATIONS.md lists the literature used by the implementation; the model roadmap surveys possible extensions.
include/bethe/ contains the library, apps/ the command-line frontends, and
tests/ the regression suite. Numerical code is separate from presentation
and any future Python bindings.
Bethe succeeds MPToolkit's misc/heisenberg-energy.cpp and retains
GPL-3.0-or-later licensing and attribution. See COPYING,
references and provenance, and the
redistributable paper archive.