Exemple #1
0
def TDA(mf):
    from pyscf import scf
    mf = scf.addons.convert_to_rhf(mf)
    if hasattr(mf, 'xc'):
        return rks.TDA(mf)
    else:
        return rhf.TDA(mf)
Exemple #2
0
 def test_tda_b3lypg(self):
     mf = dft.RKS(mol)
     mf.xc = 'b3lypg'
     mf.grids.prune = None
     mf.scf()
     td = rks.TDA(mf)
     td.nstates = 5
     es = td.kernel()[0] * 27.2114
     self.assertAlmostEqual(finger(es), -41.385520327568869, 7)
Exemple #3
0
 def test_tda_b3pw91(self):
     mf = dft.RKS(mol)
     mf.xc = 'b3pw91'
     mf.grids.prune = None
     mf.scf()
     td = rks.TDA(mf)
     td.nstates = 5
     es = td.kernel()[0] * 27.2114
     self.assertAlmostEqual(finger(es), -41.313632163628363, 7)
Exemple #4
0
 def test_tda_lda(self):
     mf = dft.RKS(mol)
     mf.xc = 'lda,vwn'
     mf.grids.prune = None
     mf.scf()
     td = rks.TDA(mf)
     td.nstates = 5
     es = td.kernel()[0] * 27.2114
     self.assertAlmostEqual(finger(es), -41.201828219760415, 7)
Exemple #5
0
 def test_tda_lda_triplet(self):
     mf = dft.RKS(mol)
     mf.xc = 'lda,vwn'
     mf.grids.prune = None
     mf.scf()
     td = rks.TDA(mf)
     td.singlet = False
     td.nstates = 5
     es = td.kernel()[0] * 27.2114
     self.assertAlmostEqual(finger(es), -39.988118769202416, 7)
Exemple #6
0
 def test_tda_b3lyp_triplet(self):
     mf = dft.RKS(mol)
     mf.xc = 'b3lyp'
     mf.grids.prune = None
     mf.scf()
     td = rks.TDA(mf)
     td.singlet = False
     td.nstates = 5
     es = td.kernel()[0] * 27.2114
     self.assertAlmostEqual(finger(es), -40.020204585289648, 7)
Exemple #7
0
 def test_tddft_b3lyp_xcfun(self):
     dft.numint._NumInt.libxc = dft.xcfun
     mf = dft.RKS(mol)
     mf.xc = 'b3lyp'
     mf.grids.prune = None
     mf.scf()
     td = rks.TDA(mf)
     td.nstates = 5
     es = td.kernel()[0] * 27.2114
     dft.numint._NumInt.libxc = dft.libxc
     self.assertAlmostEqual(finger(es), -41.393122257109056, 7)
Exemple #8
0
 def test_tda_lda_xcfun(self):
     dft.numint._NumInt.libxc = dft.xcfun
     mf = dft.RKS(mol)
     mf.xc = 'lda,vwn'
     mf.grids.prune = None
     mf.scf()
     td = rks.TDA(mf)
     td.nstates = 5
     es = td.kernel()[0] * 27.2114
     dft.numint._NumInt.libxc = dft.libxc
     self.assertAlmostEqual(finger(es), -41.201828219760415, 6)
Exemple #9
0
def TDA(mf):
    if hasattr(mf, 'xc'):
        return rks.TDA(mf)
    else:
        return rhf.TDA(mf)