def test_getattr(self): from pyscf.pbc import scf, dft, cc, tdscf cell = pgto.M(atom='He', a=np.eye(3) * 4, basis={'He': [[0, (1, 1)]]}) self.assertEqual(cell.HF().__class__, scf.HF(cell).__class__) self.assertEqual(cell.KS().__class__, dft.KS(cell).__class__) self.assertEqual(cell.UKS().__class__, dft.UKS(cell).__class__) self.assertEqual(cell.KROHF().__class__, scf.KROHF(cell).__class__) self.assertEqual(cell.KKS().__class__, dft.KKS(cell).__class__) self.assertEqual(cell.CCSD().__class__, cc.ccsd.RCCSD) self.assertEqual(cell.TDA().__class__, tdscf.rhf.TDA) self.assertEqual(cell.TDBP86().__class__, tdscf.rks.TDDFTNoHybrid) self.assertEqual(cell.TDB3LYP().__class__, tdscf.rks.TDDFT) self.assertEqual(cell.KCCSD().__class__, cc.kccsd_rhf.KRCCSD) self.assertEqual(cell.KTDA().__class__, tdscf.krhf.TDA) self.assertEqual(cell.KTDBP86().__class__, tdscf.krks.TDDFTNoHybrid) self.assertRaises(AttributeError, lambda: cell.xyz) self.assertRaises(AttributeError, lambda: cell.TDxyz)
def KKS(cell, *args): from pyscf.pbc import dft return dft.KKS(cell)