.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_phonons_msqd.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_phonons_msqd.py: Debye-Waller and generalized phonon DOS ======================================= This example shows how to plot the generalized phonon DOS with the mean square displacement tensor in cartesian coords and how to calculate Debye Waller factors as a function of temperature. See :cite:`Lee1995` for the further details about the internal implementation and :cite:`Trueblood1996` for the different conventions used by crystallographers. .. GENERATED FROM PYTHON SOURCE LINES 13-55 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /gallery/images/sphx_glr_plot_phonons_msqd_001.png :alt: Si0 (3b), O3 (6c) :srcset: /gallery/images/sphx_glr_plot_phonons_msqd_001.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_plot_phonons_msqd_002.png :alt: plot phonons msqd :srcset: /gallery/images/sphx_glr_plot_phonons_msqd_002.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_plot_phonons_msqd_003.png :alt: plot phonons msqd :srcset: /gallery/images/sphx_glr_plot_phonons_msqd_003.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none Creating temporary file: /tmp/tmp327bvks4mp-7000_DDB | .. code-block:: Python import os import abipy.data as abidata from abipy import abilab # Open DDB file for alpha-SiO2 taken from https://materialsproject.org/materials/mp-7000/ filepath = os.path.join(abidata.dirpath, "refs", "mp-7000_DDB.bz2") ddb = abilab.abiopen(filepath) # Invoke anaddb to compute phonon bands and dos. #dos_method = "gaussian" dos_method = "tetra" phbst_file, phdos_file = ddb.anaget_phbst_and_phdos_files(nqsmall=4, dos_method=dos_method, ndivsm=1, mpi_procs=2) # Extract msqd_dos msqd_dos = phdos_file.msqd_dos #print(msqd_dos) #for fmt in ("cartesian", "cif", "ustar", "beta", "B"): for fmt in ("cartesian", "cif"): df = msqd_dos.get_dataframe(temp=300, view="all", fmt=fmt) abilab.print_dataframe(df, title="Format: %s" % fmt) # Plot generalized phonon DOS for each inequivalent atom in the unit cell. msqd_dos.plot() # Plot tensor(T) for each inequivalent atom. msqd_dos.plot_tensor() msqd_dos.plot_uiso() # To save the structure and the U tensor at T=300K in CIF format, use: #msqd_dos.write_cif_file("DW.cif", temp=300) # To visualize the thermal ellipsoids with Vesta, use: #msqd_dos.vesta_open(temp=300) # Remember to close the files. phbst_file.close() phdos_file.close() ddb.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 5.853 seconds) .. _sphx_glr_download_gallery_plot_phonons_msqd.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_phonons_msqd.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_phonons_msqd.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_phonons_msqd.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_