EnergyBackend¶
- class jaxrens.backends.base.EnergyBackend(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol that all energy backends must satisfy.
Backends are callable objects that compute potential energy from an atomic configuration. Model weights live on the instance — no
paramsargument in the call.max_neighborscontrols compiled array shapes: - NeuralIL: lexsort truncation in descriptor computation - GNN backends: edge buffer sizemax_edges = N * max_neighbors- Toy/LJ: ignored (no neighbors)Implementations must be compatible with jax.jit and jax.vmap.
Optional capability (not part of the required protocol): a backend may define
energy_and_forces(positions, species, cell, max_neighbors, ensemble_params=None) -> BackendResultwithforcespopulated. Callers should useeval_energy_and_forces()rather than probing for it.