Periodic hydrogen chain with a Jastrow–Slater single-determinant ansatz via VMC and LRDMC using ECPs

00 Introduction

In this tutorial, you will carry out a VMC/LRDMC workflow for the periodic hydrogen chain under periodic boundary conditions (PBCs), starting from a DFT calculation in PySCF with ccECPs. You will use Gamma-point sampling. All input and output files for this tutorial can be downloaded here.

01 Hydrogen-chain - JDFT ansatz

The first step of this tutorial is to generate a JDFT ansatz using PySCF. A Python script will be presented later. In this example, a unit cell containing two hydrogen atoms is repeated 5 times along z-axis, forming a supercell. We assume that you already have installed a working copy of PySCF, e.g. by pip install pyscf.

The procedure is as follows:

  1. Run the PySCF calculation by typing:

    cd 01_trial_wavefunction
    python3 pyscf_H-chain.py
    

    Note

    You may increase the maximum size of memory allocation in PySCF by preparing a config file in the home directory ~/.pyscf_conf.py:

    import psutil
    MAX_MEMORY = int(psutil.virtual_memory().available / 1e6)
    
  2. Convert the generated PySCF checkpoint file to a TREXIO file by typing:

    trexio convert-from -t pyscf -i H-chain.chk -b hdf5 H-chain.hdf5
    
  3. Convert from TREXIO file to the TurboRVB wavefunction file by typing:

    trexio-to-turborvb H-chain.hdf5 -jasbasis cc-pVDZ -jascutbasis
    

Then, you will have the TurboRVB wavefunction file fort.10 as well as the pseudopotential file pseudo.dat.

Note

When the PySCF calculation fails:

  • Check if the basis set is available,

  • Ensure that the sufficient memory allocation is available.

02 JDFT ansatz - Jastrow optimization

The second step is to optimize the Jastrow factor at the VMC level using vmcopt module of TurboGenius. One should refer to the Hydrogen tutorial for the details. Here, only needed commands are shown.

  1. Copy the wavefunction file and the pseudopotential file:

cd ../02_optimization/
cp ../01_trial_wavefunction/fort.10 .
cp ../01_trial_wavefunction/pseudo.dat .
cp fort.10 fort.10_dft
  1. Generate an input file datasmin.input:

turbogenius vmcpot -g -opt_onebody -opt_twobody -opt_jas_mat -optimizer lr -vmcoptsteps 300 -steps 100 -nw 128
  1. Run the optimization:

export TURBOVMC_RUN_COMMAND="mpirun -np 16 turborvb-mpi.x"
turbogenius vmcopt -r

See Note in the optimization step for the ways to run the calculations.

  1. Perform the postprocess and plot the results:

turbogenius vmcopt -post -optwarmup 80 -plot

Check plot_energy_and_devmax.png and the files in the parameters_graphs directory.

03 JDFT ansatz - VMC

The next step is to run a single-shot VMC calculation. This is done using the vmc module of TurboGenius. First, prepare the wavefunction and pseudopotential files:

cd ../03_vmc/
cp ../02_optimization/fort.10 fort.10
cp ../02_optimization/pseudo.dat .

Next, generate an input file datasvmc.input using:

turbogenius vmc -g -steps 1000 -nw 128

Then, run the VMC calculation:

TURBOVMC_RUN_COMMAND="mpirun -np 16 turborvb-mpi.x"
export TURBOVMC_RUN_COMMAND

turbogenius vmc -r

Finally, run the postprocess:

turbogenius vmc -post -bin 10 -warmup 5

Check the reblocked total energy and error in the file pip0.d.

04 JDFT ansatz - LRDMC

Now we proceed to the lattice regularized diffusion Monte Carlo calculation that can improve a trial wavefunction obtained by a DFT calculation or a VMC optimization. One should refer to the Hydrogen tutorial for the details.

In this section, we will perform the calculation at the lattice constant alat=0.50. First, copy the prepared wavefunction and the pseudopotential files:

# LRDMC run
cd ../04_lrdmc/
cp ../03_vmc/fort.10 .
cp ../03_vmc/pseudo.dat .

Next, generate an input file datasfn.input for the LRDMC calculation:

turbogenius lrdmc -g -etry -5.500 -alat -0.50 -steps 10000 -nw 128

Then, run the calculation by typing:

TURBOVMC_RUN_COMMAND="mpirun -np 16 turborvb-mpi.x"
export TURBOVMC_RUN_COMMAND

turbogenius lrdmc -r

Finally, run the postprocess:

turbogenius lrdmc -post -bin 20 -corr 3 -warmup 5

We wil get E at a=0.50 bohr in pip0_fn.d.

One then follows the above procedure for several choices of alat, and extrapolates the energy value at \(a \to 0\). See the Hydrogen tutorial for the concrete steps.