Samthos / MC-MPn-Direct

MIT License
6 stars 4 forks source link

MC-MPn

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.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

In order to build MC-MPn the following are required

  1. Cmake
  2. c++14 compliant compiler
  3. A C BLAS implementation (preferable fast, i.e., openblas, mkl, etc.)
  4. Armadillo
  5. LAPACK: Lapack is required for Armadillo.

For performance, it is optional but highly recommended to use an MPI compiler for multithreading support.

Installing

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

Running MC-MPn

Prerequisites

There are several files needed to run a calculation with MC-MPN

  1. An input file (typically ending in mcin).
  2. The molecular orbital coefficients and molecule orbital energies from an RHF calculation output by NWChem. These are stored in the movecs file.
  3. The molecular geometry stored in the xyz format. The atom specifiers in the XYZ file adopt the atom tag conventions used by NWChem.
  4. The basis set used for the RHF calculation. Basis set files can be found in \<NWChem-source-directory>/src/basis/libraries.
  5. An MC basis set to build the electron-pair importance function.

Notes on NWChem

The should be listed in the output from the NWChem calculation.

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 Set

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.

Keywords

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.

High Level Options

The following are required options. All paths are relative to director where the job is launched.

The following are options technically options, but will be set for nearly every calculation.

Random Number Generation

If the sampler is set to Metropolis the following keywords may be set:

MC-MP Task Options

MC-F12 Task Options

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 Job type Options

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.

GF Job type Options

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).

Running a Calculation

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

Output

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.