Architecture#
rgmin follows a metatensor-style hourglass: solvers live in
Rust, C sees a small ABI, C++ is a header wrapper.
Layer diagram#
+-----------------------------------------------+
| C++ wrapper |
| include/xts/optimize.hpp |
| include/xts/xtensor.hpp |
+-----------------------------------------------+
| C ABI (cbindgen + hand headers) |
| include/xts.h |
| rgmin_solver_t create/step/free |
| rgmin_minimize over dlpk tensors |
| set_qn_step / set_accept / set_manifold |
+-----------------------------------------------+
| Rust core |
| Solver / Lbfgs / NLCG / BFGS / Newton |
| Manifold (Euclidean, RigidQuotient, MwRigid) |
| Sphere / SO3 / Stiefel / SE3 embeddings |
| LineSearch (Brent, Armijo, Goldstein, Wolfe) |
| eindir DifferentiableObjective |
+-----------------------------------------------+
Objects#
LbfgsPersistent pair history, two-loop recursion, strong Wolfe. Hopping chains hold this type (anneal
WarmLbfgsis a handle).SolverMethod-agnostic session. One
stepis one outer iteration. The C typergmin_solver_tis a pointer to this.minimize_methodCold-start dispatch for every
Method.LineSearch::WolfeNocedal-Wright 3.5 / 3.6. Default production choice for quasi-Newton directions.
OracleClosure adapter that implements
DifferentiableObjectivefor a fused(f, g)function.ecnoiseMoré–Wild difference table for the noise in an energy or in one projection of the gradient, plus the 2012 forward and gradient steps (Algorithm 5.1, not the noise table). One uniform projection has variance
tr(Σ) / n.Control::noise_floorstops atc * sqrt(n_free) * eps_gwithStatus::NoiseFloor, after thegtoltest. The same stop fires when a line search finds no trial whose decrease clearsc * eps_f.rgmin_solver_create/rgmin_solver_step/rgmin_solver_freeStateful C waist. Callbacks are per step.
abi_major1,abi_minor9,layout_revision2. Compatibility checks major and layout only.ManifoldKindEmbedded geometry. Euclidean is the identity. Sphere, SO(3), Stiefel
St(n,1), and SE(3) implementproject/retract/transport.rgmin_minimizeFirst-order / quasi-Newton C entry. CPU f64 tensors only; other devices return
RGMIN_UNSUPPORTED_DEVICE.rgmin_minimize_hessNewton / RFO C entry. Caller supplies a dense row-major Hessian. This is a different solver, not an L-BFGS option.
Solver::set_precon/rgmin_solver_set_preconExp, Lindh, the bonded metric, or
select_precon. ABI minor 32.rgmin_solver_set_quickmin_variantQuick-min options from C:
RGMIN_QUICKMIN_RGMIN,RGMIN_QUICKMIN_EON,RGMIN_QUICKMIN_PER_ATOM. ABI minor 33.rgmin_solver_precon_scaleisμafter the sine probe.select_preconL-BFGS and CG: Exp at 100 atoms for bulk, surface, and a metal cluster (ASE
PreconLBFGS). Lindh for a covalent molecule or cluster up toN_LINDH. Bonded metric when that caller has a force field and every element is covalent. FIRE auto is the identity.
C kind |
Rust |
role |
|---|---|---|
|
|
|
|
|
model Hessian, same solve |
|
|
bonded metric, harmonic terms on the C struct |
|
|
the session method plus the how-to table |
|
|
drop the metric |
What does not live here#
Simulated annealing, basin hopping, and catalogue logic stay in anneal.
Objective algebra stays in eindir.
Sketch-map style collective variables stay in landfold.