---
title: "Magnetic moments"
description: "Compute the converged total energy, total and site-projected magnetic moments (Mulliken), site charges, and saturation magnetization (A/m, T = μ₀ Ms, emu/cm³) when available. Set includemagcif for a magCIF with atomsitemoment to view the local moments. Run FM- and AFM-seeded requests at identical se"
url: "https://ouro.foundation/routes/mmoderwell/magnetic-moments"
id: "0a23817e-af47-485a-9c56-5f2df0178b80"
type: "route"
---

# Magnetic moments

Route by @mmoderwell in #materials-science (all) · runs in the background · $0.0003/s (about $0.018/min), held up front and settled on actual runtime · typical run ~4 min

- Asset id: `0a23817e-af47-485a-9c56-5f2df0178b80`
- Page: https://ouro.foundation/routes/mmoderwell/magnetic-moments

Compute the converged total energy, total and site-projected magnetic moments (Mulliken), site charges, and saturation magnetization (A/m, T = μ₀ M_s, emu/cm³) when available. Set include_magcif for a magCIF with _atom_site_moment to view the local moments. Run FM- and AFM-seeded requests at identical settings to compare their total energies. Set soc_axis to include spin–orbit coupling and site orbital moments, which carry a large share of the moment in Co and rare-earth compounds.

## Inputs

- `file` (primary): the id of a file on Ouro (.cif)

## Body parameters

Send only the ones you mean to change; the defaults are tuned.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| scf_thr | number | 1e-7 | SCF convergence threshold on the charge-density residual (A… |
| kspacing | number | 0.3 | K-point spacing in 1/Å |
| soc_axis | "001" \| "100" \| "010" \| "110" \| "111" \| null |  | Run the SCF noncollinear with spin–orbit coupling, moments… |
| hubbard_u | object \| null |  | Turn on DFT+U with an effective U in eV per element, e.g. {… |
| basis_size | "SZ" \| "DZP" \| "TZDP" | "DZP" | LCAO basis size: SZ (fastest), DZP (balanced), TZDP (most a… |
| mixing_beta | number \| null |  | Charge mixing step (0–1). Left unset, it is 0.2 for structu… |
| dft_functional | "PBE" \| "PBEsol" \| "LDA" \| "SCAN" | "PBE" | XC functional |
| include_magcif | boolean | false | Also save the structure with its converged moments as a mag… |
| initial_magmoms | number[] \| null |  | Signed starting moments in µB, one per atom in CIF site ord… |
| smearing_sigma_ev | number | 0.05 | Occupation smearing width in eV (converted to Rydberg for A… |
| reduce_to_primitive | boolean | false | Evaluate the primitive cell instead of the cell as uploaded… |

## Run it

From an agent connected to Ouro MCP (`https://mcp.ouro.foundation/mcp`):

```
execute_route(route_id="0a23817e-af47-485a-9c56-5f2df0178b80", input_assets={"file": "<file id>"}, wait=false)
```

From Python (`pip install ouro-py`):

```python
from ouro import Ouro

ouro = Ouro()  # reads OURO_API_KEY
action = ouro.routes.execute("0a23817e-af47-485a-9c56-5f2df0178b80", input_assets={"file": "<file id>"})
```

The call returns an action id at once. Read the result with `get_action(id=..., wait=true)` over MCP, or `ouro action wait <id>` from the CLI.
