Skip to content

Commit

Permalink
Add MSDFT method (pyscf#77)
Browse files Browse the repository at this point in the history
* Add MSDFT method

* Using generalized Slater-Condon rules for HF integrals in NOCI

* Add comments

* typo

* Lint

* Fix bug in nuclear energy treatments

* Error in sm_t

* Update tests

* Update tests

* Adjust threshold in tests

* Adjust tests

* Numerical noises in mcpdft tests
  • Loading branch information
sunqm authored and stephen-quiton committed Jan 1, 2025
1 parent 07cdae0 commit ef35ffc
Show file tree
Hide file tree
Showing 6 changed files with 581 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MC-PDFT module within this package was developed by:

(in chronological order of first commit)
Qiming Sun
Matthew R Hermes (University of Chicago)
Dayou Zhang (University of Minnesota)
Aleksandr Lykhin (University of Chicago)
Expand All @@ -12,3 +13,4 @@ Bhavnesh Jangid
Shirong Wang
Jiachen Li <[email protected]>
Jincheng Yu <[email protected]>
Peng Bao
34 changes: 34 additions & 0 deletions examples/msdft/01-simple-noci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env/python

# Author: Peng Bao <[email protected]>
# Edited by: Qiming Sun <[email protected]>

from pyscf import gto, msdft

mol = gto.M(atom='''
H 1.080977 -2.558832 0.000000
H -1.080977 2.558832 0.000000
H 2.103773 -1.017723 0.000000
H -2.103773 1.017723 0.000000
H -0.973565 -1.219040 0.000000
H 0.973565 1.219040 0.000000
C 0.000000 0.728881 0.000000
C 0.000000 -0.728881 0.000000
C 1.117962 -1.474815 0.000000
C -1.117962 1.474815 0.000000
''', basis='sto-3g')

mf = msdft.NOCI(mol)
mf.xc = 'pbe0'

h = homo = mol.nelec[0] - 1
l = h + 1
# Single excitation orbital pair
mf.s = [[h,l],[h-1,l],[h,l+1],[h-1,l+1]]
# Double excitation orbital pair
mf.d = [[h,l]]

mf.run()
# reference:
#[-153.93158107 -153.8742658 -153.82198958 -153.69666086 -153.59511111
# -153.53734913 -153.5155775 -153.47367943 -153.40221993 -153.37353437]
2 changes: 1 addition & 1 deletion pyscf/mcpdft/test/test_diatomic_energies.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_h2_cms3ftlda22_631g (self):
# commit: bd596f6cabd6da0301f3623af2de6a14082b34b5
for i in range (3):
with self.subTest (state=i):
self.assertAlmostEqual (e[i], e_ref[i], 5)
self.assertAlmostEqual (e[i], e_ref[i], 4)

def test_h2_cms2ftlda22_631g (self):
e = diatomic ('H', 'H', 1.3, 'ftLDA,VWN3', '6-31G', 2, 2, 2)
Expand Down
1 change: 1 addition & 0 deletions pyscf/msdft/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .noci import NOCI
Loading

0 comments on commit ef35ffc

Please sign in to comment.