DerekDardzinski / vaspvis

A highly flexible and customizable library for visualizing electronic structure data from VASP calculations.
MIT License
26 stars 13 forks source link

Spin-Polarized Band structure Plotting #3

Open shahid-sattar opened 2 years ago

shahid-sattar commented 2 years ago

Thanks for making vaspvis available, it is indeed very useful. I am trying to plot spin-polarized band structure but it seems that only 1 spin-channel is plotted, using the simple plotting command. What needs to change to plot this correctly? below is a comparison for vaspvis and p4vasp plots. Screenshot from 2021-08-27 14-28-32

DerekDardzinski commented 2 years ago

There is a function in the standard module called band_plain_spin_polarized. In fact, all of the functions have a spin_polarized version.

shahid-sattar commented 2 years ago

alright, thanks for the clarification. I tried using that and it plots up and down channel separately, can they be plotted together?

DerekDardzinski commented 2 years ago

you could do that by:

from vaspvis import standard as st

fig, ax = st.band_plain_spin_polarized( folder='band', up_color='black', down_color='black', up_linestyle='-', down_linestyle='-', save=False, ) ax.get_legend().remove() fig.tight_layout(pad=0.4) fig.savefig('band_plain_sp.png')

shahid-sattar commented 2 years ago

It worked. Thanks a lot! Very useful indeed. Screenshot from 2021-08-27 16-15-21

shahid-sattar commented 2 years ago

Apologies but reverting back on this: I have spin-orbit (LSORBIT=.TRUE.) band structure for which I want to plot band structure projected on different spin-channels (sx, sy, and sz). I am little confuse on which option should be used for this purpose? To be more precise, I want to have a SO projected band structure on different spin-components. Below plot from another code is a reference to how it should look like. Screenshot from 2021-10-08 11-39-51

DerekDardzinski commented 2 years ago

You can set soc_axis='x', soc_axis='y', or soc_axis='z' to project onto the components. It won't be exactly the same as the example you showed, it will look more like the other spin-polarized plots generate with vaspvis.

from vaspvis import standard as st
st.band_plain_spin_polarized(folder='band', soc_axis='z', up_color='red', down_color='blue', sp_scale_factor=5)