-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for CAS fragmentation and screened interactions in benzene.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import pyscf.gto | ||
import pyscf.scf | ||
import pyscf.cc | ||
import pyscf.mcscf | ||
import vayesta.ewf | ||
from vayesta.misc import molecules | ||
|
||
mol = pyscf.gto.Mole() | ||
mol.atom = molecules.arene(6) | ||
mol.basis = 'cc-pVDZ' | ||
mol.output = 'pyscf.out' | ||
mol.build() | ||
|
||
mf = pyscf.scf.RHF(mol).density_fit() | ||
mf.kernel() | ||
|
||
ncas = (4,4) | ||
|
||
# Reference CASCI | ||
mycasci = pyscf.mcscf.CASCI(mf, *ncas) | ||
mycasci.kernel() | ||
|
||
# Equivalent CAS calculation with bare interactions | ||
casci_bare = vayesta.ewf.EWF(mf, bath_options=dict(bathtype="dmet"), screening=None, solver="FCI") | ||
with casci_bare.cas_fragmentation() as f: | ||
f.add_cas_fragment(*ncas) | ||
casci_bare.kernel() | ||
|
||
# CAS calculation with cRPA screening | ||
casci_crpa = vayesta.ewf.EWF(mf, bath_options=dict(bathtype="dmet"), screening="crpa", solver="FCI") | ||
with casci_crpa.cas_fragmentation() as f: | ||
f.add_cas_fragment(*ncas) | ||
casci_crpa.kernel() | ||
|
||
# CAS calculation with mRPA screening | ||
casci_mrpa = vayesta.ewf.EWF(mf, bath_options=dict(bathtype="dmet"), screening="mrpa", solver="FCI") | ||
with casci_mrpa.cas_fragmentation() as f: | ||
f.add_cas_fragment(*ncas) | ||
casci_mrpa.kernel() | ||
|
||
print("E(HF)= %+16.8f Ha" % mf.e_tot) | ||
print("ΔE(CASCI)= %+16.8f Ha" % (mycasci.e_tot-mf.e_tot)) | ||
print("ΔE(Emb. CASCI, bare interactions)= %+16.8f Ha (diff= %+.8f Ha)" % (casci_bare.e_tot-mf.e_tot, casci_bare.e_tot-mycasci.e_tot)) | ||
print("ΔE(Emb. CASCI, cRPA screening)= %+16.8f Ha (diff= %+.8f Ha)" % (casci_crpa.e_tot-mf.e_tot, casci_crpa.e_tot-mycasci.e_tot)) | ||
print("ΔE(Emb. CASCI, mRPA screening)= %+16.8f Ha (diff= %+.8f Ha)" % (casci_mrpa.e_tot-mf.e_tot, casci_mrpa.e_tot-mycasci.e_tot)) |