K-point Labels of band structure data are missing

Hi. I have been using the following code to download and show a band structure:

   bs = mpr.get_bandstructure_by_material_id(mp_id)
   plot = BSPlotter(bs).get_plot()
   plot.show()

However, it is found that the labels of K-points can not be shown in the band plot.
Furthermore, labels can not be obtained from the k.frac_coords in the following way as before:

   labels = {}
   for k in bs.kpoints:
      if k.label:
         labels[k.label] = k.frac_coords

Are there any changes in Pymatgen or Materials Project on this aspect? Thank you.

Here are some materials IDs without labels of k-points in the band structure data:

mp-755094, mp-757614, mp-19511, mp-774155, mp-1960

On the other hand, there are also materials IDs that have labels of k-points in the band structure data, e.g. mp-19770 (Fe4 O6).

Hello Takeshi.

I also got that problem. It is not clear why it’s happening.
In the meanwhile, the only thing I can suggest you to do is to get back that info from the HighSymmKpath class in this way:

st = rester.get_structure_by_material_id('mp-153')
# high symm points of the kpath
HighSymmKpath(st).kpath
# complete list of kpoint and labels of the kpath
HighSymmKpath(st).get_kpoints()

I’ll get back to you if we fix the problem.

Thanks

1 Like

This problem seems to be still there. However, in the Materials Project webpage, e.g.,
https://materialsproject.org/materials/mp-19511/
the k-point labels are shown, in contrast to that the band structure data of mp-19511, downloaded from the Materials Project, do not have k-point labels.

This bug should be fixed in the new API. You can use it to obtain the band structure in the same way you do with the existing MPRester in pymatgen. Simply use the new MPRester which temporarily lives in the mp-api package. See Materials Project - API for details, including how to obtain a new API key.

– Jason