.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "flow_gallery/run_gwr_g0w0.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_flow_gallery_run_gwr_g0w0.py: GWR flow with convergence studies ================================= This script shows how to compute the G0W0 corrections in silicon. More specifically, we build a flow to analyze the convergence of the QP corrections wrt to the number of bands in the self-energy. More complicated convergence studies can be implemented on the basis of this example. .. GENERATED FROM PYTHON SOURCE LINES 11-97 .. image-sg:: /flow_gallery/images/sphx_glr_run_gwr_g0w0_001.png :alt: run gwr g0w0 :srcset: /flow_gallery/images/sphx_glr_run_gwr_g0w0_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Downloading repository from: https://github.com/PseudoDojo/ONCVPSP-PBE-PDv0.4/archive/refs/heads/master.zip ... Installing ONCVPSP-PBE-SR-PDv0.4 in: /home/runner/.abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 0.00iB [00:00, ?iB/s] 542kiB [00:00, 5.31MiB/s] 1.53MiB [00:00, 3.96MiB/s] 2.89MiB [00:00, 6.45MiB/s] 3.71MiB [00:00, 5.42MiB/s] 5.14MiB [00:00, 7.49MiB/s] 6.08MiB [00:00, 6.96MiB/s] 6.89MiB [00:01, 7.07MiB/s] 7.72MiB [00:01, 6.69MiB/s] 8.46MiB [00:01, 6.41MiB/s] 9.19MiB [00:01, 6.33MiB/s] 9.89MiB [00:01, 6.30MiB/s] 10.5MiB [00:01, 6.28MiB/s] 11.2MiB [00:01, 6.23MiB/s] 11.8MiB [00:01, 5.93MiB/s] 12.4MiB [00:02, 5.82MiB/s] 13.1MiB [00:02, 4.78MiB/s] 13.6MiB [00:02, 4.40MiB/s] 14.6MiB [00:02, 4.60MiB/s] 15.7MiB [00:02, 5.99MiB/s] 16.4MiB [00:02, 5.90MiB/s] 17.1MiB [00:02, 4.97MiB/s] 17.9MiB [00:03, 5.14MiB/s] 19.0MiB [00:03, 6.30MiB/s] 19.7MiB [00:03, 6.14MiB/s] 20.5MiB [00:03, 6.58MiB/s] 21.2MiB [00:03, 6.23MiB/s] 22.0MiB [00:03, 6.67MiB/s] 22.8MiB [00:03, 6.21MiB/s] 23.7MiB [00:03, 6.67MiB/s] 24.4MiB [00:04, 6.92MiB/s] 25.2MiB [00:04, 6.57MiB/s] 25.9MiB [00:04, 6.53MiB/s] 26.6MiB [00:04, 6.16MiB/s] 27.3MiB [00:04, 6.18MiB/s] 27.9MiB [00:04, 6.23MiB/s] 28.6MiB [00:04, 5.92MiB/s] 29.2MiB [00:04, 5.67MiB/s] 29.8MiB [00:04, 5.27MiB/s] 30.6MiB [00:05, 5.47MiB/s] 31.6MiB [00:05, 6.14MiB/s] 32.3MiB [00:05, 5.92MiB/s] 33.0MiB [00:05, 5.73MiB/s] 34.1MiB [00:05, 7.02MiB/s] 34.9MiB [00:05, 6.94MiB/s] 35.6MiB [00:05, 6.66MiB/s] 36.6MiB [00:05, 6.99MiB/s] 37.3MiB [00:06, 6.58MiB/s] 38.0MiB [00:06, 6.63MiB/s] 38.9MiB [00:06, 6.91MiB/s] 39.7MiB [00:06, 6.47MiB/s] 40.3MiB [00:06, 6.27MiB/s] 41.0MiB [00:06, 5.53MiB/s] 41.7MiB [00:06, 4.74MiB/s] 42.9MiB [00:07, 5.20MiB/s] 44.2MiB [00:07, 5.99MiB/s] 45.0MiB [00:07, 6.03MiB/s] 46.3MiB [00:07, 7.30MiB/s] 47.1MiB [00:07, 7.33MiB/s] 47.9MiB [00:07, 6.61MiB/s] 48.6MiB [00:07, 6.32MiB/s] 49.4MiB [00:08, 6.34MiB/s] 50.0MiB [00:08, 6.16MiB/s] 50.7MiB [00:08, 4.62MiB/s] 51.7MiB [00:08, 4.76MiB/s] 52.8MiB [00:08, 5.54MiB/s] 53.9MiB [00:08, 6.55MiB/s] 54.7MiB [00:08, 6.61MiB/s] 55.4MiB [00:09, 6.13MiB/s] 56.1MiB [00:09, 6.25MiB/s] 56.8MiB [00:09, 6.30MiB/s] 57.6MiB [00:09, 6.33MiB/s] 58.4MiB [00:09, 6.62MiB/s] 59.1MiB [00:09, 6.50MiB/s] 59.7MiB [00:09, 6.16MiB/s] 60.5MiB [00:09, 6.57MiB/s] 61.2MiB [00:10, 6.49MiB/s] 61.9MiB [00:10, 6.14MiB/s] 62.5MiB [00:10, 5.57MiB/s] 63.1MiB [00:10, 4.79MiB/s] 64.1MiB [00:10, 5.87MiB/s] 64.9MiB [00:10, 5.69MiB/s] 65.7MiB [00:10, 6.13MiB/s] 66.4MiB [00:10, 5.30MiB/s] 67.4MiB [00:11, 5.63MiB/s] 68.3MiB [00:11, 5.66MiB/s] 69.3MiB [00:11, 4.56MiB/s] 71.1MiB [00:11, 6.70MiB/s] 71.9MiB [00:11, 6.90MiB/s] 72.7MiB [00:11, 6.79MiB/s] 73.5MiB [00:12, 6.13MiB/s] 74.2MiB [00:12, 5.43MiB/s] 75.2MiB [00:12, 5.42MiB/s] 76.5MiB [00:12, 6.90MiB/s] 77.3MiB [00:12, 6.74MiB/s] 78.1MiB [00:12, 6.50MiB/s] 78.8MiB [00:12, 6.37MiB/s] 79.4MiB [00:13, 3.87MiB/s] 81.4MiB [00:13, 5.89MiB/s] 82.5MiB [00:13, 4.39MiB/s] 84.6MiB [00:14, 6.40MiB/s] 85.5MiB [00:14, 5.73MiB/s] 86.8MiB [00:14, 5.62MiB/s] 88.1MiB [00:14, 6.82MiB/s] 89.0MiB [00:14, 6.85MiB/s] 89.8MiB [00:14, 6.73MiB/s] 90.5MiB [00:15, 4.93MiB/s] 92.1MiB [00:15, 6.75MiB/s] 93.0MiB [00:15, 6.18MiB/s] 93.7MiB [00:15, 5.94MiB/s] 94.4MiB [00:15, 5.20MiB/s] 95.5MiB [00:15, 6.03MiB/s] Validating md5 checksums of ONCVPSP-PBE-SR-PDv0.4... Checksum test: OK Installation completed successfully in 18.08 [s] | .. code-block:: Python import os import sys from abipy import abilab, data, flowtk from abipy.flowtk.gwr_works import DirectDiagoWork, GWRSigmaConvWork def build_flow(options): # Working directory (default is the name of the script with '.py' removed and "run_" replaced by "flow_") if not options.workdir: options.workdir = os.path.basename(sys.argv[0]).replace(".py", "").replace("run_", "flow_") # IMPORTANT: Note stringent table to have semi-core states. from abipy.flowtk.psrepos import get_oncvpsp_pseudos pseudos = get_oncvpsp_pseudos(xc_name="PBE", version="0.4", relativity_type="SR", accuracy="stringent") scf_input = abilab.AbinitInput(structure=data.cif_file("si.cif"), pseudos=pseudos) num_ele = scf_input.num_valence_electrons # Global variables. scf_input.set_vars( ecut=6, nband=num_ele // 2, tolvrs=1e-8, paral_kgb=1, ) # IMPORTANT: k-grid for GWR must be Gamma-centered. scf_input.set_kmesh(ngkpt=[2, 2, 2], shiftk=[0.0, 0.0, 0.0]) flow = flowtk.Flow(workdir=options.workdir) # GS-SCF run to get the DEN, followed by direct diago to obtain green_nband bands. green_nband = -1 # -1 this means full diago diago_work = DirectDiagoWork.from_scf_input(scf_input, green_nband) flow.register_work(diago_work) # Build template for GWR. gwr_template = scf_input.make_gwr_qprange_input(gwr_ntau=6, nband=8, ecuteps=4, ecutwfn=2) # Two possibilities: # 1) To change the value of one variable, use: varname_values = ("nband", [8, 12, 14]) # 2) To take the Cartesian product of two or more variables use e.g.: # # varname_values = [ # ("nband", [50, 100]), # ("ecuteps", [2, 4]), # ] # Can also use strings with path to files for den_node and wfk_node # so that one does not need to recompute these files. gwr_work = GWRSigmaConvWork.from_varname_values( varname_values, gwr_template, den_node=diago_work.scf_task, wfk_node=diago_work.diago_task, ) flow.register_work(gwr_work) return flow # This block generates the thumbnails in the AbiPy gallery. # You can safely REMOVE this part if you are using this script for production runs. if os.getenv("READTHEDOCS", False): __name__ = None import tempfile options = flowtk.build_flow_main_parser().parse_args(["-w", tempfile.mkdtemp()]) build_flow(options).graphviz_imshow() @flowtk.flow_main def main(options): return build_flow(options) if __name__ == "__main__": sys.exit(main()) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 18.440 seconds) .. _sphx_glr_download_flow_gallery_run_gwr_g0w0.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: run_gwr_g0w0.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: run_gwr_g0w0.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: run_gwr_g0w0.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_