Difference in structure with old and new api

Hello all,

I am confused, when I search for “MP-1133” material in the new and old materials project websites, the structure is quite different. The new one has 18 and the old one 9. Even query parameters except thermo return 18 atoms per unit cell. If we want it to be compatible with the old database, shouldn’t it return the same structure?

Thank you for any insight.

Regards,
Asif

@Asif-Iqbal-Bhatti, this can happen when a new calculation is chosen as the “blessed” one for a given material. In this particular case, this structure is from the set of new r2SCAN calculations.

To see which task the structure data is pulled from, you can access the origins field:

from mp_api.client import MPRester

with MPRester("your_api_key") as mpr:
    docs = mpr.materials.search(material_ids=["mp-1133"])

    #[PropertyOrigin(name='structure', task_id=MPID(mp-2048965), last_updated=datetime.datetime(2021, 3, 17, 9, 23, 23, 597000))]
    origin_data = docs[0].origins 
    

All previous structures are still accessible. To get the same structure as before, you can ask for the "blessed_tasks" property from the old API and get the task_id from there. Using that, you can pull from MPRester.tasks.search.

– Jason