Skip to content

Commit

Permalink
Don't compute induced dipoles unless necessary. [closes #23]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jul 31, 2024
1 parent c2ecaa3 commit 2515ab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emle/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2051,13 +2051,13 @@ def _get_E_components(self, charges_mm, xyz_qm_bohr, xyz_mm_bohr, s, chi):
q_val = _torch.zeros_like(q_core, dtype=_torch.float32, device=self._device)
else:
q_val = _torch.zeros_like(q_core, dtype=_torch.float32, device=self._device)
mu_ind = self._get_mu_ind(r_data, mesh_data, charges_mm, s, q_val, k_Z)
vpot_q_core = self._get_vpot_q(q_core, mesh_data["T0_mesh"])
vpot_q_val = self._get_vpot_q(q_val, mesh_data["T0_mesh_slater"])
vpot_static = vpot_q_core + vpot_q_val
E_static = _torch.sum(vpot_static @ charges_mm)

if self._method == "electrostatic":
mu_ind = self._get_mu_ind(r_data, mesh_data, charges_mm, s, q_val, k_Z)
vpot_ind = self._get_vpot_mu(mu_ind, mesh_data["T1_mesh"])
E_ind = _torch.sum(vpot_ind @ charges_mm) * 0.5
else:
Expand Down

0 comments on commit 2515ab6

Please sign in to comment.