xnn.common.benchmark.energy.build_e0_lookup#

xnn.common.benchmark.energy.build_e0_lookup(atomic_energies, species=None, dataset=None)[source]#

Build a Z-indexed E0 lookup tensor from a configured value.

Parameters:
  • atomic_energies (Any) – The configured reference energies. None disables subtraction (returns None). "average" / "mean" fits E0s from dataset. Otherwise a {Z: E0} / {symbol: E0} dict, a list aligned with species, a single number, or the string form of any of these (parsed by coerce_per_species()).

  • species (Any, optional) – Atomic numbers or chemical symbols the values are aligned with, needed only for the list / scalar forms (a dict carries its own species).

  • dataset (AtomicDataset or torch.utils.data.Subset or None, optional) – Benchmark dataset used to fit E0s when atomic_energies is "average".

Returns:

A lookup tensor of length MAX_Z, or None when subtraction is disabled.

Return type:

torch.Tensor or None

Raises:

ValueError – If "average" is requested without a dataset, or a list/scalar form is given without species.