Accurate many-body perturbation theory calculations of the electronic structure of molecules
Fortran Forth Python C++ Makefile
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Many-body perturbation theory for atoms, molecules, and clusters

Getting started

This is a minimalistic README file. Many more details can be found ~/docs/molgw_manual.html or on the web site


MOLGW implements the following schemes:

  • Hartree-Fock
  • LDA (PW, VWN)
  • GGA (PBE, PW91, BLYP)
  • potential-only meta-GGA (BJ, RPP)
  • hybrid functionals (PBE0, B3LYP)
  • screened hybrid functionals (HSE03, HSE06)
  • HF+GW
  • DFT+GW
  • Hybrid+GW
  • QPscGW
  • HF+MP2
  • DFT+MP2
  • Hybrid+MP2
  • QPscMP2
  • CI for 2 electrons
  • TD-HF
  • TD-DFT
  • BSE


MOLGW needs Fortran 2003 and C++ compilers. The machine dependent variables should be set in file ~molgw/src/my_machine.arch Examples for this file are given in the folder ~molgw/config/. Then cd ~molgw/src make

Basis sets

More basis sets can be obtained from Basis Set Exchange The file can be generated from a NWChem file using the script ~molgw/utils/ B_aug-cc-pVDZ.nwchem


./molgw > helium.out

Example input files can be found in ~molgw/tests/

Known issues

  • QPscGW scf loop might be quite unstable for large basis sets, use a large eta
  • TD-DFT GGA kernel can induce very large numerical values which limits the numerical stability and breaks some comparison with other codes. Especially when compiling with gfortran/gcc. ifort/icc behaves much better.

Information for developers

Besides the calls to the libint library, MOLGW is entirely written in Fortran2003/2008. The source files can be found in src/.

Coding Rules

The Fortran intent in/out/inout is compulsory for the arguments of a subroutine. One character variable names are discouraged.

The careful developer should try

  • to follow the overall layout and the conventions of the code (double space indent, separation of the list of variables arguments/local, loop counters naming, etc.)
  • to protect the data contained in a module with private or protected attribute as much as possible.
  • to avoid cascading object access, such as a%b%c (Create methods instead)
  • to hide the MPI statements with a generic wrapper in subroutine src/m_mpi.f90.
  • to hide the SCALAPACK statements with a generic wrapper in subroutine src/m_scalapack.f90 (not implemented as of today).

Automatically generated files

A few fortran source files are generated by python scripts:

  • src/basis_path.f90
  • src/revision.f90 are generated by src/ (that is run at each "make" operation) and
  • src/input_variables.f90 is generated by utils/ . Do not attempt to edit the fortran file. You should rather edit the python scripts.

To add a new input variable, append a new variable object in the python list in utils/ Then execute the script. This will generate automatically the Fortran source file src/input_variables.f90 and the HTML documentation file docs/input_variables.html.

Adding a new source file

It requires the manual editing of the src/Makefile. Please check carefully the dependence so to compile and add it to the right "level" of the Makefile. The code should compile properly in parallel with "make -j".


Fabien Bruneval

Service de Recherches de Métallurgie Physique CEA Saclay, F-91191 Gif-sur-Yvette, France