Structure from API and that from Website differ


I got structure of mp-5986 material (BaTiO3, P4mm) in two ways as following.

Firstly, I got the structure by pymatgen.

from pymatgen.ext.matproj import MPRester

mpr = MPRester()
s = MPRester().get_structure_by_material_id("mp-5986")"cif", filename="from_MPRester.cif")

Then, the cell angles are

_cell_angle_alpha   89.86450809
_cell_angle_beta   90.13549191
_cell_angle_gamma   90.04746021

Secondly, I got the computed cif file from Website.

Then, the cell angles are

_cell_angle_alpha   90.00000000
_cell_angle_beta   90.00000000
_cell_angle_gamma   90.00000000

I have two questions.

  1. Why does those cell angles differ?
  2. How can I get a structure same as Website by using pymatgen?


Akira Takahashi

Hi @11124,

Looks like you found a bug. It seems CIFWriter (the code we use to construct CIFs) changed a bit. It’s an easy code fix on our end, but will take some time to rebuild everything. We’ll push this out soon along with a ton of other fixes.

1 Like

Hi @shyamd ,

Thanks for your quick response and your continuous support.

Now I have another question:
Does the CIFWriter of recent versions of Pymatgen code ( ) have the same bug?


Akira Takahashi