.. 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, 4.63MiB/s] 1.23MiB [00:00, 4.89MiB/s] 1.76MiB [00:00, 3.12MiB/s] 2.81MiB [00:00, 4.65MiB/s] 3.47MiB [00:00, 3.67MiB/s] 4.94MiB [00:01, 5.76MiB/s] 5.72MiB [00:01, 5.96MiB/s] 6.46MiB [00:01, 5.55MiB/s] 7.10MiB [00:01, 4.96MiB/s] 7.66MiB [00:01, 4.77MiB/s] 8.22MiB [00:01, 4.66MiB/s] 8.72MiB [00:01, 4.53MiB/s] 9.26MiB [00:01, 4.33MiB/s] 10.0MiB [00:02, 4.47MiB/s] 10.8MiB [00:02, 5.13MiB/s] 11.5MiB [00:02, 5.21MiB/s] 12.1MiB [00:02, 5.02MiB/s] 12.7MiB [00:02, 5.22MiB/s] 13.3MiB [00:02, 5.04MiB/s] 13.9MiB [00:02, 4.35MiB/s] 14.5MiB [00:03, 3.77MiB/s] 15.6MiB [00:03, 5.31MiB/s] 16.3MiB [00:03, 5.06MiB/s] 16.9MiB [00:03, 4.36MiB/s] 17.8MiB [00:03, 4.77MiB/s] 18.8MiB [00:03, 5.79MiB/s] 19.5MiB [00:04, 5.05MiB/s] 20.3MiB [00:04, 5.39MiB/s] 21.0MiB [00:04, 5.48MiB/s] 21.6MiB [00:04, 5.53MiB/s] 22.2MiB [00:04, 5.42MiB/s] 22.8MiB [00:04, 5.20MiB/s] 23.6MiB [00:04, 5.89MiB/s] 24.3MiB [00:04, 5.73MiB/s] 24.9MiB [00:04, 5.61MiB/s] 25.5MiB [00:05, 5.37MiB/s] 26.1MiB [00:05, 4.91MiB/s] 26.7MiB [00:05, 5.02MiB/s] 27.4MiB [00:05, 4.80MiB/s] 28.2MiB [00:05, 4.60MiB/s] 28.9MiB [00:05, 4.73MiB/s] 29.6MiB [00:06, 4.34MiB/s] 30.6MiB [00:06, 4.83MiB/s] 31.5MiB [00:06, 5.03MiB/s] 32.3MiB [00:06, 5.01MiB/s] 33.0MiB [00:06, 4.83MiB/s] 33.8MiB [00:06, 5.41MiB/s] 34.4MiB [00:06, 5.24MiB/s] 35.2MiB [00:07, 5.54MiB/s] 35.8MiB [00:07, 5.39MiB/s] 36.4MiB [00:07, 5.14MiB/s] 37.0MiB [00:07, 4.95MiB/s] 37.6MiB [00:07, 5.10MiB/s] 38.3MiB [00:07, 5.34MiB/s] 38.9MiB [00:07, 5.42MiB/s] 39.5MiB [00:07, 5.35MiB/s] 40.0MiB [00:08, 5.11MiB/s] 40.6MiB [00:08, 4.15MiB/s] 41.7MiB [00:08, 4.49MiB/s] 42.9MiB [00:08, 4.32MiB/s] 44.2MiB [00:08, 4.86MiB/s] 45.1MiB [00:09, 5.16MiB/s] 46.0MiB [00:09, 5.84MiB/s] 46.7MiB [00:09, 6.04MiB/s] 47.3MiB [00:09, 5.98MiB/s] 48.0MiB [00:09, 5.42MiB/s] 48.6MiB [00:09, 5.02MiB/s] 49.2MiB [00:09, 5.22MiB/s] 49.8MiB [00:09, 5.39MiB/s] 50.5MiB [00:10, 4.01MiB/s] 51.7MiB [00:10, 4.27MiB/s] 52.8MiB [00:10, 4.88MiB/s] 53.7MiB [00:10, 5.48MiB/s] 54.4MiB [00:10, 5.36MiB/s] 54.9MiB [00:10, 5.32MiB/s] 55.5MiB [00:11, 5.10MiB/s] 56.1MiB [00:11, 4.91MiB/s] 56.7MiB [00:11, 4.77MiB/s] 57.3MiB [00:11, 4.60MiB/s] 58.1MiB [00:11, 5.38MiB/s] 58.7MiB [00:11, 5.07MiB/s] 59.2MiB [00:11, 4.71MiB/s] 59.8MiB [00:11, 4.67MiB/s] 60.3MiB [00:12, 4.59MiB/s] 60.9MiB [00:12, 4.58MiB/s] 61.5MiB [00:12, 4.22MiB/s] 62.1MiB [00:12, 3.70MiB/s] 63.1MiB [00:12, 4.33MiB/s] 64.1MiB [00:12, 5.16MiB/s] 64.9MiB [00:13, 5.01MiB/s] 65.7MiB [00:13, 5.48MiB/s] 66.4MiB [00:13, 4.75MiB/s] 67.4MiB [00:13, 4.80MiB/s] 68.3MiB [00:13, 4.84MiB/s] 69.3MiB [00:14, 4.03MiB/s] 71.0MiB [00:14, 5.71MiB/s] 71.8MiB [00:14, 5.81MiB/s] 72.7MiB [00:14, 6.24MiB/s] 73.4MiB [00:14, 5.33MiB/s] 74.1MiB [00:14, 5.50MiB/s] 74.7MiB [00:14, 5.59MiB/s] 75.3MiB [00:15, 4.72MiB/s] 76.5MiB [00:15, 6.09MiB/s] 77.2MiB [00:15, 5.92MiB/s] 77.9MiB [00:15, 5.56MiB/s] 78.5MiB [00:15, 4.65MiB/s] 79.2MiB [00:16, 3.17MiB/s] 81.4MiB [00:16, 5.32MiB/s] 82.5MiB [00:16, 4.12MiB/s] 84.6MiB [00:16, 5.86MiB/s] 85.5MiB [00:17, 5.18MiB/s] 86.7MiB [00:17, 5.09MiB/s] 88.4MiB [00:17, 6.56MiB/s] 89.2MiB [00:17, 6.03MiB/s] 89.9MiB [00:17, 5.95MiB/s] 90.6MiB [00:18, 4.46MiB/s] 91.9MiB [00:18, 5.90MiB/s] 92.8MiB [00:18, 5.65MiB/s] 93.5MiB [00:18, 5.44MiB/s] 94.2MiB [00:18, 5.17MiB/s] 95.5MiB [00:18, 5.09MiB/s] Validating md5 checksums of ONCVPSP-PBE-SR-PDv0.4... Checksum test: OK Installation completed successfully in 20.66 [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 20.998 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 `_