.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_hist.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_hist.py: Structural relaxation ===================== This example shows how to analyze the results of a structure relaxation run using the HIST.nc file. .. GENERATED FROM PYTHON SOURCE LINES 9-30 .. rst-class:: sphx-glr-horizontal * .. image:: /gallery/images/sphx_glr_plot_hist_001.png :alt: plot hist :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_hist_002.png :alt: plot hist :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Full Formula (Si1 C1) Reduced Formula: SiC abc : 3.064763 3.064763 3.064763 angles: 60.000000 60.000000 60.000000 Sites (2) # SP a b c cartesian_forces --- ---- ----- ---- ----- ----------------------- 0 C -0 0 -0 [-0. -0. -0.] eV ang^-1 1 Si 0.25 0.25 0.25 [-0. -0. -0.] eV ang^-1 | .. code-block:: default from abipy.abilab import abiopen import abipy.data as abidata # Open the HIST file. # (alternatively one can use the shell and `abiopen.py OUT_HIST.nc -nb` # to open the file in jupyter notebook. hist = abiopen(abidata.ref_file("sic_relax_HIST.nc")) # The structure at the end of the structural relaxation. print(hist.final_structure) # Plot the evolution of the lattice parameters, forces, etotal, ... hist.plot(tight_layout=True) # For the plotly version use: hist.plotly() # Plot the total energy at the different relaxation steps. hist.plot_energies(tight_layout=True) hist.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.558 seconds) .. _sphx_glr_download_gallery_plot_hist.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_hist.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_hist.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_hist.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_