I have been able to setup fractional charge calculations for HF. I would like to do so for DFAs as well, but the energy returned by such calculations remains static, as if there were no fractional charge at all. I have attached a minimal example.
import psi4
import matplotlib.pyplot as plt
import numpy as np
psi4.set_memory('500 MB')
psi4.set_options({'reference' : 'uks'})
h2o = psi4.geometry("""
O
H 1 0.96
H 1 0.96 2 104.5
symmetry c1
""")
occ = np.arange(0, 1.1, 0.1)
fracs_hf = []
for i in occ:
psi4.set_options({ 'frac_start' : 5,
'frac_occ' : [6],
'frac_val' : [i],
'frac_diis' : True})
frac = psi4.energy('hf/6-31G')
fracs_hf.append(frac)
occ = np.arange(0, 1.1, 0.1)
fracs_blyp = []
for i in occ:
psi4.set_options({ 'frac_start' : 5,
'frac_occ' : [6],
'frac_val' : [i],
'frac_diis' : True})
frac = psi4.energy('blyp/6-31G')
fracs_blyp.append(frac)
print(fracs_hf)
print(fracs_blyp)