It'd be nice to have a little function that computes E_L variance, including in parallel. Here's a serial version.
import pyqmc.api as pyq
import h5py
mf_chkfile = "kroks_spin_5_basis_vtz.chk"
ci_chkfile = "casci_spin_5_basis_vtz_norb_5_nelec_3up_2down.chk"
cell, kmf, mc = pyq.recover_pyscf(mf_chkfile, ci_checkfile=ci_chkfile)
mc.ci = mc.ci[0]
wf, to_opt = pyq.generate_wf(
cell,
kmf,
mc=mc,
)
pyq.read_wf(wf, "ground_state_wf_jastrow_opt.chk")
configs = pyq.initial_guess(cell, 400)
data, configs = pyq.vmc(wf, configs, nblocks=1, verbose=True)
enacc = pyq.EnergyAccumulator(cell)
ens = enacc(configs, wf)
print(mean(ens['total']), std(ens['total'],ddof=1), sem(ens['total']))
It'd be nice to have a little function that computes E_L variance, including in parallel. Here's a serial version.