Skip to content

Commit

Permalink
Remove irrelevant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Sep 20, 2023
1 parent a5a9945 commit 858e953
Showing 1 changed file with 193 additions and 193 deletions.
386 changes: 193 additions & 193 deletions pyscf/solvent/test/test_ddcosmo_tdscf_grad.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,143 +31,143 @@ def tearDownModule():

class KnownValues(unittest.TestCase):

def test_rhf_tda(self):
# TDA with equilibrium_solvation
mf = mol0.RHF().ddCOSMO().run()
td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
g1 = td.nuc_grad_method().kernel()

mf = mol1.RHF().ddCOSMO().run()
td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
mf = mol2.RHF().ddCOSMO().run()
td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)

# TDA without equilibrium_solvation
mf = mol0.RHF().ddCOSMO().run()
td = mf.TDA().ddCOSMO().run()
g1 = td.nuc_grad_method().kernel()

mf = mol1.RHF().ddCOSMO().run()
td1 = mf.TDA().ddCOSMO().run()
mf = mol2.RHF().ddCOSMO().run()
td2 = mf.TDA().ddCOSMO().run()
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)

def test_rhf_tdhf(self):
# TDHF with equilibrium_solvation
mf = mol0.RHF().ddCOSMO().run()
td = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
g1 = td.nuc_grad_method().kernel()

mf = mol1.RHF().ddCOSMO().run()
td1 = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
mf = mol2.RHF().ddCOSMO().run()
td2 = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)

# TDHF without equilibrium_solvation
mf = mol0.RHF().ddCOSMO().run()
td = mf.TDHF().ddCOSMO().run()
g1 = td.nuc_grad_method().kernel()

mf = mol1.RHF().ddCOSMO().run()
td1 = mf.TDHF().ddCOSMO().run()
mf = mol2.RHF().ddCOSMO().run()
td2 = mf.TDHF().ddCOSMO().run()
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)

def test_rhf_tda_triplet(self):
# TDA triplet with equilibrium_solvation
mf = mol0.RHF().ddCOSMO().run()
td = mf.TDA().ddCOSMO().run(singlet=False, equilibrium_solvation=True)
g1 = td.nuc_grad_method().kernel()

mf = mol1.RHF().ddCOSMO().run()
td1 = mf.TDA().ddCOSMO().run(singlet=False, equilibrium_solvation=True)
mf = mol2.RHF().ddCOSMO().run()
td2 = mf.TDA().ddCOSMO().run(singlet=False, equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)

# TDA triplet without equilibrium_solvation
mf = mol0.RHF().ddCOSMO().run()
td = mf.TDA().ddCOSMO().run(singlet=False)
g1 = td.nuc_grad_method().kernel()

mf = mol1.RHF().ddCOSMO().run()
td1 = mf.TDA().ddCOSMO().run(singlet=False)
mf = mol2.RHF().ddCOSMO().run()
td2 = mf.TDA().ddCOSMO().run(singlet=False)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)

def test_uhf_tda(self):
# TDA with equilibrium_solvation
mf = mol0.UHF().ddCOSMO().run()
td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
g1 = td.nuc_grad_method().kernel()

mf = mol1.UHF().ddCOSMO().run()
td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
mf = mol2.UHF().ddCOSMO().run()
td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 5)

# TDA without equilibrium_solvation
mf = mol0.UHF().ddCOSMO().run()
td = mf.TDA().ddCOSMO().run()
g1 = td.nuc_grad_method().kernel()

mf = mol1.UHF().ddCOSMO().run()
td1 = mf.TDA().ddCOSMO().run()
mf = mol2.UHF().ddCOSMO().run()
td2 = mf.TDA().ddCOSMO().run()
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 5)

def test_uhf_tdhf(self):
# TDHF with equilibrium_solvation
mf = mol0.UHF().ddCOSMO().run()
td = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
g1 = td.nuc_grad_method().kernel()

mf = mol1.UHF().ddCOSMO().run()
td1 = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
mf = mol2.UHF().ddCOSMO().run()
td2 = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 5)

# TDHF without equilibrium_solvation
mf = mol0.UHF().ddCOSMO().run()
td = mf.TDHF().ddCOSMO().run()
g1 = td.nuc_grad_method().kernel()

mf = mol1.UHF().ddCOSMO().run()
td1 = mf.TDHF().ddCOSMO().run()
mf = mol2.UHF().ddCOSMO().run()
td2 = mf.TDHF().ddCOSMO().run()
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 5)

def test_lda_tda(self):
# TDA lda with equilibrium_solvation
mf = mol0.RKS().ddCOSMO().run(xc='svwn')
td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
g1 = td.nuc_grad_method().kernel()

mf = mol1.RKS().ddCOSMO().run(xc='svwn')
td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
mf = mol2.RKS().ddCOSMO().run(xc='svwn')
td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)

# TDA lda without equilibrium_solvation
mf = mol0.RKS().ddCOSMO().run(xc='svwn')
td = mf.TDA().ddCOSMO().run()
g1 = td.nuc_grad_method().kernel()

mf = mol1.RKS().ddCOSMO().run(xc='svwn')
td1 = mf.TDA().ddCOSMO().run()
mf = mol2.RKS().ddCOSMO().run(xc='svwn')
td2 = mf.TDA().ddCOSMO().run()
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)
# def test_rhf_tda(self):
# # TDA with equilibrium_solvation
# mf = mol0.RHF().ddCOSMO().run()
# td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RHF().ddCOSMO().run()
# td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# mf = mol2.RHF().ddCOSMO().run()
# td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)
#
# # TDA without equilibrium_solvation
# mf = mol0.RHF().ddCOSMO().run()
# td = mf.TDA().ddCOSMO().run()
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RHF().ddCOSMO().run()
# td1 = mf.TDA().ddCOSMO().run()
# mf = mol2.RHF().ddCOSMO().run()
# td2 = mf.TDA().ddCOSMO().run()
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)
#
# def test_rhf_tdhf(self):
# # TDHF with equilibrium_solvation
# mf = mol0.RHF().ddCOSMO().run()
# td = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RHF().ddCOSMO().run()
# td1 = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
# mf = mol2.RHF().ddCOSMO().run()
# td2 = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)
#
# # TDHF without equilibrium_solvation
# mf = mol0.RHF().ddCOSMO().run()
# td = mf.TDHF().ddCOSMO().run()
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RHF().ddCOSMO().run()
# td1 = mf.TDHF().ddCOSMO().run()
# mf = mol2.RHF().ddCOSMO().run()
# td2 = mf.TDHF().ddCOSMO().run()
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)
#
# def test_rhf_tda_triplet(self):
# # TDA triplet with equilibrium_solvation
# mf = mol0.RHF().ddCOSMO().run()
# td = mf.TDA().ddCOSMO().run(singlet=False, equilibrium_solvation=True)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RHF().ddCOSMO().run()
# td1 = mf.TDA().ddCOSMO().run(singlet=False, equilibrium_solvation=True)
# mf = mol2.RHF().ddCOSMO().run()
# td2 = mf.TDA().ddCOSMO().run(singlet=False, equilibrium_solvation=True)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)
#
# # TDA triplet without equilibrium_solvation
# mf = mol0.RHF().ddCOSMO().run()
# td = mf.TDA().ddCOSMO().run(singlet=False)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RHF().ddCOSMO().run()
# td1 = mf.TDA().ddCOSMO().run(singlet=False)
# mf = mol2.RHF().ddCOSMO().run()
# td2 = mf.TDA().ddCOSMO().run(singlet=False)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 6)
#
# def test_uhf_tda(self):
# # TDA with equilibrium_solvation
# mf = mol0.UHF().ddCOSMO().run()
# td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.UHF().ddCOSMO().run()
# td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# mf = mol2.UHF().ddCOSMO().run()
# td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 5)
#
# # TDA without equilibrium_solvation
# mf = mol0.UHF().ddCOSMO().run()
# td = mf.TDA().ddCOSMO().run()
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.UHF().ddCOSMO().run()
# td1 = mf.TDA().ddCOSMO().run()
# mf = mol2.UHF().ddCOSMO().run()
# td2 = mf.TDA().ddCOSMO().run()
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 5)
#
# def test_uhf_tdhf(self):
# # TDHF with equilibrium_solvation
# mf = mol0.UHF().ddCOSMO().run()
# td = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.UHF().ddCOSMO().run()
# td1 = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
# mf = mol2.UHF().ddCOSMO().run()
# td2 = mf.TDHF().ddCOSMO().run(equilibrium_solvation=True)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 5)
#
# # TDHF without equilibrium_solvation
# mf = mol0.UHF().ddCOSMO().run()
# td = mf.TDHF().ddCOSMO().run()
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.UHF().ddCOSMO().run()
# td1 = mf.TDHF().ddCOSMO().run()
# mf = mol2.UHF().ddCOSMO().run()
# td2 = mf.TDHF().ddCOSMO().run()
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 5)
#
# def test_lda_tda(self):
# # TDA lda with equilibrium_solvation
# mf = mol0.RKS().ddCOSMO().run(xc='svwn')
# td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RKS().ddCOSMO().run(xc='svwn')
# td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# mf = mol2.RKS().ddCOSMO().run(xc='svwn')
# td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)
#
# # TDA lda without equilibrium_solvation
# mf = mol0.RKS().ddCOSMO().run(xc='svwn')
# td = mf.TDA().ddCOSMO().run()
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RKS().ddCOSMO().run(xc='svwn')
# td1 = mf.TDA().ddCOSMO().run()
# mf = mol2.RKS().ddCOSMO().run(xc='svwn')
# td2 = mf.TDA().ddCOSMO().run()
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)

def test_b3lyp_tda(self):
# TDA gga with equilibrium_solvation
Expand All @@ -181,62 +181,62 @@ def test_b3lyp_tda(self):
td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)

# TDA gga without equilibrium_solvation
mf = mol0.RKS().ddCOSMO().run(xc='b3lyp')
td = mf.TDA().ddCOSMO().run()
g1 = td.nuc_grad_method().kernel()

mf = mol1.RKS().ddCOSMO().run(xc='b3lyp')
td1 = mf.TDA().ddCOSMO().run()
mf = mol2.RKS().ddCOSMO().run(xc='b3lyp')
td2 = mf.TDA().ddCOSMO().run()
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)

def test_ulda_tda(self):
# TDA lda with equilibrium_solvation
mf = mol0.UKS().ddCOSMO().run(xc='svwn')
td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
g1 = td.nuc_grad_method().kernel()

mf = mol1.UKS().ddCOSMO().run(xc='svwn')
td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
mf = mol2.UKS().ddCOSMO().run(xc='svwn')
td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)

# TDA lda without equilibrium_solvation
mf = mol0.UKS().ddCOSMO().run(xc='svwn')
td = mf.TDA().ddCOSMO().run()
g1 = td.nuc_grad_method().kernel()

mf = mol1.UKS().ddCOSMO().run(xc='svwn')
td1 = mf.TDA().ddCOSMO().run()
mf = mol2.UKS().ddCOSMO().run(xc='svwn')
td2 = mf.TDA().ddCOSMO().run()
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)

def test_ub3lyp_tda(self):
# TDA gga with equilibrium_solvation
mf = mol0.UKS().ddCOSMO().run(xc='b3lyp')
td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
g1 = td.nuc_grad_method().kernel()

mf = mol1.UKS().ddCOSMO().run(xc='b3lyp')
td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
mf = mol2.UKS().ddCOSMO().run(xc='b3lyp')
td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 3)

# TDA gga without equilibrium_solvation
mf = mol0.UKS().ddCOSMO().run(xc='b3lyp')
td = mf.TDA().ddCOSMO().run()
g1 = td.nuc_grad_method().kernel()

mf = mol1.UKS().ddCOSMO().run(xc='b3lyp')
td1 = mf.TDA().ddCOSMO().run()
mf = mol2.UKS().ddCOSMO().run(xc='b3lyp')
td2 = mf.TDA().ddCOSMO().run()
self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 3)
# # TDA gga without equilibrium_solvation
# mf = mol0.RKS().ddCOSMO().run(xc='b3lyp')
# td = mf.TDA().ddCOSMO().run()
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.RKS().ddCOSMO().run(xc='b3lyp')
# td1 = mf.TDA().ddCOSMO().run()
# mf = mol2.RKS().ddCOSMO().run(xc='b3lyp')
# td2 = mf.TDA().ddCOSMO().run()
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)
#
# def test_ulda_tda(self):
# # TDA lda with equilibrium_solvation
# mf = mol0.UKS().ddCOSMO().run(xc='svwn')
# td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.UKS().ddCOSMO().run(xc='svwn')
# td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# mf = mol2.UKS().ddCOSMO().run(xc='svwn')
# td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)
#
# # TDA lda without equilibrium_solvation
# mf = mol0.UKS().ddCOSMO().run(xc='svwn')
# td = mf.TDA().ddCOSMO().run()
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.UKS().ddCOSMO().run(xc='svwn')
# td1 = mf.TDA().ddCOSMO().run()
# mf = mol2.UKS().ddCOSMO().run(xc='svwn')
# td2 = mf.TDA().ddCOSMO().run()
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 4)
#
# def test_ub3lyp_tda(self):
# # TDA gga with equilibrium_solvation
# mf = mol0.UKS().ddCOSMO().run(xc='b3lyp')
# td = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.UKS().ddCOSMO().run(xc='b3lyp')
# td1 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# mf = mol2.UKS().ddCOSMO().run(xc='b3lyp')
# td2 = mf.TDA().ddCOSMO().run(equilibrium_solvation=True)
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 3)
#
# # TDA gga without equilibrium_solvation
# mf = mol0.UKS().ddCOSMO().run(xc='b3lyp')
# td = mf.TDA().ddCOSMO().run()
# g1 = td.nuc_grad_method().kernel()
#
# mf = mol1.UKS().ddCOSMO().run(xc='b3lyp')
# td1 = mf.TDA().ddCOSMO().run()
# mf = mol2.UKS().ddCOSMO().run(xc='b3lyp')
# td2 = mf.TDA().ddCOSMO().run()
# self.assertAlmostEqual((td2.e_tot[0]-td1.e_tot[0])/0.002, g1[0,2], 3)


if __name__ == "__main__":
Expand Down

0 comments on commit 858e953

Please sign in to comment.