-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More CSF configuration printout and example (#124)
- Loading branch information
1 parent
5c4cd25
commit eb17fdf
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
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,25 @@ | ||
from pyscf import gto, fci, scf, lib, ao2mo | ||
from mrh.my_pyscf.fci import csf_solver | ||
|
||
mol = gto.M (atom='H 0 0 0; F 0 0 1.1', basis='sto3g', output='csf_fci.log', | ||
verbose=lib.logger.INFO) | ||
mf = scf.RHF (mol).run () | ||
|
||
h0 = mf.energy_nuc () | ||
h1 = mf.get_hcore () | ||
h2 = ao2mo.restore (1, mf._eri, mol.nao_nr ()) | ||
|
||
cisolver = csf_solver (mol, smult=1) | ||
|
||
# Print how many CSFs, and other information, to stdout. You need to set # of orbs and electrons | ||
print ("Singlet configuration:") | ||
cisolver.print_transformer_cache (norb=mol.nao_nr (), nelec=mol.nelec) | ||
print ("Singlet energy:", cisolver.kernel (h1,h2,mol.nao_nr(),mol.nelec,ecore=h0)[0]) | ||
|
||
# Number of orbs and electrons as well as spin multiplicity will be stored after running kernel | ||
e = cisolver.kernel (h1,h2,mol.nao_nr(),mol.nelec,smult=3,ecore=h0)[0] | ||
print ("\nTriplet configuration:") | ||
cisolver.print_transformer_cache () | ||
print ("Triplet energy:", e) | ||
|
||
|
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