Skip to content

Commit

Permalink
Add support for gas phase simulations using sire-emle.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed May 20, 2024
1 parent 403e8e2 commit f7a9fa4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions emle/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,14 @@ def _sire_callback(self, atomic_numbers, charges_mm, xyz_qm, xyz_mm):
E_vac += delta_E
grad_vac += delta_grad

# If there are no point charges, then just return the in vacuo energy and forces.
if len(charges_mm) == 0:
return (
E_vac.item() * _HARTREE_TO_KJ_MOL,
(-grad_vac * _HARTREE_TO_KJ_MOL * _NANOMETER_TO_BOHR).tolist(),
[],
)

# Convert units.
xyz_qm_bohr = xyz_qm * _ANGSTROM_TO_BOHR
xyz_mm_bohr = xyz_mm * _ANGSTROM_TO_BOHR
Expand Down

0 comments on commit f7a9fa4

Please sign in to comment.