This project implements the Monte Carlo many-body perturbation theory (MC-MP) and Monte Carlo many-body Green's function methods (MC-GF) developed by the Hirata Lab.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
In order to build MC-MPn the following are required
For performance, it is optional but highly recommended to use an MPI compiler for multithreading support.
Build a simple reversion of MC-MPn is quite simple. From the top-level director run
mkdir <build-directory>
cd <build-directory>
cmake .. -DCMAKE_BUILD_TYPE=Release
make
If you want to build with a MPI support, substitute the cmake command with
MPI_CXX_COMPILER=<path-to-c++-mpi-compiler> cmake .. -DCMAKE_BUILD_TYPE=Release -DEnable_MPI=On
There are several files needed to run a calculation with MC-MPN
The
NWChem typically rotates and translates input geometries before proceeding with any calculations. The geometry input into MC-MPn needs to correspond to the one used to compute the MOs. Because of this, its typically worth pulling the geometry from the NWChem output file.
The movecs file produced by NWChem is stored in a binary format. MC-MPn can read the binary as is, although, there could potentially be issues with endianness if NWChem and MC-MPn are run on different machines. If there are issues with the binary movecs file, convert it to an ascii format on the machine used to run NWChem. NWChem provides a utility called mov2asc that will convert the binary into an ascii format. See keywords for how to specify the movecs format.
The MC-Basis is used to construct distributions for electron pairs (all methods) and for electrons (only F12 methods). The distribution for an electron pair is proportional to two sums of atom centered S-type Gaussians, one for each electron coordinate, and inversely proportional to the interelectronic distance. The distribution for an electron is proportional to a single sum of atom centered S-type Gaussians. The sums of S-type Gaussian for the electron-pair and electron distributions are identical.
Typically, two Gaussians are placed on each atom. If the atomic basis set contains diffuse atomic orbitals, such as the aug-cc-pVDZ basis set, using more than two Gaussians per atom may reduce the variance of the simulation.
In the case of placing two Gaussians on each atom, reasonable values for the parameters of the Gaussians are as follows. The height of the first Gaussian is set to be equal to the atom's number of valence electrons. Its width is approximately equal to the exponent of the most diffuse Gaussian in the most highly contracted S-type orbital of the atomic basis set. The height of the second Gaussian is set to be one-tenth of the atom's number of valence electrons. Its width is approximately equal to the exponent of the most diffuse Gaussian in the least contracted S-type orbital of the atomic basis set.
The format for the MC-Basis is as followed
<number of atoms> <guassians per atom>
<atom tag 1>
<gaussian width 1> <gaussian height 1>
. . .
<gaussian width n> <gaussian height n>
...
<atom tag m>
<gaussian width 1> <gaussian height 1>
. . .
<gaussian width n> <gaussian height n>
See examples/input/cc-pvdz.mc_basis for an explicit example of the MC_Basis file format.
The input file for MC-MPn is a simple text file. Most of the options consist of keyword values pairs. See the examples subdirectory of the project tree for examples of valid input files.
The following are required options. All paths are relative to director where the job is launched.
JOBNAME: (STRING) Name of job. Influences the names of output files.
GEOM: (STRING) Path to xyz geometry file.
BASIS: (STRING) Path to basis set.
MC_BASIS: (STRING) Path to MC basis set.
MOVECS: (STRING) Path to movecs file generated by NWChem.
The following are options technically options, but will be set for nearly every calculation.
JOBTYPE: (STRING) Specifies type of calculation to perform. Default=Energy
TASK: (STRING) Specifies what energy corrections to calculate for the given job type.
ELECTRON_PAIRS: (INT) Number of electron-pair walkers to use for the calculation. Default=16
MC_TRIAL: (INT) Number of MC steps to perform. Default=1024
FREEZE_CORE: (INT) Option to invoke the frozen core approximation. Values={0, 1}. Default=1
DEBUG: (INT) Values={0, 1, 2}; Default=0
SEED_FILE: (String); Default=""
SAMPLER: (STRING) Sets method to use to sample the electron-pair importance function. Default=DIRECT
TAU_INTEGRATION: (STRING) Sets method to integrate imaginary-time coordinates. Default=STOCHASTIC
If the sampler is set to Metropolis the following keywords may be set:
These options control the behavior of F12V calculations
MC-F12 methods have the unique ability to use nearly any function as the correlation factor, since the use of a function is not dependant of the availability of analytic integrals. The choice of correlation factor can dramatically affect the accuracy of the resulting F12 calculation. Because of this, it is recommend to use the Slater correlation factor as it generally performs well. See (Cole's correlation function paper) for a detailed study comparing the usage of different correlation factors for F12 calculations. The default values of the adjustable parameters are taken from this study. The following correlation factors are implemented for MC-F12 calculations.
Dimer jobs require several additional inputs compared to a standard energy job type. The dimer job type requires three geometries and molecular orbital vectors, one each of the DIMER, MONOMER_A, and MONOMER_B subsystem. The input for the DIMER subsystem is received from the standard inputs above. The calculation assumes the all three subsystems use the same set of atomic orbitals basis.
These options control the sequence the behavior of MC-GF calculations.
The OFF_BAND and NUM_BAND keywords are used in conjunction to specify the range of orbitals that the MC-GF calculation will provide a correction to. The range of orbitals is (LUMO - OFF_BAND, ..., LUMO - OFF_BAND + NUM_BAND - 1).
After preparing an input files, as well as the remaining prerequisite files, launching an MP-MPn calculation may be preformed by the following
<path-to-MP-MPn-executable> <input-file> > <output-file>
To run a parallel MC-MPn job (assuming it was build with an MPI compiler)
mpirun -n <number-of-threads> <path-to-MP-MPn-executable> <input-file> > <output-file>
If the blas library used to build the executable was openblas, the launch line should be prepended with OPENBLAS_NUM_THREADS=1
STDOUT: Basis archiving of the simulation
Trajectory Files: The files archive the trajectory of the simulation. The number of steps in these files is per processor.
The trajectory files will be named as
Two formats are used for these file depending on value of the SAMPLER keyword.
If the direct sampler is used in conjunction with a build that does not use control variate functions were the second (third) and fourth (fifth) columns should be identical.
JSONS: JSON files are currently produced for the MP calculations if the simulation manages to finish. The follow similar naming conventions to the trajectory files.
Self-Energy Matrices: TDB
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
See also the list of contributors who participated in this project.