*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 616f0f35 authored by Patrick Kappl's avatar Patrick Kappl
Browse files

Document adga.py

parent 8a211985
No related branches found
No related tags found
No related merge requests found
......@@ -6,9 +6,19 @@ import os
# TODO: Exceptions
# TODO: Finish class discription
class Adga(object):
"""A class for abinitio DGA calculations.
This class uses the ADGA project to calculate the non-local self-energy in
the dynamical vertex approximation. It uses DMFT results from w2dynamics as
input. Multiple worm samples in the input file are supported.
The `jackknife` branch of the ADGA repository must be used. The
location of the abinitiodga executable and the symmetrize script are
assumed to be at `adga_root_path`/bin/abinitiodga and
`adga_root_path`/scripts/symmetrize.py respectively.
"""
def __init__(self, adga_root_path, adga_config_file_name,
two_particle_greens_function_file_name):
self.executable = adga_root_path + "/bin/abinitiodga"
......@@ -36,9 +46,14 @@ class Adga(object):
for value_group in value_groups])
return worm_sample_generator
# TODO: Write more detailed docstring
def __call__(self, two_particle_greens_function):
"""Return the self-energy of the 2-particle Green's function."""
"""Return the self-energy of the 2-particle Green's function.
Write the 2-particle Green's function to the file g4iw.hdf5,
which is used as an input file for the symmetrize.py script.
Then do the abinitio DGA calculation and return the non-local
self-energy as a 3D numpy array depending on k_x, k_y and
omega."""
g2 = two_particle_greens_function
# Write g2 to g4iw.hdf5/worm-001
......
......@@ -11,16 +11,16 @@ if len(sys.argv) == 4:
adga_config = sys.argv[2]
two_particle_file = sys.argv[3]
elif len(sys.argv) < 4:
print("""Command line argument missing. Please specify the ADGA root
directory, the configuration file and the 2-particle Green's function
file""")
print("Command line argument missing.")
print("""Please specify the ADGA root directory, the configuration file and
the 2-particle Green's function file""")
sys.exit(1)
else:
print("""Too many command line arguments. Please specify only the ADGA root
directory, the configuration file and the 2-particle Green's function
file""")
print("Too many command line arguments.")
print("""Please specify only the ADGA root directory, the configuration
file and the 2-particle Green's function file""")
sys.exit(2)
abinitio_dga = adga.Adga(adga_root, adga_config, two_particle_file)
x_generator = abinitio_dga.get_worm_sample_generator()
n = abinitio_dga.n_worm_samples
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment