Skip to content

Commit

Permalink
Tuning testing values
Browse files Browse the repository at this point in the history
  • Loading branch information
ifilot committed Dec 6, 2023
1 parent 6c14cdd commit cb0b4a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/test_geometry_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_optimization_h2_p321(self):
mol.add_atom('H', 0.9, 0.0, 0.0)
mol.add_atom('H', -0.9, 0.0, 0.0)

res = GeometryOptimization(verbose=False).run(mol, 'p321')
res = GeometryOptimization(verbose=False).run(mol, 'p321', tolerance=1e-10)
np.testing.assert_almost_equal(res['opt'].fun, -1.1232790915, decimal=4)

self.assertEqual(len(res['energies']), len(res['forces']))
Expand Down Expand Up @@ -75,7 +75,7 @@ def test_optimization_ch4(self):
mol.add_atom('H', dist, -dist, -dist, unit='angstrom')

res = GeometryOptimization(verbose=False).run(mol, 'sto3g')
np.testing.assert_almost_equal(res['opt'].fun, -39.72691085946399)
np.testing.assert_almost_equal(res['opt'].fun, -39.72691085946399, decimal=4)

self.assertEqual(len(res['energies']), len(res['forces']))
self.assertEqual(len(res['energies']), len(res['coordinates']))
Expand All @@ -102,7 +102,7 @@ def test_optimization_h2o(self):
mol.add_atom('H', 0.0, 0.8580158822, 0.5085242828, unit='angstrom')

res = GeometryOptimization(verbose=False).run(mol, 'sto3g')
np.testing.assert_almost_equal(res['opt'].fun, -74.96590347517174)
np.testing.assert_almost_equal(res['opt'].fun, -74.96590347517174, decimal=4)

self.assertEqual(len(res['energies']), len(res['forces']))
self.assertEqual(len(res['energies']), len(res['coordinates']))
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_optimization_c2h4(self):
mol.add_atom('H', 1.1288875372, -0.9156191261 ,0.1000000000, unit='angstrom')

res = GeometryOptimization(verbose=False).run(mol, 'sto3g')
np.testing.assert_almost_equal(res['opt'].fun, -77.07396213047552)
np.testing.assert_almost_equal(res['opt'].fun, -77.07396213047552, decimal=4)

self.assertEqual(len(res['energies']), len(res['forces']))
self.assertEqual(len(res['energies']), len(res['coordinates']))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_hf_deriv.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def test_hartree_fock_forces_ch4(self):

# calculate forces using analytical derivatives
solver = HF()
res = solver.rhf(mol, 'sto3g', calc_forces=True)
res = solver.rhf(mol, 'sto3g', calc_forces=True, tolerance=1e-12)

# calculate forces using finite difference
forces = calculate_forces_finite_difference(mol)

np.testing.assert_almost_equal(res['forces'], forces, decimal=4)
np.testing.assert_almost_equal(res['forces'], forces, decimal=3)

def test_hartree_fock_forces_co2(self):
"""
Expand Down

0 comments on commit cb0b4a1

Please sign in to comment.