Note
Click here to download the full example code or to run this example in your browser via Binder
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
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()
Total running time of the script: ( 0 minutes 0.558 seconds)