DGApy is a python package that implements tools for the Matsubara Green's function formalism of correlated electrons on a lattice. Based on the implemented frameworks, the dynamical vertex approximation (DGA) for the Hubbard model, a Feynman diagrammatic extension of dynamical mean field theory (DMFT), can be calculated.
DGApy supports:
- All primitive lattices
- General tight-binding models
- DGA calculations for the Hubbard model
- Solving the linearized Eliashberg equation to obtain superconducting eigenvalues
- Calculation of the optical conductivity, including ladder-like vertex corrections
- Analytic continuation of Matsubara Green's functions and physical susceptibilities to the real axis
A detailed description of the underlying theory and applications to nickelate and cuprate superconductors can be found in my PhD thesis.
Relevant and related literature:
- Original derivation of DGA
- Asymptotic corrections for improved frequency convergence
- Maximum entropy analytic continuation
- DMFT impurity solver
In case you use this code, please cite it. Please also consider citing my thesis and the relevant papers. A bibtex file (dga_bib. md) containing all the references is included in the root directory for your convenience.
DGApy has already been successfully used in several scientific publications:
- S. Di Cataldo, P. Worm et al.; arXiv preprint
- P. Worm et al.; arXiv preprint
Before installation fetch the repository via
git clone git@github.com:PaulWorm/DGApy.git
We recomment to use anaconda for managing your python environments. To create a new conda environment use
conda create --name dga_py python=3.9
Activate the environment:
conda activate dga_py
Before installation of the code install mpi4py using the conda environment:
conda install -c conda-forge mpi4py mpich
which provides the MPICH MPI implementation and the python package mpi4py. Then go into the dga folder and install the code:
cd ./dga
. install.sh
This provides the python package dga and several command line interfaces. A detailed description of them is provided below and in the tutorial "04RunningTheCode.md".
To use the dga python package, import it via
import dga.<submodule name>
The package is split into several modules. Here we list the most common ones:
- matsubara_frequencies (mf): handle Matsubara frequencies and frequency transformations
- brillouin_zone (bz): handle the Brillouin zone, mapping into the irreducible BZ and mapping to k-paths
- wannier: handle the tight-binding Hamiltonian and fourier transformation from real to reciprocal space
- two_point (twop): classes for the one-particle Green's function and self-energy
- local_four_point (lfp): handle local (impurity) four-poin functions
- four_point (fp): handle non-local (ladder) four-point functions
- analytic_continuation (ac): perform the numeric analytic continuation
- based on the ana_cont package
- eliashberg_equation (eq): power iteration eigenvalue solver for the linearized Eliashberg equation
- optics: calculate the optical conductivity
It is recommended to complete the tutorial, contained in the "tutorial" folder, to get a first impression on how the modules can be used.
With this python package also a command line interface (cli) is provided. Contrary to the different modules, which are intended to be used as a toolbox, the cli implements the dynamical vertex approximation for the Hubbard model.
Create the default config file for dga_main in the current folder.
To run a dga calculation perform the following steps:
- Prepare a config file
- Prepare the DMFT input files
- Run the dga_main cli
For the DMFT input file structure currently two input formats are supported.
Either the output of the w2dynamics code.
- '1p-data.hdf5': converged dmft solution
- 'g4iw_sym.hdf5': symmetrized output (cli: sym1b) of the measurement of the two-particle Green's function for the same anderson impurity model as obtained from the DMFT cycle; it is advised to use the same chemical potential (mu) as in the '1p-data. hdf5' file and not perform a new mu search.
If you are not using w2dynamics and you do not want to implement a parser to your impurity solver a generic input format is also supported, which uses a single numpy file:
- fname_1p: 'dmft_input.npy': numpy dictionary with the following entries:
- 'giw': one-particle Green's function
- 'siw': self-energy
- 'n': occupation
- 'mu_dmft': chemical potential
- 'beta': inverse temperature
- 'u': on-site Hubbard interaction
- 'g4iw_dens': density-channel (upup + updown) two-particle Green's function; (w,v,vp) layout
- 'g4iw_magn': magnetic-channel (upup - updown) two-particle Green's function; (w,v,vp) layout
Run the test suite in the terminal. This will run the unit tests and linting.
To run the unit tests, run
dga_test
This will run unit tests and linting which are also included in the gitlab CI.
Several tests use datasets generated with w2dynamics. They input files are contained in the default input structure in the "tests" folder.
A standard documentation is still under construction. For now the tutorial in the " tutorial" folder is the best source for learning how to use the code.
This package has been developed by Paul Worm. If you have any questions feel free to contact me via e-mail.
I would like to thank Simone Di Cataldo and Juraj Krisnik for testing the Code and providing valuable feedback.