Dear users and developers,
I’m interested in extracting materials project relaxation trajectories data using python API. I need to get energy, force, stress and magnetic moments (atom-specific) labels to train machine learning force field (CHGNet). But I couldn’t find any API that’s able to extract magmoms from trajectories.
I note that a previous topic mentioned the related problem of getting the magnetic moments for a given material (relaxed, rather than individual frames of trajectory): https://matsci.org/t/how-to-get-magnetic-moment-of-each-atom-using-the-materials-project-api/1447/4?u=ffarya
I tried the following code
from pymatgen.core.trajectory import Trajectory
trajs = mpr.materials.tasks.get_trajectory(task_ids[-1])
traj = Trajectory.from_dict(trajs[1])
traj.site_properties
But it just gives a list of empty dicts
[{}, {}, {}, {}, {}, {}, {}]
The VASP input for this calculation shows that LORBIT = 11
, so I believe that VASP has magnetic moments information in its output (OUTCAR).
I have the following questions:
- Do the trajectories as stored by materials project usually contain this information? I believe the answer maybe yes, since a notable fraction of structures in the MPTrj datasets have magmom labels (around 18%).
- If the answer is yes, what is the correct way to extract it?
Appreciate any of your help!