.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_edos.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_edos.py: Electron DOS ============ This example shows how to compute the DOS from the eigenvalues stored in the WFK file with the gaussian method. .. GENERATED FROM PYTHON SOURCE LINES 9-20 .. code-block:: default import abipy.data as abidata from abipy.abilab import abiopen # Open the wavefunction file computed with a homogeneous sampling of the BZ # and extract the band structure on the k-mesh. with abiopen(abidata.ref_file("si_scf_WFK.nc")) as gs_wfk: gs_ebands = gs_wfk.ebands # Compute the DOS with the Gaussian method (default) edos = gs_ebands.get_edos(method="gaussian", step=0.01, width=0.1) .. GENERATED FROM PYTHON SOURCE LINES 21-22 To plot electron DOS and IDOS with matplotlib use: .. GENERATED FROM PYTHON SOURCE LINES 22-24 .. code-block:: default edos.plot(title="Silicon DOS") .. image:: /gallery/images/sphx_glr_plot_edos_001.png :alt: Silicon DOS :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none
.. GENERATED FROM PYTHON SOURCE LINES 25-26 For the plotly version use: .. GENERATED FROM PYTHON SOURCE LINES 26-28 .. code-block:: default edos.plotly(title="Silicon DOS") .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 29-30 To plot electron DOS and IDOS with matplotlib use: .. GENERATED FROM PYTHON SOURCE LINES 30-32 .. code-block:: default edos.plot_dos_idos(title="DOS and Integrated DOS") .. image:: /gallery/images/sphx_glr_plot_edos_002.png :alt: DOS and Integrated DOS :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none
.. GENERATED FROM PYTHON SOURCE LINES 33-34 For the plotly version use: .. GENERATED FROM PYTHON SOURCE LINES 34-35 .. code-block:: default edos.plotly_dos_idos(title="DOS and Integrated DOS") .. raw:: html


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.255 seconds) .. _sphx_glr_download_gallery_plot_edos.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/abinit/abipy/gh-pages?filepath=notebooks/gallery/plot_edos.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_edos.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_edos.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_