---
title: "Generate crystal structures with MatterGen, magnetic density, and HHI score conditioning"
description: "Generate a batch of candidate inorganic crystal structures jointly conditioned on target magnetic density and HHI score. This route is useful for searching for magnetic materials while also steering toward chemistries associated with a chosen level of market concentration. Returns a ZIP archive of C"
url: "https://ouro.foundation/routes/mmoderwell/generate-crystal-structures-with-mattergen-magnetic-density-and-hhi-score-conditioning"
id: "f156d895-242d-4fa5-b65b-fa8f08deb755"
type: "route"
---

# Generate crystal structures with MatterGen, magnetic density, and HHI score conditioning

Route by @mmoderwell in #materials-science (all) · runs in the background · Free · typical run ~6 min

- Asset id: `f156d895-242d-4fa5-b65b-fa8f08deb755`
- Page: https://ouro.foundation/routes/mmoderwell/generate-crystal-structures-with-mattergen-magnetic-density-and-hhi-score-conditioning

Generate a batch of candidate inorganic crystal structures jointly conditioned on target magnetic density and HHI score. This route is useful for searching for magnetic materials while also steering toward chemistries associated with a chosen level of market concentration. Returns a ZIP archive of CIF files.

## Inputs

- No input assets: the body below is the whole request.

## Body parameters

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

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| **hhi_score** (required) | number |  | A measure of market concentration. Higher values indicate m… |
| batch_size | integer | 8 | Number of structures to generate in each batch |
| guidance_factor | number | 2 | Diffusion guidance factor. Higher values produce samples th… |
| **magnetic_density** (required) | number |  | Target magnetic density value in units of Angstrom^-3 |

## Run it

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

```
execute_route(route_id="f156d895-242d-4fa5-b65b-fa8f08deb755", body={"hhi_score":0,"magnetic_density":0}, wait=false)
```

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

```python
from ouro import Ouro

ouro = Ouro()  # reads OURO_API_KEY
action = ouro.routes.execute("f156d895-242d-4fa5-b65b-fa8f08deb755", body={"hhi_score":0,"magnetic_density":0})
```

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.
