materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
105 stars 33 forks source link

Downloaded structures differ from structures on Materials Project #881

Closed cote3804 closed 4 months ago

cote3804 commented 4 months ago

Trying to download entry mp-13 (BCC Fe) results in a non-cubic unit cell that differs from the same entry that can be found here

Here is the code:

structure = mpr.get_structure_by_material_id("mp-13")
structure.to_file("POSCAR_API", fmt='poscar')

This writes a POSCAR file that looks like this in VESTA: image

Using the materials project website, the CIF I download looks like this: image

It is not just this one material entry that is giving me this problem. Entry mp-101 also causes issues. Downloading the structure via mp-api gives this structure: image

Whereas using the website I get this structure, which not only has a different unit cell but also includes atoms that the mp-api structure does not. image

I'm using mp-api version 0.39.5 and pymatgen 2024.2.8 with python version 3.9.7

benrich37 commented 4 months ago

Just downloaded the same material by the same method and ran into the same error, currently using version mp-api version 0.33.3

munrojm commented 4 months ago

structure = mpr.get_structure_by_material_id("mp-13", conventional_unit_cell=True) should get you the conventional cubic cell.