Hi, I would like to report an error when analyzing LOBSTER. I run an example “2019-01-11-How to plot and evaluate output files from Lobster”, and I found the following error:
from pymatgen.electronic_structure.cohp import CompleteCohp
from pymatgen.electronic_structure.plotter import CohpPlotter
COHPCAR_path = "~Downloads/matgenb-master/notebooks/lobster_data/GaAs/COHPCAR.lobster_new"
POSCAR_path = "~/Downloads/matgenb-master/notebooks/lobster_data/GaAs/POSCAR_new"
completecohp = CompleteCohp.from_file(fmt="LOBSTER", filename=COHPCAR_path, structure_file=POSCAR_path)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
/var/folders/13/76vrjtyn2kgckfh7v76ndv900000gn/T/ipykernel_7768/2589693979.py in <module>
2 POSCAR_path = "~/Downloads/matgenb-master/notebooks/lobster_data/GaAs/POSCAR_new"
3
----> 4 completecohp = CompleteCohp.from_file(fmt="LOBSTER", filename=COHPCAR_path, structure_file=POSCAR_path)
~/miniconda3/lib/python3.8/site-packages/pymatgen/electronic_structure/cohp.py in from_file(cls, fmt, filename, structure_file, are_coops, are_cobis)
744 else:
745 filename = "COHPCAR.lobster"
--> 746 cohp_file = Cohpcar(filename=filename, are_coops=are_coops, are_cobis=are_cobis)
747 orb_res_cohp = cohp_file.orb_res_cohp
748 else:
~/miniconda3/lib/python3.8/site-packages/pymatgen/io/lobster/outputs.py in __init__(self, are_coops, are_cobis, filename)
119 cohp_data = {
120 "average": {
--> 121 "COHP": {spin: data[1 + 2 * s * (num_bonds + 1)] for s, spin in enumerate(spins)},
122 "ICOHP": {spin: data[2 + 2 * s * (num_bonds + 1)] for s, spin in enumerate(spins)},
123 }
~/miniconda3/lib/python3.8/site-packages/pymatgen/io/lobster/outputs.py in <dictcomp>(.0)
119 cohp_data = {
120 "average": {
--> 121 "COHP": {spin: data[1 + 2 * s * (num_bonds + 1)] for s, spin in enumerate(spins)},
122 "ICOHP": {spin: data[2 + 2 * s * (num_bonds + 1)] for s, spin in enumerate(spins)},
123 }
IndexError: index 4751 is out of bounds for axis 0 with size 402