Skip to content

Commit

Permalink
Merge pull request #24 from chemle/fix_23
Browse files Browse the repository at this point in the history
Fix issue #23
  • Loading branch information
lohedges authored Jul 31, 2024
2 parents c2ecaa3 + f4ab339 commit 9acbca4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions 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 Expand Up @@ -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):
Expand Down

0 comments on commit 9acbca4

Please sign in to comment.