# Structural relaxation¶

This example shows how to analyze the results of a structure relaxation run using the HIST.nc file.

Out:

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
/Users/gmatteo/git_repos/pymatgen/pymatgen/util/plotting.py:550: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
plt.show()
/Users/gmatteo/git_repos/pymatgen/pymatgen/util/plotting.py:550: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
plt.show()


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)

# Plot the total energy at the different relaxation steps.
hist.plot_energies(tight_layout=True)

hist.close()


Total running time of the script: ( 0 minutes 0.741 seconds)

Gallery generated by Sphinx-Gallery