Skip to content

Commit

Permalink
Restore tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Oct 10, 2023
1 parent 065deb6 commit c2cd2ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 7 additions & 7 deletions pyscf/pbc/tdscf/test/test_rks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def kernel(self, TD, ref, **kwargs):
self.assertAlmostEqual(abs(td.e[:self.nstates_test] * unitev - ref).max(), 0, 4)

def test_tda_singlet(self):
ref = [9.33545109, 9.33545109]
ref = [9.2625251659, 9.2625251659]
self.kernel('TDA', ref)

def test_tda_triplet(self):
ref = [5.14726236, 5.14726236]
ref = [4.8364248190, 4.8364248190]
self.kernel('TDA', ref, singlet=False)

def test_tddft_singlet(self):
ref = [8.87735129, 8.87735129]
ref = [8.8773512896, 8.8773512896]
self.kernel('TDDFT', ref)

def test_tddft_triplet(self):
Expand Down Expand Up @@ -226,19 +226,19 @@ def kernel(self, TD, ref, **kwargs):
self.assertAlmostEqual(abs(td.e[:self.nstates_test] * unitev - ref).max(), 0, 4)

def test_tda_singlet(self):
ref = [9.62238067, 9.62238067]
ref = [9.6202884134, 9.6202884134]
self.kernel('TDA', ref)

def test_tda_triplet(self):
ref = [5.39995144, 5.39995144]
ref = [5.1659937745, 5.1659937745]
self.kernel('TDA', ref, singlet=False)

def test_tddft_singlet(self):
ref = [9.260114, 9.260114]
ref = [9.2585491075, 9.2585491075]
self.kernel('TDDFT', ref)

def test_tddft_triplet(self):
ref = [4.68905023, 4.8143958 ]
ref = [4.5570089807, 4.5570089807]
self.kernel('TDDFT', ref, singlet=False)


Expand Down
6 changes: 2 additions & 4 deletions pyscf/pbc/tdscf/test/test_uks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ def tearDownClass(cls):

def kernel(self, TD, ref, **kwargs):
td = getattr(self.mf, TD)().set(nstates=self.nstates, **kwargs).run()
print(td.e[:self.nstates_test] * unitev)
self.assertAlmostEqual(abs(td.e[:self.nstates_test] * unitev - ref).max(), 0, 4)

def test_tda(self):
ref = [4.77090949, 4.77090949]
ref = [4.8137763755, 4.8137763755]
self.kernel('TDA', ref)

def test_tdhf(self):
Expand Down Expand Up @@ -159,11 +158,10 @@ def tearDownClass(cls):

def kernel(self, TD, ref, **kwargs):
td = getattr(self.mf, TD)().set(nstates=self.nstates, **kwargs).run()
print(td.e[:self.nstates_test] * unitev)
self.assertAlmostEqual(abs(td.e[:self.nstates_test] * unitev - ref).max(), 0, 4)

def test_tda(self):
ref = [5.10697989, 5.10697989]
ref = [5.1435121896, 5.1435121896]
self.kernel('TDA', ref)

def test_tdhf(self):
Expand Down

0 comments on commit c2cd2ac

Please sign in to comment.