Unusual primitive structure from API

Hello, group members.

I have been experiencing several errors while performing calculations using the API recently. First of all, I am conducting DFT calculations using Quantum ESPRESSO.

Some materials output errors such as lone vector and not orthogonal. Additionally, even for structures that have completed calculations, performing interpolation using BoltzTraP2 results in interpolation being impossible.

In particular, the error that occurs when using BoltzTraP2 is related to irreducible k-points and is an error in failing to properly find symmetry. Of course, I considered that it might be an issue with QE itself, but after looking at the input files, I realized there was another problem.

  1. The atomic structure .cif files downloaded from the Materials Project site and the .cif files of the primitive structure downloaded using the get_primitive option from the API are very different in structure.
  2. In particular, if I do not use the get_primitive option and simply output the structure obtained from structure_summary, the output structure is strange.
    3.The structure obtained from to_conventional() is more similar to the structure provided by the Materials Project compared to the structure obtained from get_primitive.

Could you let me know how get_structure, get_primitive_structure, and to_conventional are connected in structure_summary, where the structure is sourced from, and how it is transformed?

I would appreciate it if you could let me know what might be causing the above questions. I have added a few example files below.

If you look closely, you can see that the atomic position and gamma angle between the two are different.

Be from MP
# generated using pymatgen
data_Be
_symmetry_space_group_name_H-M   'P 1'
_cell_length_a   2.26478265
_cell_length_b   2.26478265
_cell_length_c   3.57410246
_cell_angle_alpha   90.00000000
_cell_angle_beta   90.00000000
_cell_angle_gamma   120.00000000
_symmetry_Int_Tables_number   1
_chemical_formula_structural   Be
_chemical_formula_sum   Be2
_cell_volume   15.87635094
_cell_formula_units_Z   2
loop_
 _symmetry_equiv_pos_site_id
 _symmetry_equiv_pos_as_xyz
  1  'x, y, z'
loop_
 _atom_type_symbol
 _atom_type_oxidation_number
  Be0+  0.0
loop_
 _atom_site_type_symbol
 _atom_site_label
 _atom_site_symmetry_multiplicity
 _atom_site_fract_x
 _atom_site_fract_y
 _atom_site_fract_z
 _atom_site_occupancy
  Be0+  Be0  1  0.33333333  0.66666667  0.75000000  1
  Be0+  Be1  1  0.66666667  0.33333333  0.25000000  1
  • Be_mp-87.cif from API, get_primitive
Be by API, Primitive
# generated using pymatgen
data_Be
_symmetry_space_group_name_H-M   'P 1'
_cell_length_a   2.26478265
_cell_length_b   2.26478265
_cell_length_c   3.57410246
_cell_angle_alpha   90.00000000
_cell_angle_beta   90.00000000
_cell_angle_gamma   119.86323685
_symmetry_Int_Tables_number   1
_chemical_formula_structural   Be
_chemical_formula_sum   Be2
_cell_volume   15.89818514
_cell_formula_units_Z   2
loop_
 _symmetry_equiv_pos_site_id
 _symmetry_equiv_pos_as_xyz
  1  'x, y, z'
loop_
 _atom_site_type_symbol
 _atom_site_label
 _atom_site_symmetry_multiplicity
 _atom_site_fract_x
 _atom_site_fract_y
 _atom_site_fract_z
 _atom_site_occupancy
  Be  Be0  1  0.58304792  0.91695208  0.75000000  1
  Be  Be1  1  0.91695208  0.58304792  0.25000000  1

In addition, the results obtained using the to_conventional command are most similar to the results from the .cif file downloaded from MP. What is the criterion for conventional? Where does this value come from?

Be by API, conventional

generated using pymatgen

data_Be
_symmetry_space_group_name_H-M ‘P 1’
_cell_length_a 2.26478265
_cell_length_b 2.26478265
_cell_length_c 3.57410246
_cell_angle_alpha 90.00000000
_cell_angle_beta 90.00000000
_cell_angle_gamma 120.00000000
_symmetry_Int_Tables_number 1
_chemical_formula_structural Be
_chemical_formula_sum Be2
_cell_volume 15.87635094
cell_formula_units_Z 2
loop

_symmetry_equiv_pos_site_id
symmetry_equiv_pos_as_xyz
1 ‘x, y, z’
loop

_atom_site_type_symbol
_atom_site_label
_atom_site_symmetry_multiplicity
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
Be Be0 1 0.33333333 0.66666667 0.75000000 1
Be Be1 1 0.66666667 0.33333333 0.25000000 1

*** My API codes below,**

import os
from mp_api.client import MPRester


with MPRester("MY API") as mpr:
    structures = mpr.materials.summary.search(
        elements=["Be"],                         
        chemsys="*",                           
        energy_above_hull=(0, 0),             
        is_metal=True,
    )

    with open("structure.txt", "w") as file:
        file.write(f"Number of documents: {len(structures)}\n\n")          

        if not structures:
            file.write("No results found.\n")
        else:
            for idx, structure_summary in enumerate(structures):
                material_id = structure_summary.material_id                     
                formula = structure_summary.formula_pretty                      
                E_Hull = structure_summary.energy_above_hull                   
#                Is_Metal = structure_summary.is_metal                        
#                stable = structure_summary.is_stable                          
#                crystal = structure_summary.structure                          
                sym = structure_summary.symmetry                               

                structure = mpr.get_structure_by_material_id(material_id)       
#                primitive_cell = structure.get_primitive_structure()           
                conventional_cell = structure.to_conventional()         

Hi @Minju, does this thread help answer your question?

Hi, @tschaume!

Of course, I already read that thread and I forgot to leave some reference on it. I’ve used the conventional_cell option after seeing that.

However, what I don’t quite understand is why the primitive cell outputs such an odd structure. Hmm… For example, if it’s the same Be (HCP, P6_3/mmc) structure, I think everyone would agree that any shape of primitive cell would still constitute the same bulk Be of the HCP structure. However, if the existing bulk cell already possesses sufficient symmetry, I don’t think there should be any significant symmetry errors when splitting it into a primitive cell. (Of course, since I am still not well-versed in this area, I might be thinking too simplistically! If that is the case, please do point it out to me!)

Anyway, it seems that the primitive cell obtained from the API has very strange symmetry. Generally, the structures obtained from the MP website (as I mentioned above) guarantee sufficient symmetry, and I have confirmed that Quantum ESPRESSO (QE) captures the appropriate symmetry in calculations using those structures.

Could you possibly provide some information on this? And is get_primitive a function that converts the bulk structure obtained from structure_summary?

This is the structure from API, get_primitive option
image
nks (nuber of irreducible K-points)


As a result of analyzing the same structure using the spglib program, an orthorhombic structure was obtained, not HCP.

Check nks by using spglib.
image

Fig. below is from Nex-gen Materials Project.
image
nks, even much dens K-points, nks is less then before


In this time, it was analyzed that the structure is perfectly HCP.
image
Same number of nks while symmetry is perfect.
image

Thanks.
Best regards,
Minju

Irreducible_kpts.py (728 Bytes)