FewBodyECG.jl
FewBodyECG.jl builds variational explicitly correlated Gaussian bases for few-body quantum systems. You define particles and pair interactions with Operators, choose a solver method, and get back a Solution with energies, coefficients, convergence information, and plotting recipes.
Installation
import Pkg
Pkg.add("FewBodyECG")Quick Start
using FewBodyECG
import Antique
using Plots
H = Operators([1.0e15, 1.0], [+1.0, -1.0])
H += "Kinetic"
H += "Coulomb"
sol = solve(H, DynamicGVM(basis = 10, candidates = 20, scale = 1.0))
exact = Antique.E(Antique.HydrogenAtom(Z = 1), n = 1)
println("E0 = ", sol.E₀, " Ha (Antique ", exact, ", Δ = ", sol.E₀ - exact, ")")
solFewBodyECG solution — 10 × Rank0Gaussian, 2 operator terms
method DynamicGVM(10)
E₀ -0.49999933 Ha (variational upper bound)
convergence ConvergenceReport: ✓ stationary |∇E| = 8.1e-7 (gtol 1.0e-6)
note: stationary point of the parameter optimisation; the variational upper bound still applies
conditioning cond(S) ≈ 1.1e7 — handled (whitened eigensolver)Custom numerical potentials
Define a radial pair potential as a scalar callable. The matrix elements are reduced analytically to a one-dimensional radial integral, and QuadGK is used internally by NumericalPotential:
using FewBodyECG
ops = Operators([1.0e15, 1.0])
ops += "Kinetic"
f(r) = -exp(-r^2) / (1 + r^2)
ops += (f, numerical, 1, 2)
sol = solve(ops, SVM(basis = 8, candidates = 2, scale = 1.0))
println(sol.E₀)0.030820467929054202The callable receives the nonnegative pair distance r; users do not need to call QuadGK or construct matrix elements manually. For a precomputed Jacobi weight vector w, the equivalent low-level form is NumericalPotential(f, w).