Hamiltonian¶
- class jaxrens.backends.hamiltonian.Hamiltonian(model, terms=())[source]¶
Bases:
objectEnergy model plus additive terms; satisfies the EnergyBackend protocol.
- Parameters:
model (EnergyBackend) – The bare energy backend. If a
Hamiltonianis passed, it is flattened: its model is used and its terms are prepended toterms, so composition never nests.terms (Sequence[EnergyTerm]) – Additive
EnergyTerminstances, summed in order after the model energy.
- with_terms(*terms)[source]¶
Return a new Hamiltonian with
termsappended.- Parameters:
terms (EnergyTerm)
- Return type:
- energy_and_forces(positions, species, cell, max_neighbors, ensemble_params=None)[source]¶
Per-layer energies and forces, summed.
The model goes through
eval_energy_and_forces()(native force path when available, autodiff of the model alone otherwise); each term contributes its ownEnergyTerm.energy_and_forces().- Parameters:
- Return type: