.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_ifcs.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_ifcs.py: Interatomic Force Constants ============================ This example shows how to plot the longitudinal part of the Interatomic Force Constants in real-space starting from a DDB file. See e.g. .. GENERATED FROM PYTHON SOURCE LINES 11-34 .. rst-class:: sphx-glr-horizontal * .. image:: /gallery/images/sphx_glr_plot_ifcs_001.png :alt: Total Longitudinal IFCs :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_ifcs_002.png :alt: Longitudinal SR-IFCs :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_ifcs_003.png :alt: Longitudinal LR-IFCs :class: sphx-glr-multi-img .. code-block:: default import os import abipy.data as abidata from abipy import abilab # Open DDB file for AlAs filepath = os.path.join(abidata.dirpath, "refs", "alas_phonons", "trf2_3_DDB") ddb = abilab.abiopen(filepath) # Call anaddb to compute the Interatomic Force Constants # Default args are: asr=2, chneut=1, dipdip=1. ifc = ddb.anaget_ifc() # Plot the total longitudinal IFCs in local coordinates, filtered according to the optional arguments. ifc.plot_longitudinal_ifc(title="Total Longitudinal IFCs") # Plots the short range longitudinal IFCs in local coordinates, filtered according to the optional arguments. ifc.plot_longitudinal_ifc_short_range(title="Longitudinal SR-IFCs") # Plots the Ewald part of the IFCs in local coordinates, filtered according to the optional arguments. ifc.plot_longitudinal_ifc_ewald(title="Longitudinal LR-IFCs") ddb.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.048 seconds) .. _sphx_glr_download_gallery_plot_ifcs.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_ifcs.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_ifcs.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ifcs.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_