jaxrens.backends.base¶
EnergyBackend protocol — unified interface for all energy backends.
Every backend is a callable that computes potential energy from an atomic
configuration and returns a BackendResult pytree:
backend(positions, species, cell, max_neighbors) -> BackendResult
max_neighbors is a static parameter passed per call (not stored on the
instance). JAX’s compilation cache handles retrace when it changes.
Backends may optionally implement energy_and_forces (same signature) to
return forces natively; callers should go through eval_energy_and_forces(),
which dispatches to the native method when present and otherwise falls back to
reverse-mode autodiff of __call__.
Additive corrections (soft core, ensemble P·V − μ·N) are not wrappers
around a backend; they are EnergyTerm
instances composed with a bare model in a flat
Hamiltonian.
Design doc: experiments/jaxrens_design/energy_backend_design.md
Functions
Committee (ensemble) uncertainty from a |
|
Evaluate energy and forces, using a native force path when available. |
|
The ensemble committee model behind |
Classes
Structured return value of every |
|
Protocol that all energy backends must satisfy. |