This example shows how to analyze the COHPCAR file produced by Lobster code <http://schmeling.ac.rwth-aachen.de/cohp/>

Use abiopen.py FILE with –expose or –print for a command line interface and –notebook to generate a jupyter notebook.

  • GaAs COHP
  • GaAs integrated COHP
  • COHP total overlap for site index 0
  • COHP with orbital projections from site index 0


Creating temporary file: /var/folders/nc/k69spyd12qv2tk3stk2xrxg40000gr/T/tmpjy3kv2_xGaAs_COHPCAR.lobster

COHP: Number of energies: 401, from -14.035 to 6.015 (eV) with E_fermi set 0 (was 2.298)
has_partial_projections: True, nsppol: 1
Number of pairs: 2
[0] Ga@0 --> As@1
[1] As@1 --> Ga@0

<Figure size 640x480 with 1 Axes>

import os
import abipy.data as abidata

from abipy.abilab import abiopen

dirpath = os.path.join(abidata.dirpath, "refs", "lobster_gaas")
filename = os.path.join(dirpath, "GaAs_COHPCAR.lobster.gz")

# Open the COHPCAR.lobster file (same API for COOPCAR.lobster)
cohp_file = abiopen(filename)

# Plot COHP.
cohp_file.plot(title="GaAs COHP")

# Plot integrated COHP.
cohp_file.plot(what="i", title="GaAs integrated COHP")

# Plot total overlap for all sites listed in `from_site_index`
cohp_file.plot_site_pairs_total(from_site_index=[0], title="COHP total overlap for site index 0")

# Plot partial crystal orbital projections for all sites listed in `from_site_index`
cohp_file.plot_site_pairs_partial(from_site_index=[0], title="COHP with orbital projections from site index 0")

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

Gallery generated by Sphinx-Gallery