TwoBody.jl is a Julia package for solving quantum-mechanical two-body problems. It provides a flexible framework for constructing two-body Hamiltonians and solving the corresponding Schrödinger equation using a variety of numerical methods. It covers approaches ranging from basis-set and grid methods to tensor-network, stochastic, and neural-network methods. Beyond serving as a proof of concept for FewBody.jl, TwoBody.jl is designed to support practical, cross-scale calculations of quantum two-body systems, from hadrons to molecules.
Run the following command in the Julia REPL or a notebook:
import Pkg; Pkg.add("TwoBody")After installation, load the package and verify it works:
using TwoBody
H = Hamiltonian(
Kinetic(hbar = 1, m = 1),
Coulomb(coefficient = -1),
)
BS = BasisSet(
SimpleGaussianBasis(13.00773),
SimpleGaussianBasis(1.962079),
SimpleGaussianBasis(0.444529),
SimpleGaussianBasis(0.1219492),
)
solve(H, BS)QTT and variational-neural-network solvers are optional. Load TensorTrainNumerics.jl to activate QTT support, or load Lux.jl, Optimisers.jl, and Zygote.jl to activate VNN support. These packages are not installed with the TwoBody.jl core.
- Home: https://juliafewbody.github.io/TwoBody.jl
- User Guide:
- Developer Guide: https://juliafewbody.github.io/TwoBody.jl/dev/developer
- API Reference: https://juliafewbody.github.io/TwoBody.jl/dev/api