Skip to content

Commit

Permalink
PySCF: Add support for recording dispersion energy (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
awvwgk authored Feb 22, 2023
1 parent 3987ea3 commit dd59132
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
version: [10]

include:
- os: ubuntu-latest
- os: ubuntu-20.04
build: cmake
build-type: debug
compiler: gnu
Expand All @@ -28,7 +28,7 @@ jobs:
build: cmake
build-type: debug
compiler: gnu
version: 9
version: 10

- os: ubuntu-latest
build: meson
Expand All @@ -48,7 +48,7 @@ jobs:
compiler: gnu
version: 11

- os: ubuntu-latest
- os: ubuntu-20.04
build: meson
build-type: debug
compiler: intel
Expand Down
4 changes: 3 additions & 1 deletion python/dftd3/pyscf.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ def dump_flags(self, verbose=None):
def energy_nuc(self):
enuc = mf.__class__.energy_nuc(self)
if self.with_dftd3:
enuc += self.with_dftd3.kernel()[0]
edisp = self.with_dftd3.kernel()[0]
mf.scf_summary["dispersion"] = edisp
enuc += edisp
return enuc

def reset(self, mol=None):
Expand Down
1 change: 1 addition & 0 deletions python/dftd3/test_pyscf.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def test_energy_hf():
)
mf = disp.energy(scf.RHF(mol))
assert mf.kernel() == approx(-110.93260361702605, abs=1.0e-8)
assert "dispersion" in mf.scf_summary


@pytest.mark.skipif(pyscf is None, reason="requires pyscf")
Expand Down

0 comments on commit dd59132

Please sign in to comment.