.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_phonon_fatbands.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_phonon_fatbands.py: Phonon fatbands =============== This example shows how to plot the phonon fatbands of AlAs. See tutorial/lesson_rf2.html .. GENERATED FROM PYTHON SOURCE LINES 9-40 .. rst-class:: sphx-glr-horizontal * .. image:: /gallery/images/sphx_glr_plot_phonon_fatbands_001.png :alt: AlAs phonon fatbands without LO-TO splitting :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_phonon_fatbands_002.png :alt: AlAs phonon fatbands with PJDOS :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_phonon_fatbands_003.png :alt: phonon displacements at $\Gamma$, qpoint = [+0.000, +0.000, +0.000] $\Gamma$ :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_phonon_fatbands_004.png :alt: phonon eigenvectors at $\Gamma$, qpoint = [+0.000, +0.000, +0.000] $\Gamma$ :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_phonon_fatbands_005.png :alt: qpoint = [+0.000, +0.000, +0.000] $\Gamma$, qpoint = [+0.000, +0.000, +0.000] $\Gamma$, qpoint = [+0.000, +0.000, +0.000] $\Gamma$ :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Warning: file /Users/gmatteo/git_repos/abipy/abipy/data/refs/alas_phonons/trf2_5.out_PHBST.nc does not contain atomic_numbers. Particular methods need them!
| .. code-block:: default from abipy.abilab import abiopen import abipy.data as abidata # Open the PHBST file produced by anaddb and get the phonon bands. with abiopen(abidata.ref_file("trf2_5.out_PHBST.nc")) as ncfile: phbands = ncfile.phbands # Plot the phonon band structure with matplotlib. phbands.plot_fatbands(title="AlAs phonon fatbands without LO-TO splitting") # For the plotly version, use: phbands.plotly_fatbands(title="AlAs phonon fatbands without LO-TO splitting") # Provide the PHDOS file path produced by anaddb. # sphinx_gallery_thumbnail_number = 2 phdos_path = abidata.ref_file("trf2_5.out_PHDOS.nc") # Plot the phonon band structure + PJDOS with matplotlib. phbands.plot_fatbands(units="Thz", phdos_file=phdos_path, title="AlAs phonon fatbands with PJDOS") # For the plotly version, use: phbands.plotly_fatbands(units="Thz", phdos_file=phdos_path, title="AlAs phonon fatbands with PJDOS") # Plot contributions to the phonon displacement at the Gamma point grouped by atom type. phbands.plot_phdispl(qpoint=(0, 0, 0), units="meV", title=r"phonon displacements at $\Gamma$") # Plot (orthonormal) eigenvectors instead of displacements. phbands.plot_phdispl(qpoint=(0, 0, 0), use_eigvec=True, units="meV", title=r"phonon eigenvectors at $\Gamma$") # Decompose contributions along the three Cartesian directions. phbands.plot_phdispl_cartdirs(qpoint=(0, 0, 0), units="cm-1") .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.723 seconds) .. _sphx_glr_download_gallery_plot_phonon_fatbands.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_phonon_fatbands.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_phonon_fatbands.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_phonon_fatbands.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_