EnergyBackend

class jaxrens.backends.base.EnergyBackend(*args, **kwargs)[source]

Bases: Protocol

Protocol 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 params argument in the call.

max_neighbors controls compiled array shapes: - NeuralIL: lexsort truncation in descriptor computation - GNN backends: edge buffer size max_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) -> BackendResult with forces populated. Callers should use eval_energy_and_forces() rather than probing for it.