# Mace

> Use when running machine-learning potential calculations with MACE. Load pretrained MACE-MP models, compute energies and forces, and run geometry optimizations on atomistic structures.

- **Type:** Skill
- **Install:** `agentstack add skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-mace`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [WuGroup-XJTLU](https://agentstack.voostack.com/s/wugroup-xjtlu)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [WuGroup-XJTLU](https://github.com/WuGroup-XJTLU)
- **Source:** https://github.com/WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group/tree/main/plugins/mace/skills/mace

## Install

```sh
agentstack add skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-mace
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MACE - Machine Learning Force Fields

## Overview

MACE provides fast, accurate universal machine-learning potentials for atomistic simulations.

## When to Use MACE vs. Other Tools

| Scenario | Recommended Tool | Why |
|---|---|---|
| Fast energy/force evaluation on materials, molecules, or interfaces | **MACE** | Near-DFT accuracy at a fraction of the cost |
| Benchmark-quality energies or electronic properties (DOS, band gaps) | **DFT (PySCF/ASE-DFT)** | MLIPs do not predict electronic structure |
| Very large systems with well-established chemistry | **Classical force fields (GROMACS/LAMMPS)** | Lower overhead and longer time scales |

**Key rule:** Use MACE when you need quantum-like accuracy for geometries and energies but do not need electronic properties.

## Installation

```bash
uv pip install mace-torch
```

## Core Capabilities

### 1. Energy and Forces

```bash
python scripts/run_mace.py water.xyz --task energy --model small --device cpu
```

### 2. Geometry Optimization

```bash
python scripts/run_mace.py water.xyz --task opt --model small --fmax 0.01 --device cpu
```

## Output

Results are printed as JSON to stdout.

## Anti-Patterns (Do Not Do These)

- **Do not use MACE to predict electronic properties.** MACE models energies and forces, not densities of states, band gaps, or charges.
- **Do not assume MACE works for elements outside its training set.** Always check that the model was trained on the elements in your system.
- **Do not ignore device mismatch.** Running large systems on `cuda` with insufficient GPU memory will crash; use `cpu` if unsure.
- **Do not accept an optimization with loose `fmax` for production geometries.** Tight convergence (`fmax <= 0.01`) is standard for reliable structures.

## Best Practices

- Use `device=cpu` unless a compatible GPU with sufficient memory is available.
- The first run downloads the model automatically; ensure internet access or set the cache path via the MACE environment variables.
- Validate MACE predictions against a small DFT or reference dataset for your specific system class before scaling up.
- Start with `medium` model size for production work; `small` is good for quick screening and `large` for maximum accuracy.
- **For questions about the latest MACE models, newly supported options, or version-specific syntax changes, use `WebFetch` on https://mace-docs.readthedocs.io/en/latest/ before answering.**

## Common Errors and Fixes

| Error / Symptom | Likely Cause | Fix |
|---|---|---|
| CUDA out of memory | System too large for GPU | Switch to `device=cpu` or reduce cell size |
| Model download fails | No internet or cache path issue | Check connectivity or set `MACE_CACHE` environment variable |
| "Element X not found in model" | Element outside training set | Use a different model or switch to DFT/classical FF |
| Optimization does not converge | Poor initial structure or `fmax` too tight | Visualize structure, fix clashes, or relax `fmax` slightly |
| Energy seems unphysical | Wrong model or mixed units | Verify model tag and input structure units (Å) |

## References

- **Documentation**: https://mace-docs.readthedocs.io/en/latest/
- **GitHub**: https://github.com/ACESuit/mace
- **Paper (arXiv)**: https://arxiv.org/abs/2206.07697

## Getting Live Information

If the user asks about recently added features, new model releases, or version-specific syntax changes, use `WebFetch` on the official documentation at https://mace-docs.readthedocs.io/en/latest/ before answering.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [WuGroup-XJTLU](https://github.com/WuGroup-XJTLU)
- **Source:** [WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group](https://github.com/WuGroup-XJTLU/cc-skills-ZhenghaoWu-Group)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-wugroup-xjtlu-cc-skills-zhenghaowu-group-mace
- Seller: https://agentstack.voostack.com/s/wugroup-xjtlu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
