materialsproject / pymatgen

Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
https://pymatgen.org
Other
1.52k stars 867 forks source link

Incorrect handling of projections in Vasprun.get_band_structure #602

Closed utf closed 7 years ago

utf commented 7 years ago

When parsing a hybrid band structure using the Vasprun.get_band_structure() method with linemode=True, the band energies for any k-points that are not zero weighted are ignored.

If the Vasprun object is initialised with parse_projected_eigen=True the projections for each band are also read from the vasp output. However, when running the get_band_structure method, the projections for all k-points are returned, regardless of their k-point weighting.

This means the projections for kpoint_x (e.g. bandstructure.projections[Spin.up][band_n][kpoint_x]) are actually referring to the projections for a different kpoint than the bands at kpoint_x (e.g. bandstructure.bands[Spin.up][band_n][kpoint_x]).

I presume this isn't the correct behaviour?

shyuep commented 7 years ago

@hautierg Can you comment?

utf commented 7 years ago

The fix seems pretty straightforward, I'm quite happy to implement as long as this is definitely a bug and I'm not missing something.

shyuep commented 7 years ago

Thanks. Yes, if you can fix it, it would be great.

hautierg commented 7 years ago

Sounds good to me. Thanks!

On 03 Mar 2017, at 21:23, Shyue Ping Ong notifications@github.com wrote:

Thanks. Yes, if you can fix it, it would be great.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/materialsproject/pymatgen/issues/602#issuecomment-284060860, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3l9-cGxO-MDsdZMISynd5vF6EQDlirks5riHa8gaJpZM4MSfg1.