GW ConvergenceΒΆ

This example shows how to use the SigresRobot to visualize the convergence of the QP results stored in the SIGRES.nc files produced by the GW code (sigma run).

  • ../_images/sphx_glr_plot_qpconvergence_001.png
  • ../_images/sphx_glr_plot_qpconvergence_002.png
  • ../_images/sphx_glr_plot_qpconvergence_003.png

Out:

/Users/gmatteo/git_repos/pymatgen/pymatgen/symmetry/bandstructure.py:63: UserWarning: The input structure does not match the expected standard primitive! The path can be incorrect. Use at your own risk.
  warnings.warn("The input structure does not match the expected standard primitive! "
/Users/gmatteo/git_repos/pymatgen/pymatgen/symmetry/bandstructure.py:63: UserWarning: The input structure does not match the expected standard primitive! The path can be incorrect. Use at your own risk.
  warnings.warn("The input structure does not match the expected standard primitive! "
/Users/gmatteo/git_repos/pymatgen/pymatgen/symmetry/bandstructure.py:63: UserWarning: The input structure does not match the expected standard primitive! The path can be incorrect. Use at your own risk.
  warnings.warn("The input structure does not match the expected standard primitive! "
/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/miniconda3/envs/env3.7/lib/python3.7/site-packages/numpy/core/_asarray.py:85: ComplexWarning: Casting complex values to real discards the imaginary part
  return array(a, dtype, copy=False, order=order)
/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 SigresRobot
import abipy.data as abidata

# List of SIGRES files computed with different values of nband.
filenames = [
    "si_g0w0ppm_nband10_SIGRES.nc",
    "si_g0w0ppm_nband20_SIGRES.nc",
    "si_g0w0ppm_nband30_SIGRES.nc",
]

filepaths = [abidata.ref_file(fname) for fname in filenames]

# Build robot from list of file paths
robot = SigresRobot.from_files(filepaths)
#robot.remap_labels(lambda sigres: sigres.params["sigma_nband"])

# Plot the convergence of the QP gaps.
robot.plot_qpgaps_convergence(sortby="sigma_nband", title="QP gaps vs sigma_nband")

# Plot the convergence of the QP energies.
robot.plot_qpdata_conv_skb(spin=0, kpoint=[0, 0, 0], band=3, sortby="sigma_nband")

# sphinx_gallery_thumbnail_number = 3
robot.plot_qpfield_vs_e0("qpeme0", sortby="sigma_nband", title="QP energies vs sigma_nband")

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

Gallery generated by Sphinx-Gallery