JaxMDBackend

class jaxrens.backends.jaxmd.JaxMDBackend(energy_fn, r_cutoff, atomic_numbers, potential, periodic)[source]

Bases: object

jax-md energy backend (all-pairs variants).

Satisfies the EnergyBackend protocol via duck typing. Returns (energy, 0, False) for the count/overflow slots because all-pairs computation has no neighbor-buffer dimension.

Parameters:
  • energy_fn (Any) – A jax-md energy function built by energy.tersoff / energy.eam over a displacement function from space.periodic_general or space.free. Must accept new_box=cell for periodic systems.

  • r_cutoff (float) – Interaction cutoff (Å) — for periodic builds, used by the resolver to validate supercell sizing.

  • atomic_numbers (tuple[int, ...]) – Single-element tuple (Z,) the model was parameterised for. Tersoff/EAM in jax-md are single-species in the all-pairs path.

  • potential (str) – "tersoff" or "eam" — informational tag, used in logging and the repr.

  • periodic (bool) – Whether the displacement function was built with space.periodic_general (True) or space.free() (False).

property atomic_numbers: tuple[int, ...]

Atomic numbers (Z) the model was parameterised for.

Used by the resolver to map user-supplied Z values in start_species to the model’s species indices. Tersoff and EAM (single-element jax-md paths) expose a single Z.