.. 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 :ref:`Go to the end ` to download the full example code. .. 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-sg:: /gallery/images/sphx_glr_plot_phonon_fatbands_001.png :alt: AlAs phonon fatbands without LO-TO splitting :srcset: /gallery/images/sphx_glr_plot_phonon_fatbands_001.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_plot_phonon_fatbands_002.png :alt: AlAs phonon fatbands with PJDOS :srcset: /gallery/images/sphx_glr_plot_phonon_fatbands_002.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_plot_phonon_fatbands_003.png :alt: phonon displacements at $\Gamma$, qpoint = $\Gamma$ [+0.000, +0.000, +0.000] :srcset: /gallery/images/sphx_glr_plot_phonon_fatbands_003.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_plot_phonon_fatbands_004.png :alt: phonon eigenvectors at $\Gamma$, qpoint = $\Gamma$ [+0.000, +0.000, +0.000] :srcset: /gallery/images/sphx_glr_plot_phonon_fatbands_004.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_plot_phonon_fatbands_005.png :alt: qpoint = $\Gamma$ [+0.000, +0.000, +0.000], qpoint = $\Gamma$ [+0.000, +0.000, +0.000], qpoint = $\Gamma$ [+0.000, +0.000, +0.000] :srcset: /gallery/images/sphx_glr_plot_phonon_fatbands_005.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none Warning: file /home/runner/work/abipy/abipy/abipy/data/refs/alas_phonons/trf2_5.out_PHBST.nc does not contain atomic_numbers. Particular methods need them! | .. code-block:: Python 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 0.991 seconds) .. _sphx_glr_download_gallery_plot_phonon_fatbands.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_phonon_fatbands.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_phonon_fatbands.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_phonon_fatbands.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_