I am new to using PyProcar and am getting the following error when trying to plot band-structure using it:
Here is my input:
pyprocar.bandsplot('PROCAR-repaired',outcar='OUTCAR',mode='plain',kpointsfile='KPOINTS')
where my KPOINTS file is:
KPOINTS generated by PyProcar
40 ! Grid points
Line_mode
reciprocal
0.000000 0.000000 0.000000 ! GAMMA
0.500000 0.000000 0.000000 ! M
0.500000 0.000000 0.000000 ! M
0.333333 0.333333 0.000000 ! K
0.333333 0.333333 0.000000 ! K
0.000000 0.000000 0.000000 ! GAMMA
My PROCAR-repaired file is very large (I put only 3 bands of 40 bands):
PROCAR lm decomposed
# of k-points: 18 # of bands: 40 # of ions: 10
k-point 1 : 0.00000000 0.00000000 0.00000000 weight = 0.01000000
band 1 # energy -14.31028158 # occ. 1.00000000
ion s py pz px dxy dyz dz2 dxz x2-y2 tot
1 0.014 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.014
2 0.014 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.014
3 0.080 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.080
4 0.080 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.080
5 0.072 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.073
6 0.072 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.073
7 0.072 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.073
8 0.072 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.073
9 0.072 0.000 0.001 0.001 0.000 0.000 0.000 0.000 0.000 0.073
10 0.072 0.000 0.001 0.001 0.000 0.000 0.000 0.000 0.000 0.073
tot 0.619 0.002 0.005 0.002 0.000 0.000 0.000 0.000 0.000 0.629
band 2 # energy -13.34389563 # occ. 1.00000000
ion s py pz px dxy dyz dz2 dxz x2-y2 tot
1 0.000 0.000 0.007 0.000 0.000 0.000 0.000 0.000 0.000 0.007
2 0.000 0.000 0.007 0.000 0.000 0.000 0.000 0.000 0.000 0.007
3 0.044 0.000 0.002 0.000 0.000 0.000 0.001 0.000 0.000 0.047
4 0.044 0.000 0.002 0.000 0.000 0.000 0.001 0.000 0.000 0.047
5 0.092 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.093
6 0.092 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.093
7 0.092 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.093
8 0.092 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.093
9 0.092 0.000 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.093
10 0.092 0.000 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.093
tot 0.642 0.002 0.018 0.002 0.000 0.000 0.002 0.000 0.000 0.665
band 3 # energy -12.27910796 # occ. 1.00000000
ion s py pz px dxy dyz dz2 dxz x2-y2 tot
1 0.000 0.006 0.000 0.002 0.000 0.000 0.000 0.001 0.001 0.011
2 0.000 0.006 0.000 0.002 0.000 0.000 0.000 0.001 0.001 0.011
3 0.000 0.002 0.000 0.005 0.000 0.000 0.000 0.000 0.001 0.008
4 0.000 0.002 0.000 0.005 0.000 0.000 0.000 0.000 0.001 0.008
5 0.170 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.171
6 0.170 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.171
7 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
8 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
9 0.170 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.170
10 0.170 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.170
tot 0.679 0.015 0.002 0.014 0.002 0.001 0.000 0.002 0.004 0.719
and I get the following:
Script initiated...
PROCAR repaired. Run with repair=False next time.
code : vasp
input file : PROCAR-repaired
mode : plain
spin comp. : 0
atoms list : [-1]
orbs. list : [-1]
fermi energy : None
energy range : [-2, 2]
colormap : jet
markersize : 0.02
permissive : False
vmax : None
vmin : None
grid enabled : True
human : False
savefig : None
title : None
outcar : OUTCAR
k-grid : reduced
knames : ['$\\Gamma$', '$M$', '$K$', '$\\Gamma$']
kticks : [0, 39, 79, 119]
Fermi energy : -1.6624 eV (from OUTCAR)
spd shape : (18, 80, 2, 11, 11) [kpoints, bands, spins, atoms+1, orbitals+2]
with this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dell/anaconda3/lib/python3.9/site-packages/pyprocar/scriptBandsplot.py", line 417, in bandsplot
fig, ax1 = plot.plotBands(
File "/home/dell/anaconda3/lib/python3.9/site-packages/pyprocar/procarplot/procarplot.py", line 103, in plotBands
ticks = [xaxis[x] for x in ticks]
File "/home/dell/anaconda3/lib/python3.9/site-packages/pyprocar/procarplot/procarplot.py", line 103, in <listcomp>
ticks = [xaxis[x] for x in ticks]
IndexError: index 39 is out of bounds for axis 0 with size 18
What could be causing this?
PROCAR-repaired
as a code block $\endgroup$