diff --git a/pyproject.toml b/pyproject.toml index d145fbc90..a63ac60a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ dependencies = [ "scipy>=1.1.0,<=1.10.0", "h5py>=2.7", "cvxpy>=1.1", - "pyscf @ git+https://github.com/pyscf/pyscf@e90d8342e29446365f8570682af4a65fe16be27c", + "pyscf @ git+https://github.com/pyscf/pyscf@master", ] dynamic = ["version"] diff --git a/vayesta/core/qemb/qemb.py b/vayesta/core/qemb/qemb.py index bd49b1f94..3fb5c9111 100644 --- a/vayesta/core/qemb/qemb.py +++ b/vayesta/core/qemb/qemb.py @@ -339,7 +339,7 @@ def init_mf(self, mf): mf = copy.copy(mf) self.log.debugv("type(mf)= %r", type(mf)) # If the mean-field has k-points, automatically fold to the supercell: - if getattr(mf, "kpts", None) is not None: + if isinstance(mf, pyscf.pbc.scf.khf.KSCF): with log_time(self.log.timing, "Time for k->G folding of MOs: %s"): mf = fold_scf(mf) if isinstance(mf, FoldedSCF): diff --git a/vayesta/dmet/__init__.py b/vayesta/dmet/__init__.py index 155057d9a..1403854b5 100644 --- a/vayesta/dmet/__init__.py +++ b/vayesta/dmet/__init__.py @@ -21,9 +21,9 @@ def DMET(mf, *args, **kwargs): """Determine restricted or unrestricted by inspection of mean-field object""" - if isinstance(mf, pyscf.scf.uhf.UHF): + if isinstance(mf, (pyscf.scf.uhf.UHF, pyscf.pbc.scf.uhf.UHF, pyscf.pbc.scf.kuhf.KUHF)): return UDMET(mf, *args, **kwargs) - elif isinstance(mf, pyscf.scf.rohf.ROHF): + elif isinstance(mf, (pyscf.scf.rohf.ROHF, pyscf.pbc.scf.rohf.ROHF, pyscf.pbc.scf.krohf.KROHF)): log.warning("Converting ROHF reference to UHF") return UDMET(mf.to_uhf(), *args, **kwargs) return RDMET(mf, *args, **kwargs) diff --git a/vayesta/edmet/__init__.py b/vayesta/edmet/__init__.py index 2143159a1..5985eb204 100644 --- a/vayesta/edmet/__init__.py +++ b/vayesta/edmet/__init__.py @@ -15,9 +15,9 @@ def EDMET(mf, *args, **kwargs): """Determine restricted or unrestricted by inspection of mean-field object""" - if isinstance(mf, pyscf.scf.uhf.UHF): + if isinstance(mf, (pyscf.scf.uhf.UHF, pyscf.pbc.scf.uhf.UHF, pyscf.pbc.scf.kuhf.KUHF)): return UEDMET(mf, *args, **kwargs) - elif isinstance(mf, pyscf.scf.rohf.ROHF): + elif isinstance(mf, (pyscf.scf.rohf.ROHF, pyscf.pbc.scf.rohf.ROHF, pyscf.pbc.scf.krohf.KROHF)): log.warning("Converting ROHF reference to UHF") return UEMET(mf.to_uhf(), *args, **kwargs) return REDMET(mf, *args, **kwargs) diff --git a/vayesta/ewf/__init__.py b/vayesta/ewf/__init__.py index c0207b19c..d2483bf14 100644 --- a/vayesta/ewf/__init__.py +++ b/vayesta/ewf/__init__.py @@ -16,9 +16,9 @@ def EWF(mf, *args, **kwargs): """Determine restricted or unrestricted by inspection of mean-field object""" - if isinstance(mf, pyscf.scf.uhf.UHF): + if isinstance(mf, (pyscf.scf.uhf.UHF, pyscf.pbc.scf.uhf.UHF, pyscf.pbc.scf.kuhf.KUHF)): return UEWF(mf, *args, **kwargs) - elif isinstance(mf, pyscf.scf.rohf.ROHF): + elif isinstance(mf, (pyscf.scf.rohf.ROHF, pyscf.pbc.scf.rohf.ROHF, pyscf.pbc.scf.krohf.KROHF)): log.warning("Converting ROHF reference to UHF") return UEWF(mf.to_uhf(), *args, **kwargs) return REWF(mf, *args, **kwargs) diff --git a/vayesta/lattmod/latt.py b/vayesta/lattmod/latt.py index 1574c50c2..03400cea3 100644 --- a/vayesta/lattmod/latt.py +++ b/vayesta/lattmod/latt.py @@ -373,7 +373,7 @@ def density_fit(self): class LatticeRHF(LatticeSCF, pyscf.scf.hf.RHF): - def get_init_guess(self, mol=None, key=None): + def get_init_guess(self, mol=None, key=None, s1e=None): e, c = np.linalg.eigh(self.get_hcore()) nocc = self.mol.nelectron // 2 dm = 2 * np.dot(c[:, :nocc], c[:, :nocc].T) @@ -401,7 +401,7 @@ def check_lattice_symmetry(self, dm=None): class LatticeUHF(LatticeSCF, pyscf.scf.uhf.UHF): - def get_init_guess(self, mol=None, key=None): + def get_init_guess(self, mol=None, key=None, s1e=None): e, c = np.linalg.eigh(self.get_hcore()) nocc = self.mol.nelec dma = np.dot(c[:, : nocc[0]], c[:, : nocc[0]].T) diff --git a/vayesta/tests/core/qemb/test_integrals.py b/vayesta/tests/core/qemb/test_integrals.py index 426330bb4..8754c80dd 100644 --- a/vayesta/tests/core/qemb/test_integrals.py +++ b/vayesta/tests/core/qemb/test_integrals.py @@ -24,7 +24,7 @@ def tearDownClass(cls): @classmethod @cache def get_embedding(cls): - if isinstance(cls.mf, pyscf.scf.uhf.UHF): + if isinstance(cls.mf, pyscf.scf.uhf.UHF) or isinstance(cls.mf, pyscf.pbc.scf.uhf.UHF) or isinstance(cls.mf, pyscf.pbc.scf.kuhf.KUHF): emb = UEmbedding(cls.mf) else: emb = Embedding(cls.mf) diff --git a/vayesta/tests/rpa/test_rirpa_solids.py b/vayesta/tests/rpa/test_rirpa_solids.py index be2e326fa..deca1ddcf 100644 --- a/vayesta/tests/rpa/test_rirpa_solids.py +++ b/vayesta/tests/rpa/test_rirpa_solids.py @@ -6,7 +6,7 @@ class DiamondRIRPATest(TestCase): - PLACES = 8 + PLACES = 6 @classmethod def setUpClass(cls):