.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_phonons_lo_to.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_lo_to.py: Phonon bands with LO-TO from PHBST.nc ===================================== This example shows how to plot the phonon band structure of AlAs including the LO-TO splitting. These resultas tutorial/lesson_rf2.html .. GENERATED FROM PYTHON SOURCE LINES 12-15 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. .. GENERATED FROM PYTHON SOURCE LINES 15-22 .. code-block:: default from abipy.abilab import abiopen import abipy.data as abidata with abiopen(abidata.ref_file("ZnSe_hex_886.out_PHBST.nc")) as ncfile: phbands = ncfile.phbands .. GENERATED FROM PYTHON SOURCE LINES 23-28 Phonon frequencies with non analytical contributions, if calculated, are saved in the anaddb.nc file produced by anaddb. The results should be fetched from there and added to the phonon bands. Notice that all the directions starting from or arriving at gamma that are used in the path should explicitely calculated, even if the values are the same. .. GENERATED FROM PYTHON SOURCE LINES 28-31 .. code-block:: default phbands.read_non_anal_from_file(abidata.ref_file("ZnSe_hex_886.anaddb.nc")) .. GENERATED FROM PYTHON SOURCE LINES 32-34 Plot the phonon frequencies. Note that the labels for the q-points are found automatically by searching in an internal database. .. GENERATED FROM PYTHON SOURCE LINES 34-37 .. code-block:: default phbands.plot(title="ZnSe with LO-TO splitting") .. image:: /gallery/images/sphx_glr_plot_phonons_lo_to_001.png :alt: ZnSe with LO-TO splitting :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none
.. GENERATED FROM PYTHON SOURCE LINES 38-39 For the plotly version, use: .. GENERATED FROM PYTHON SOURCE LINES 39-41 .. code-block:: default phbands.plotly(title="ZnSe with LO-TO splitting") .. raw:: html


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.661 seconds) .. _sphx_glr_download_gallery_plot_phonons_lo_to.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_lo_to.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_phonons_lo_to.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_phonons_lo_to.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_