romerogroup / pyprocar

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

k-point grid is not automatically spaced properly #91

Closed PyFiSciFi closed 1 year ago

PyFiSciFi commented 1 year ago

When I use the input:

pyprocar.bandsplot(folder + 'PROCAR-rep',outcar=folder+'OUTCAR',elimit=[-.5,.5], mode='plain',code='vasp',kpointsfile=folder+'KPOINTS',repair=False,grid=False)

the figure spaces out the high-symmetry k-points evenly between gamma, X, S, Y, and gamma, but I would not think they should be evenly spaced. (Compare the two images, the first plotted with pymatgen, the second with pyprocar). When I use the manual grid kpoints (with kticks, knames), that only adjusts the vertical line and grid label, but not the data skew. Can this be adjusted? Thank you. band - 5  5 band - 5  5 pyprocar And here is my KPOINTS file:

k-points along high symmetry lines for orthorhombic, z-direction 80 ! 80 intersections Line-mode reciprocal 0.000 0.000 0.000 ! \Gamma 0.500 0.000 0.000 ! X

0.500 0.000 0.000 ! X 0.500 0.500 0.000 ! S

0.500 0.500 0.000 ! S 0.000 0.500 0.000 ! Y

0.000 0.500 0.000 ! Y 0.000 0.000 0.000 ! \Gamma

uthpalaherath commented 1 year ago

Hello,

Can you try using kdirect=False as an argument and see if that helps? With this, one can convert the kgrid from direct to cartesian which makes more sense as that provides an orthogonal axis.

Best, Uthpala

On Thu, Jan 12, 2023 at 3:14 PM PyFiSciFi @.***> wrote:

When I use the input:

pyprocar.bandsplot(folder + 'PROCAR-rep',outcar=folder+'OUTCAR',elimit=[-.5,.5], mode='plain',code='vasp',kpointsfile=folder+'KPOINTS',repair=False,grid=False)

the figure spaces out the high-symmetry k-points evenly between gamma, X, S, Y, and gamma, but I would not think they should be evenly spaced. (Compare the two images, the first plotted with pymatgen, the second with pyprocar). When I use the manual grid kpoints, that only adjusts the vertical line and grid label, but not the data skew. Can this be adjusted? Thank you. [image: band - 5 5] https://user-images.githubusercontent.com/40284493/212169733-f1633a31-1144-41f7-8099-bc523f095ccf.png [image: band - 5 5 pyprocar] https://user-images.githubusercontent.com/40284493/212169768-3c693b86-77bc-4f90-ade2-73857ea57bf4.png And here is my KPOINTS file:

k-points along high symmetry lines for orthorhombic, z-direction 80 ! 80 intersections Line-mode reciprocal 0.000 0.000 0.000 ! \Gamma 0.500 0.000 0.000 ! X

0.500 0.000 0.000 ! X 0.500 0.500 0.000 ! S

0.500 0.500 0.000 ! S 0.000 0.500 0.000 ! Y

0.000 0.500 0.000 ! Y 0.000 0.000 0.000 ! \Gamma

— Reply to this email directly, view it on GitHub https://github.com/romerogroup/pyprocar/issues/91, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3ZXMJXRPFQJPZYWWMJMODWSBQZJANCNFSM6AAAAAATZUXQGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Uthpala Herath Postdoctoral Associate Department of Mechanical Engineering and Materials Science Duke University Durham, NC

Tel. (304) 216-2535 Email: @.*** Website: https://uthpalaherath.github.io/

PyFiSciFi commented 1 year ago

Thank you, and thank you for the quick reply! That works beautifully now.

band - 5  5 pyprocar fixed

uthpalaherath commented 1 year ago

Glad it worked! You're welcome.