How to get the noncollinear magnetic moment of each atom using the Materials Project API?

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

We don’t perform non-collinear spin calculations for the Materials Project. The formalism for non-collinear spin DFT is very different from collinear spin DFT, and isn’t formally derived in a plane wave basis with PAWs beyond the local density approx. There are some group members in the Materials Project who work on non-collinear spin, and there are comparisons in that paper to some of the Bilbao crystallographic server entries - hope that can help you get started running non-collinear calcs

1 Like