Plotting cyrstal orbital overlap population obtained from lobster

This example shows how to plot overlap population data See http://www.cohp.de/ for details

import os
import numpy as np
import matplotlib.pyplot as plt
from pdos_overlap.overlap_population import get_example_data
from pdos_overlap.overlap_population import OVERLAP_POPULATION
from pdos_overlap.plotting_tools import set_figure_settings

Load COOPCAR file

First we will, get the example data, load a COOPCAR file and use it to instantiate an OVERLAP_POPULATION object

set_figure_settings('paper')
example_path = get_example_data()
COOPCAR = os.path.join(example_path, 'C2H4/COOPCAR.lobster')

POP = OVERLAP_POPULATION(COOPCAR)

Identify bonding interactions and check for spin

Out:

['No.1:C1->C2(1.3399356553485977)', 'No.2:C1->H3(1.0931450325373071)', 'No.3:C1->H4(1.0932440535076346)', 'No.4:C2->H5(1.093162987441443)', 'No.5:C2->H6(1.0932085731970578)']
True

Obtain projected overlap

We projected orbital overlap for the C-C bond and C-H bonds in C2H4 We group the CH bonds and ensure to sum for spins as all electrons are paired

CC_overlap = POP.get_pcoop(interactions=[0], sum_pcoop=False, sum_spin=True)
CH_overlap = POP.get_pcoop(interactions=[1,2,3,4], sum_pcoop=True, sum_spin=True)

Plot the bonding populaiton with respect to the CC and CH bonds

A positive value on the x-axis indicates are greater proportion of states in in the bond than outside of the bond

plt.figure(figsize=(3,5))
plt.plot(CC_overlap, POP.get_energies(), zorder=3)
plt.plot(CH_overlap, POP.get_energies(), zorder=2)
plt.plot([np.min([CC_overlap, CH_overlap]), np.max([CC_overlap, CH_overlap])]\
         ,[POP.e_fermi, POP.e_fermi],'k--', zorder=1, linewidth=5)
plt.legend(['C-C overlap population','C-H overlap population','fermi level'],loc='best')
plt.xlabel('Orbital overlap')
plt.ylabel('Energy [eV]')
plt.show()
../../_images/sphx_glr_plot_overlap_population_001.png

Out:

C:\Users\lansf\Box Sync\Synced_Files\Coding\Python\Github\pDOS_overlap\examples\plot_overlap_population\plot_overlap_population.py:63: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
  plt.show()

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

Gallery generated by Sphinx-Gallery