-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
42 lines (31 loc) · 814 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A driver program to perform thermal Hartree-Fock calculation for H20 molecule in the
STO-3G basis.
@author: prateekvaish
@email: [email protected]
"""
from pyscf_rhf import SCF
import pyscf
mol = pyscf.gto.Mole()
mol.atom = '''
O
H 1 0.96
H 1 0.96 2 109.5
'''
mol.basis = "STO-3G"
mol.unit = "angstrom"
mol.build()
rhf = SCF()
rhf.read_integrals(mol)
beta = 1.0
mu0 = -1.0
delmu = 5.0
mu_converged = rhf.optimize_mu(beta = beta, mu0 = mu0, delmu = delmu, scf_iter = 1000, \
mu_conv = 1.0e-5, do_LDM = True, mix_dm = 0.5, mu_iter = 50)
if mu_converged:
print("Occupancy = {:.4f}".format(rhf.get_occupancy()))
print("Internal energy = {:.4f} Hartree".format(rhf.get_Energy()))
else:
print("Occupancy not converged")