You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The testing code below is adapted from my example here:
frommp_api.clientimportMPResterfrompymatgen.symmetry.analyzerimportSpacegroupAnalyzerfromatomate2.vasp.flows.mpimportMPGGADoubleRelaxMakerfromatomate2.vasp.powerupsimport (
update_user_incar_settings,
update_user_potcar_functional,
)
fromjobflowimportrun_locally# Set POTCAR functionaluser_potcar_functional="PBE_64"# Get structure from MPmaterial_id="mp-126"withMPRester() asmpr:
# First get the task id from the materials docmaterials=mpr.materials.search(material_ids=[material_id], fields=["task_ids"])
task_id=materials[0].task_ids[0]
# Now get the calculation that includes MAGMOM settingstasks=mpr.materials.tasks.search(task_ids=[task_id],
fields=["input.incar", "calcs_reversed"])
# Get the INCAR settings from the calculationincar_settings=tasks[0].calcs_reversed[0].input.incar# Get the structure and convert to conventional cellstructure=mpr.materials.get_structure_by_material_id(material_id)
structure=SpacegroupAnalyzer(structure).get_conventional_standard_structure()
# Convert MAGMOM list to dictionary format#if "MAGMOM" in incar_settings:# print("Original MAGMOM settings:", incar_settings["MAGMOM"])# print("Number of sites in structure:", len(structure))# # # Get unique species list# species_list = [site.species_string for site in structure]# unique_species = sorted(set(species_list))# print("Unique species in structure:", unique_species)# # # Set all species to the first MAGMOM value from the original calculation# magmom_dict = {specie: incar_settings["MAGMOM"][0] for specie in unique_species}# incar_settings["MAGMOM"] = magmom_dict# print("MAGMOM dictionary:", magmom_dict)# Create a simple flow with just the relaxflow=MPGGADoubleRelaxMaker().make(structure)
# Update POTCAR settingsflow=update_user_potcar_functional(flow, user_potcar_functional)
# Update INCAR settingsflow=update_user_incar_settings(flow, incar_settings)
# Run the flowresponses=run_locally(flow, create_folders=True, ensure_success=True)
But the above code will trigger the following error:
Is there a proper way to handle MAGMOM settings when copying from MP calculations without requiring further user adjustment, say, the one done by the code snippet Convert MAGMOM list to dictionary format shown above?
The testing code below is adapted from my example here:
But the above code will trigger the following error:
Is there a proper way to handle
MAGMOM
settings when copying from MP calculations without requiring further user adjustment, say, the one done by the code snippetConvert MAGMOM list to dictionary format
shown above?See materialsproject/atomate2#1049 for the related discussion.
Regards,
Zhao
The text was updated successfully, but these errors were encountered: