<jupyter_start><jupyter_text>Plotting cyrstal orbital overlap population obtained from lobsterThis example shows how to plot overlap population dataSee http://www.cohp.de/ for details<jupyter_code>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<jupyter_output><empty_output><jupyter_text>Load COOPCAR file-----------------First we will, get the example data, load a COOPCAR file and use it toinstantiate an OVERLAP_POPULATION object<jupyter_code>set_figure_settings('paper')
example_path = get_example_data()
COOPCAR = os.path.join(example_path, 'C2H4/COOPCAR.lobster')

POP = OVERLAP_POPULATION(COOPCAR)<jupyter_output><empty_output><jupyter_text>Identify bonding interactions and check for spin------------------------------------------------<jupyter_code>print(POP.interactions)
print(POP.is_spin)<jupyter_output><empty_output><jupyter_text>Obtain projected overlap------------------------We projected orbital overlap for the C-C bond and C-H bonds in C2H4We group the CH bonds and ensure to sum for spins as all electrons are paired<jupyter_code>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)<jupyter_output><empty_output><jupyter_text>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 inin the bond than outside of the bond<jupyter_code>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()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16342592592592592, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 4.84054054054054, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '303883', 'license': 'MIT', 'n_tokens_mistral': 743, 'n_tokens_neox': 706, 'n_words': 164, 'path': 'docs/_downloads/b4085882455c6a618796a7ae48d77c5e/plot_overlap_population.ipynb', 'repo_name': 'JLans/pdos_overlap', 'size': '2160'}