Discrepancy in crystal structure of materials queried from materials project using pymatgen

Hello,

I am querying materials project data using pymatgen using the following code.

from pymatgen.ext.matproj import MPRester

with MPRester(api) as mpr :
docs = mpr.summary.search(material_ids=[“mp-1080714”])

print(docs)

As an example I am querying data for the material with id mp-1080714. The queried structure data from this code is completely incorrect. This material has tetragonal crystal structure but the cell angles are 154.9, 154.9 and 35.6 degrees, all of which should be 90 degree. This structure data does not match with the crystal structure information provided in the materials project website.

This discrepancy in crystal structure is not limited only for this material id.
In fact , I have queried 4453 cubic materials, 3322 tetragonal , 6002 orthorhombic and 2740 hexagonal materials. But the angles are correct only for 1433 cubic, 1253 tetragonal, 1959 orthorhombic and 3 hexagonal materials. The reason for this discrepancy is totally unclear to me. Any help or suggestions are highly appreciated.

Thanks,
Sourav

I think you’re looking at the primitive structure but want the conventional structure.
You can use SpacegroupAnalyzer to go from one to the other:

from pymatgen.symmetry.analyzer import SpacegroupAnalyzer 

SpacegroupAnalyzer(docs[0].structure).get_conventional_standard_structure().lattice.angles
>>> (90.0, 90.0, 90.0)

That gives the angles you’re looking for.

@souravmal Thanks for the question!
There was a similar post from before. Please refer to the answer there.

1 Like

Thank you very much ! Thanks for the code. Now I have understood where the confusion was.

Thank you very much !