.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_gwr.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_gallery_plot_gwr.py: Visualization of GWR results ============================ This example shows how to visualize the results produced by the GWR code. .. GENERATED FROM PYTHON SOURCE LINES 8-11 .. code-block:: Python from abipy import abilab import abipy.data as abidata .. GENERATED FROM PYTHON SOURCE LINES 12-15 Open the GWR.nc file Here we use one of the GSR files shipped with abipy. Replace filename with the path to your GSR file or your WFK file. .. GENERATED FROM PYTHON SOURCE LINES 15-23 .. code-block:: Python from abipy.electrons.gwr import GwrFile gwr = GwrFile(abidata.ref_file("t01o_DS3_GWR.nc")) print(gwr) kpoint = 0 include_bands = "gap" .. rst-class:: sphx-glr-script-out .. code-block:: none ================================= File Info ================================= Name: t01o_DS3_GWR.nc Directory: /home/runner/work/abipy/abipy/abipy/data/refs/gwr Size: 124.86 kB Access Time: Wed Jan 29 13:41:36 2025 Modification Time: Wed Jan 29 13:35:24 2025 Change Time: Wed Jan 29 13:35:24 2025 ================================= Structure ================================= Full Formula (Si2) Reduced Formula: Si abc : 3.839136 3.839136 3.839136 angles: 60.000000 60.000000 60.000000 pbc : True True True Sites (2) # SP a b c --- ---- ---- ---- ---- 0 Si 0 0 0 1 Si 0.25 0.25 0.25 Abinit Spacegroup: spgid: 227, num_spatial_symmetries: 48, has_timerev: True, symmorphic: True ============================= KS Electron Bands ============================= Number of electrons: 8.0, Fermi level: -0.451 (eV) nsppol: 1, nkpt: 3, mband: 40, nspinor: 1, nspden: 1 smearing scheme: none (occopt 1), tsmear_eV: 0.272, tsmear Kelvin: 3157.7 Direct gap: Energy: 2.454 (eV) Initial state: spin: 0, kpt: [+0.000, +0.000, +0.000], weight: 0.125, band: 3, eig: -0.451, occ: 2.000 Final state: spin: 0, kpt: [+0.000, +0.000, +0.000], weight: 0.125, band: 4, eig: 2.003, occ: 0.000 Fundamental gap: Energy: 0.903 (eV) Initial state: spin: 0, kpt: [+0.000, +0.000, +0.000], weight: 0.125, band: 3, eig: -0.451, occ: 2.000 Final state: spin: 0, kpt: [+0.500, +0.500, +0.000], weight: 0.375, band: 4, eig: 0.451, occ: 0.000 Bandwidth: 11.636 (eV) Valence maximum located at kpt index 0: spin: 0, kpt: [+0.000, +0.000, +0.000], weight: 0.125, band: 3, eig: -0.451, occ: 2.000 Conduction minimum located at kpt index 2: spin: 0, kpt: [+0.500, +0.500, +0.000], weight: 0.375, band: 4, eig: 0.451, occ: 0.000 TIP: Use `--verbose` to print k-point coordinates with more digits =============================== GWR parameters =============================== gwr_task: G0W0 Number of k-points in Sigma_{nk}: 2 Number of bands included in e-e self-energy sum: 40 ecuteps: 4.0 ecutsigx: 4.0 ecut: 4.0 gwr_boxcutmin: 1.1 ============================ QP direct gaps in eV ============================ kpoint kname ks_dirgaps qpz0_dirgaps spin 0 [0.0, 0.0, 0.0] $\Gamma$ 2.454214 3.274460 0 1 [0.5, 0.0, 0.0] L 3.496978 4.281203 0 .. GENERATED FROM PYTHON SOURCE LINES 24-25 Plot Sigma_nk(iw) along the imaginary axis for given k-point. .. GENERATED FROM PYTHON SOURCE LINES 25-27 .. code-block:: Python gwr.plot_sigma_imag_axis(kpoint=kpoint, include_bands=include_bands) .. image-sg:: /gallery/images/sphx_glr_plot_gwr_001.png :alt: $\Sigma_{nk}$ at k-point: $\Gamma$ [+0.000, +0.000, +0.000], spin: 0 :srcset: /gallery/images/sphx_glr_plot_gwr_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 28-29 Plot Sigma_nk(iw) along the real axis for given k-point. .. GENERATED FROM PYTHON SOURCE LINES 29-31 .. code-block:: Python gwr.plot_sigma_real_axis(kpoint=kpoint) .. image-sg:: /gallery/images/sphx_glr_plot_gwr_002.png :alt: $\Sigma_{nk}(\omega)$ at k-point: $\Gamma$ [+0.000, +0.000, +0.000] :srcset: /gallery/images/sphx_glr_plot_gwr_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 32-33 Plot the spectral function A(w) along the real axis. .. GENERATED FROM PYTHON SOURCE LINES 33-35 .. code-block:: Python gwr.plot_spectral_functions() .. image-sg:: /gallery/images/sphx_glr_plot_gwr_003.png :alt: k-point: $\Gamma$ [+0.000, +0.000, +0.000], k-point: L [+0.500, +0.000, +0.000] :srcset: /gallery/images/sphx_glr_plot_gwr_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 36-37 Plot qp-data versus KS energy .. GENERATED FROM PYTHON SOURCE LINES 37-38 .. code-block:: Python gwr.plot_qps_vs_e0() .. image-sg:: /gallery/images/sphx_glr_plot_gwr_004.png :alt: plot gwr :srcset: /gallery/images/sphx_glr_plot_gwr_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.878 seconds) .. _sphx_glr_download_gallery_plot_gwr.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_gwr.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_gwr.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_gwr.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_