Skip to content

Commit

Permalink
fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-lin1027 committed Mar 18, 2024
1 parent 5121cee commit 474dc56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions anisoap/representations/radial_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ def compute_gaussian_parameters(self, r_ij, lengths, rotation_matrix):
center = r_ij
diag = np.diag(1 / lengths**2)
precision = rotation_matrix @ diag @ rotation_matrix.T

return precision, center
constant = 1
return precision, center, constant

def calc_overlap_matrix(self):
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/test_radial_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def test_limit_large_sigma(self, sigma, r_ij, lengths, rotation_matrix):
hypers["r_ij"] = r_ij
hypers["lengths"] = lengths
hypers["rotation_matrix"] = rotation_matrix
prec_mon, center_mon = basis_mon.compute_gaussian_parameters(**hypers)
prec_gto, center_gto = basis_gto.compute_gaussian_parameters(**hypers)
prec_mon, center_mon, constant_mon = basis_mon.compute_gaussian_parameters(**hypers)
prec_gto, center_gto, constant_gto = basis_gto.compute_gaussian_parameters(**hypers)

# Check that for large sigma, the two are close
assert_allclose(center_mon, center_gto, rtol=1e-10, atol=1e-15)
Expand All @@ -173,7 +173,7 @@ def test_limit_small_sigma(self, sigma, r_ij, lengths, rotation_matrix):
hypers["r_ij"] = r_ij
hypers["lengths"] = lengths
hypers["rotation_matrix"] = rotation_matrix
prec_gto, center_gto = basis_gto.compute_gaussian_parameters(**hypers)
prec_gto, center_gto, constant_gto = basis_gto.compute_gaussian_parameters(**hypers)

# Check that for large sigma, the two are close
prec_ref = np.eye(3) / sigma**2
Expand Down

0 comments on commit 474dc56

Please sign in to comment.