.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_dfpt_cycle.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_dfpt_cycle.py: DFPT SCF cycle ============== This example shows how to plot the results of the DFPT self-consistent cycle reported in the main output file. .. GENERATED FROM PYTHON SOURCE LINES 9-28 .. rst-class:: sphx-glr-horizontal * .. image:: /gallery/images/sphx_glr_plot_dfpt_cycle_001.png :alt: plot dfpt cycle :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_dfpt_cycle_002.png :alt: plot dfpt cycle :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_dfpt_cycle_003.png :alt: plot dfpt cycle :class: sphx-glr-multi-img .. code-block:: default from abipy.abilab import abiopen import abipy.data as abidata # Open the output file with DFPT calculations (Note the .abo extension). # Alternatively, one can use `abiopen.py run.abo -nb` to generate a jupyter notebook. abo = abiopen(abidata.ref_file("refs/gs_dfpt.abo")) # Plot all SCF-GS sections found in the output file. while True: dfpt_cycle = abo.next_d2de_scf_cycle() if dfpt_cycle is None: break dfpt_cycle.plot() # If timopt -1, we can extract the timing and plot the data. #timer = abo.get_timer() #timer.plot_pie() abo.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.800 seconds) .. _sphx_glr_download_gallery_plot_dfpt_cycle.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_dfpt_cycle.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_dfpt_cycle.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_dfpt_cycle.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_