Skip to content

[Bug]: structure mp-13 returns weird primitive cell inconsistent with that shown on the webpage #1035

@wavyparticle

Description

@wavyparticle

Code snippet

def get_structure_by_id(material_id:str, name:str=None):
    """
    Get the structure of a material by its ID.
    
    Parameters:
    - material_id: The ID of the material to query.
    
    Returns:
    - The structure of the material and its cif file.
    """
    with MPRester(mp_api_key) as mpr:
        structure = mpr.get_structure_by_material_id(material_id, conventional_unit_cell=False)
        
        structure.to(f"{name}_{material_id}.cif" if name else f"{material_id}.cif")
        
    print(f"Structure for {material_id} saved as {name}_{material_id}.cif" if name else f"Structure for {material_id} saved as {material_id}.cif")
        
get_structure_by_id("mp-13", name="Fe")

What happened?

for some reason the c axis from the queried structure (a primitive cell) is 4.05429521 and gamma is 109.46983668, which is inconsistent with those shown here (https://next-gen.materialsproject.org/materials/mp-13?chemsys=Fe)

with conventional_unit_cell=False:
Image

with conventional_unit_cell=True:

Image

right now my workaround is to query the conventional cell and convert it to primitive after which is fine, but figured I should also report the issue

screenshot from page of mp-13

conventional cell

Image

primitive cell

Image

also, if I try to download the primitive cell manually from the website it gives the conventional cell

appreciate any help with this; thanks!

Version

mp-api==0.45.13, pymatgen==2025.10.7

Which OS?

  • MacOS
  • Windows
  • Linux

Log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions