molgw short manual

molgw: What is it?

molgw is a code that implements the many-body perturbtation theory (MBPT) to describe the excited electronic state in finite systems (atoms, molecules, clusters).
It most importantly implements the GW approximation for the self-energy and the Bethe-Salpeter equation for the optical excitations.

molgw comes with a fully functional density-functional theory (DFT) code to prepare the subsequent MBPT runs.
Standard local and semi-local approximations to DFT are available, as well as several hybrid functionals and range-separated hybrid functionals.
molgw uses a Gaussian-type orbitals basis set so to reuse all the standard quantum-chemistry tools.

In parallel, molgw can straightforwardly calculate systems containing about 100 atoms or, in terms of basis functions, systems requiring about 2000 basis functions.
Larger calculations are of course feasible, but require large computers, lots of memory, and some patience...


molgw requires working Fortran2003 and C compilers.
The code has been extensively tested with gfortran/gcc and with ifort/icc suites.

Some scripts for molgw use Python3, however it is not mandatory.

molgw requires three external libraries:

molgw needs two external libraries to run in parallel:

The machine-specific compilation options are set up in file ~molgw/src/my_machine.arch.
Examples for this file are provided in folder ~molgw/config/.

Note: be careful about compiling Libxc (that contains Fortran modules) with the same Fortran compiler as molgw.

Running the tests

A test suite can be run automatically if Python3 is available. The script is located in ~molgw/tests. It runs both in serial:

$ ./

or in parallel (with 4 cores for instance):

$ ./ --np 4 --mpirun='mpirun'

Some help can be further obtained with

$ ./ --help

Input file

The input file consists of two sections:

The shortest input possible reads

 4    0.0 0.0 0.0  

Then, running in parallel is only possible in conjonction with the resolution-of-identity approximation.
The shortest parallel input possible reads

   auxil_basis='cc-pVDZ'    ! An auxiliary basis is used for the resolution-of-identity (RI)
   no_4center='yes'         ! Trigger the RI approximation for the SCF cycles too
 4    0.0 0.0 0.0  

A slightly longer example:

   ! Formaldehyde
   basis='6-31Gs'           ! This is the Pople basis 6-31G*
   gaussian_type='CART'     ! Pople basis set uses cartesian gaussian functions
   basis_path='./basis/'    ! Path to the folder containing the basis files

   scf='pbe'                ! This is not case-sensitive
   postscf='gw'             ! This is not case-sensitive

   print_w='yes'            ! Request the printing of the SCREENED_COULOMB file
 C       -0.133221    0.000000    0.000000
 H       -0.734800    0.945057    0.000000
 H       -0.734800   -0.945057    0.000000
 O        1.070770    0.000000    0.000000

Other examples can be found in folder ~molgw/tests/.

List of all the input variables

Input variable list

Running the code

If the name of the input file is, then

$ ./molgw > molgw.out

or in parallel

$ mpirun -np 4 ./molgw > molgw.out

Important files

Back to the top of the page