Hi there,
I tried to get the Materials Project API can also be used to get the magnetic moment of each atom, as shown below:
In [6]: from mp_api.client import MPRester as mpr
...: structure = mpr().get_structure_by_material_id('mp-999516')
...:
...: print(f"Structure: {structure.composition.reduced_formula}")
...: print("\nMagnetic Site Properties:")
...: print(f"{'#':3} {'Element':6} {'magmom':>8}")
...: print("-" * 20)
...:
...: for i, site in enumerate(structure):
...: magmom = structure.site_properties['magmom'][i]
...: print(f"{i:3} {site.specie.symbol:6} {magmom:8.3f}")
...:
...: print("\nMagnetic moments by element:")
...: elements = {}
...: for i, site in enumerate(structure):
...: el = site.specie.symbol
...: magmom = structure.site_properties['magmom'][i]
...: if el not in elements:
...: elements[el] = []
...: elements[el].append(magmom)
...:
...: for el, moments in elements.items():
...: print(f"{el}: {moments}")
...:
Retrieving MaterialsDoc documents: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 12087.33it/s]
Structure: MnP
Magnetic Site Properties:
# Element magmom
--------------------
0 Mn 2.000
1 Mn 2.000
2 P -0.076
3 P -0.076
Magnetic moments by element:
Mn: [2.0, 2.0]
P: [-0.076, -0.076]
As you can see, it doesnβt give the mx, my, mz components as shown on the MAGMOM wiki page.
So, I want to know whether I can get the noncollinear magnetic moment of each atom using the Materials Project API.
See About the available experimental magnetic moment database suitable for vasp's MAGMOM tag. - My Community for the related discussion.
Regards,
Zhao