# AI use cases for Mace (ACEsuit/mace)

Repo: [ACEsuit/mace](https://github.com/ACEsuit/mace) | Use cases: 3 | Page: https://dedupedai.com/use-cases/acesuit-mace/

MACE provides fast and accurate machine learning interatomic potentials with higher order equivariant message passing. The package ships command line tools to train (mace_run_train) and evaluate (mace_eval_configs) models on XYZ datasets, and pretrained foundation models such as MACE-MP for materials and MACE-OFF for organic molecules that work as ASE calculators or as a starting point for fine-tuning.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Train a machine learning interatomic potential: https://dedupedai.com/use-cases/acesuit-mace/train-an-interatomic-potential-with-mace/
- Fine-tune a MACE-MP foundation model on your system: https://dedupedai.com/use-cases/acesuit-mace/fine-tune-a-mace-foundation-model/
- Predict energies for a batch of structures: https://dedupedai.com/use-cases/acesuit-mace/evaluate-structures-with-mace-eval-configs/

## How to train a machine learning interatomic potential with Mace

Repo: [ACEsuit/mace](https://github.com/ACEsuit/mace) | Difficulty: Advanced | Time: 1 day | Basis: From the README

Fit a MACE model to your own DFT data with mace_run_train and get loss and RMSE plots at the end.

**Who it is for:** A materials researcher with a set of DFT calculations who needs a faster force field.

**The problem:** DFT is too slow for long molecular dynamics runs.

**The outcome:** A trained .model file plus training curves and scatter plots in the results folder.

### Steps

1. Install with `pip install --upgrade pip` and `pip install mace-torch`
2. Prepare train.xyz and test.xyz, labeling isolated atoms with config_type=IsolatedAtom or using `--E0s="average"`
3. Run mace_run_train with --name, --train_file, --valid_fraction, --test_file, --model="MACE", --r_max=5.0 and the other flags from the README example
4. Use --default_dtype float32 for about a 2x training speed-up and --device=mps on Apple Silicon

### Prompt to paste into your agent

```text
Using ACEsuit/mace, train a model on <my train.xyz> with mace_run_train following the README example flags, and report the final energy and force RMSE on the test set.
```

### Caveat

Batch size and epochs should be adapted to your training set size, as the README explains.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/acesuit-mace/train-an-interatomic-potential-with-mace/

## How to fine-tune a MACE-MP foundation model on your system with Mace

Repo: [ACEsuit/mace](https://github.com/ACEsuit/mace) | Difficulty: Advanced | Time: half a day | Basis: From the README

Start from a pretrained materials model and adapt it to your chemistry with a few epochs of training.

**Who it is for:** A researcher with a small dataset who needs better accuracy than the general model gives.

**The problem:** Training from scratch needs far more data than most projects have.

**The outcome:** A fine-tuned model built on the small, medium or large MACE-MP weights.

### Steps

1. Install with `pip install mace-torch`
2. Run mace_run_train with `--foundation_model="small"` plus your --train_file, --valid_fraction and --test_file
3. Use the README settings such as --E0s="average", --lr=0.01, --batch_size=2 and --max_num_epochs=6 as a starting point
4. Or pass a path with --foundation_model to fine-tune another model; its hyperparameters are extracted automatically

### Prompt to paste into your agent

```text
Using ACEsuit/mace, fine-tune the small MACE-MP foundation model on <my dataset.xyz> with the README fine-tuning flags and compare test errors before and after.
```

### Caveat

Downloaded models are cached in ~/.cache/mace unless XDG_CACHE_HOME is set.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/acesuit-mace/fine-tune-a-mace-foundation-model/

## How to predict energies for a batch of structures with Mace

Repo: [ACEsuit/mace](https://github.com/ACEsuit/mace) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Run a trained or downloaded MACE model over an XYZ file and write the predictions to a new file.

**Who it is for:** A scientist screening many candidate structures.

**The problem:** Running DFT on every candidate structure is too expensive.

**The outcome:** An output XYZ file with model predictions for each configuration.

### Steps

1. Install with `pip install mace-torch`
2. Run mace_eval_configs with --configs="your_configs.xyz", --model="your_model.model" and --output="./your_output.xyz"
3. For single structures in Python, use mace_mp or mace_off from Mace.calculators as an ASE calculator
4. Compare predictions with reference values where you have them

### Prompt to paste into your agent

```text
Using ACEsuit/mace, run mace_eval_configs on <my structures.xyz> with <my model file>, then list the five lowest energy configurations from the output.
```

### Caveat

MACE-MP energies are raw MPTrj DFT energies and are not directly comparable to Materials Project or CHGNet energies with MP2020 corrections.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/acesuit-mace/evaluate-structures-with-mace-eval-configs/
