diff --git a/emle/calculator.py b/emle/calculator.py index 19ba699..2649bfa 100644 --- a/emle/calculator.py +++ b/emle/calculator.py @@ -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: @@ -2176,7 +2176,6 @@ def _get_mu_ind(self, r_data, mesh_data, q, s, q_val, k_Z): ).flatten() mu_ind = _torch.linalg.solve(A, fields) - E_ind = mu_ind @ fields * 0.5 return mu_ind.reshape((-1, 3)) def _get_A_thole(self, r_data, s, q_val, k_Z):