Skip to content

Variance recipe #472

@lkwagner

Description

@lkwagner

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']))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions