Bayesian Variational Method
The Bayesian Variational Method (BVM) constructs a compact Rayleigh-Ritz ansatz by selecting groups of functions from a finite candidate basis. A Gaussian-process surrogate predicts the energy obtained by adding each group, and a lower-confidence-bound acquisition rule balances low predicted energy against uncertain candidates.
The posterior uncertainty belongs to the search surrogate. It is not an error bar on the returned energy or wavefunction.
Usage
using TwoBody
H = Hamiltonian(
Kinetic(hbar=1, m=1),
Coulomb(coefficient=-1),
)
geometric = GeometricBasisSet(GaussianBasis, 0.15, 8.0, 8)
candidates = BasisSet(geometric.basis...)
method = BVM(
max_basis=6,
pool_size=8,
tuple_size=2,
initial_samples=3,
batch_size=2,
rounds=1,
search_size=10,
)
result = solve(H, candidates, method)
(energy=result.E[1], selected=result.selected_indices,
evaluations=result.n_evaluations)(energy = -0.4992680615528713, selected = [5, 8, 3, 6, 1, 4], evaluations = 15)history records every exact tuple evaluation and the GP prediction attached to each evaluated GP proposal. Supplying an explicit RNG gives reproducible searches.
The initial implementation uses dense diagonalization and does not yet include continuous candidate generation, incremental diagonalization, or trimming.
API reference
TwoBody.BayesianVariationalMethod — Type
BayesianVariationalMethod(; max_basis, pool_size=100, tuple_size=3,
initial_samples=100, batch_size=50, rounds=4,
search_size=10_000, beta=2.0, abstol=1e-8,
patience=3, overlap_tol=1e-10)Configure Bayesian selection of fixed-size groups from a finite candidate basis. max_basis limits the accepted basis dimension; pool_size is the temporary candidate pool; tuple_size is the number of functions adopted per outer step; initial_samples, batch_size, rounds, and search_size control the Gaussian-process search budget; and beta weighs posterior uncertainty in the lower-confidence-bound acquisition. abstol is an absolute energy improvement in the Hamiltonian's units, patience counts consecutive negligible steps, and overlap_tol rejects nearly linearly dependent subsets.
TwoBody.solve — Method
solve(
hamiltonian::Hamiltonian,
candidates::BasisSet,
method::BayesianVariationalMethod;
rng=Random.MersenneTwister(123),
perturbation=Hamiltonian(),
info=4,
)Select groups of basis functions from the finite candidate BasisSet with a Tanimoto-kernel Gaussian-process surrogate, then solve the accepted basis with the Rayleigh-Ritz method. Candidate energy evaluations are deterministic; the Bayesian uncertainty describes the discrete search surrogate, not uncertainty in the returned physical energy.
The result is a ResultRayleighRitz with additional method, candidate_basisset, selected_indices, history, n_evaluations, and n_rejected properties. Supply an explicit RNG for reproducibility.