---
title: "Magnetic ordering (FM vs AFM)"
description: "Decide the collinear magnetic ground state by comparing total energies across enumerated orderings, one SCF each at identical settings. Returns the ground-state ordering (FM / AFM / ferrimagnetic), its net moment and Ms, and the energy margin over the next ordering, plus a magCIF of the ground state"
url: "https://ouro.foundation/routes/mmoderwell/magnetic-ordering-fm-vs-afm"
id: "67393536-da30-4983-9c21-37c9fabbb296"
type: "route"
---

# Magnetic ordering (FM vs AFM)

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

- Asset id: `67393536-da30-4983-9c21-37c9fabbb296`
- Page: https://ouro.foundation/routes/mmoderwell/magnetic-ordering-fm-vs-afm

Decide the collinear magnetic ground state by comparing total energies across enumerated orderings, one SCF each at identical settings. Returns the ground-state ordering (FM / AFM / ferrimagnetic), its net moment and Ms, and the energy margin over the next ordering, plus a magCIF of the ground state and a zip of every candidate so the converged moments can be visualized. Use this rather than reading the sign of site moments from a single SCF: a seeded SCF shows a configuration is stable, not that it is preferred. Supercells are generated when the input cell cannot host an ordering. Costs one SCF per configuration, so screen with cheaper routes first.

## 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/Å |
| 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… |
| strategies | string[] \| null |  | Which families of collinear ordering to enumerate. Defaults… |
| mixing_beta | number \| null |  | Charge mixing step (0–1). Left unset, it is 0.2 for structu… |
| max_orderings | integer | 6 | Cap on configurations to compare. Each one is a full SCF, s… |
| dft_functional | "PBE" \| "PBEsol" \| "LDA" \| "SCAN" | "PBE" | XC functional |
| 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="67393536-da30-4983-9c21-37c9fabbb296", 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("67393536-da30-4983-9c21-37c9fabbb296", 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.
