.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_phonons.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_phonons.py: AlAs Phonon bands ================= This example shows how to plot the phonon band structure of AlAs. See tutorial/lesson_rf2.html .. GENERATED FROM PYTHON SOURCE LINES 9-35 .. image:: /gallery/images/sphx_glr_plot_phonons_001.png :alt: AlAs without LO-TO splitting :class: sphx-glr-single-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 PHBST file produced by anaddb and extract the phonon bands object. # (alternatively one can use the shell and `abiopen.py OUT_PHBST.nc -nb` # to open the file in a jupyter notebook. with abiopen(abidata.ref_file("trf2_5.out_PHBST.nc")) as ncfile: phbands = ncfile.phbands # Plot the phonon frequencies. Note that the labels for the q-points # are found automatically in an internal database. phbands.plot(units="cm-1", title="AlAs without LO-TO splitting") # Alternatively you can use the optional argument qlabels # that defines the mapping reduced_coordinates --> name of the q-point. #qlabels = { # (0,0,0): "$\Gamma$", # (0.375, 0.375, 0.7500): "K", # (0.5, 0.5, 1.0): "X", # (0.5, 0.5, 0.5): "L", # (0.5, 0.0, 0.5): "X", # (0.5, 0.25, 0.75): "W", #} # and pass it to the plot method: #phbands.plot(title="AlAs without LO-TO splitting", qlabels=qlabels) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.782 seconds) .. _sphx_glr_download_gallery_plot_phonons.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_phonons.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_phonons.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_phonons.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_