---
title: "Magnetic anisotropy energy"
description: "Estimate magnetic anisotropy energy (MAE) across magnetization directions. By default, rejects DFT-unrelaxed inputs (force/stress above threshold); run /dft/structure/relax first or set allow_unrelaxed=true. Useful for permanent-magnet screening and ranking how strongly a material prefers a particul"
url: "https://ouro.foundation/routes/mmoderwell/magnetic-anisotropy-energy"
id: "331d9faf-4b44-4679-a958-5a9a816036e1"
type: "route"
---

# Magnetic anisotropy energy

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

- Asset id: `331d9faf-4b44-4679-a958-5a9a816036e1`
- Page: https://ouro.foundation/routes/mmoderwell/magnetic-anisotropy-energy

Estimate magnetic anisotropy energy (MAE) across magnetization directions. By default, rejects DFT-unrelaxed inputs (force/stress above threshold); run /dft/structure/relax first or set allow_unrelaxed=true. Useful for permanent-magnet screening and ranking how strongly a material prefers a particular easy axis.

## 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 |
| --- | --- | --- | --- |
| method | "perturbation" \| "force_theorem" \| "total_energy" | "perturbation" | How the anisotropy is computed. perturbation (default) and… |
| scf_thr | number | 1e-7 | SCF convergence threshold on the charge-density residual (A… |
| kspacing | number | 0.2 | K-point spacing in 1/Å. The default is finer than the other… |
| 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… |
| directions | string[] \| null | ["001","100","010"] | Magnetization directions to test, named in the crystal's fr… |
| mixing_beta | number \| null |  | Charge mixing step (0–1). Left unset, it is 0.2 for structu… |
| sum_kspacing | number | 0.1 | K-point spacing in 1/Å for the sum of the spin–orbit energy… |
| dft_functional | "PBE" \| "PBEsol" \| "LDA" \| "SCAN" | "PBE" | XC functional |
| allow_unrelaxed | boolean | false | If false (default), reject CIFs whose DFT max force or stre… |
| initial_magmoms | number[] \| null |  | Signed starting moments in µB, one per atom in CIF site ord… |
| sum_smearing_ev | number | 0.1 | Width in eV of the Gaussian occupations in the spin–orbit s… |
| 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="331d9faf-4b44-4679-a958-5a9a816036e1", 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("331d9faf-4b44-4679-a958-5a9a816036e1", 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.
