romerogroup / pyprocar

A Python library for electronic structure pre/post-processing
GNU General Public License v3.0
172 stars 76 forks source link

pyprocar.bandsplot is not working #96

Open Davidmp26 opened 1 year ago

Davidmp26 commented 1 year ago

Hello everyone,

I have problems when I try to plot bands of a 2d system. Here is my input:

pyprocar.bandsplot('PROCAR',outcar='OUTCAR',elimit=[-6,6],mode='plain',color='blue',kpointsfile='KPOINTS',kdirect=False)

then I get the following:

Script initiated... PROCAR repaired. Run with repair=False next time. code : vasp input file : PROCAR mode : plain spin comp. : 0 atoms list : [-1] orbs. list : [-1] fermi energy : None energy range : [-6, 6] 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$', '$A$', '$L$', '$H$', '$A|L$', '$M|H$', '$K$', '$H_2$'] kticks : [0, 79, 159, 239, 319, 399, 479, 559, 639, 719, 799] discont. list : [559, 639] Fermi energy : -1.6572 eV (from OUTCAR) spd shape : (18, 80, 2, 11, 11) [kpoints, bands, spins, atoms+1, orbitals+2] Traceback (most recent call last): File "", line 1, in 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 64, in plotBands ax.plot(x, y, "r-", marker=marker, markersize=size, color=color) File "/home/dell/anaconda3/lib/python3.9/site-packages/matplotlib/axes/_axes.py", line 1632, in plot lines = [self._get_lines(args, data=data, **kwargs)] File "/home/dell/anaconda3/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 312, in call yield from self._plot_args(this, kwargs) File "/home/dell/anaconda3/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 498, in _plot_args raise ValueError(f"x and y must have same first dimension, but " ValueError: x and y must have same first dimension, but have shapes (16,) and (18, 80)

Also, my KPOITNS file is:

80 ! 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

0.000000 0.000000 0.000000 ! GAMMA 0.000000 0.000000 0.500000 ! A

0.000000 0.000000 0.500000 ! A 0.500000 0.000000 0.500000 ! L

0.500000 0.000000 0.500000 ! L 0.333333 0.333333 0.500000 ! H

0.333333 0.333333 0.500000 ! H 0.000000 0.000000 0.500000 ! A

0.500000 0.000000 0.500000 ! L 0.500000 0.000000 0.000000 ! M

0.333333 0.333333 0.500000 ! H 0.333333 0.333333 0.000000 ! K

0.333333 0.333333 0.000000 ! K 0.333333 0.333333 -0.500000 ! H_2

Can someone help me? Please

lllangWV commented 1 year ago

Hello David,

If you could, could you try to install the master branch on github. We have made some changes since then, so the newer version may be able to resolve this issue.

In the newer version, now all you have to do is specify the dirname and code to use

Ex. pyprocar.bandsplot( code='vasp', mode='plain', dirname=path_to_bands_calc_dir)

Tell me if this worked, otherwise, it is a different issue we have to solve

Logan Lang