Skip to content

Commit 0886c7f

Browse files
authored
Enhance README with MACE-Field documentation
Added detailed documentation for MACE-Field, including data format, required labels, and training instructions.
1 parent 2601f7a commit 0886c7f

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,99 @@
1+
## MACE-Field: Field-Aware MACE Models
2+
3+
**MACE-Field** extends the MACE architecture to learn **electric-field–dependent properties** of molecules and materials.
4+
In addition to standard **energies, forces, and stresses**, MACE-Field can simultaneously predict
5+
6+
- macroscopic **polarisation**,
7+
- **Born effective charges (BECs)**,
8+
- **polarizabilities**,
9+
10+
as explicit functions of an applied **electric field**.
11+
12+
This makes MACE-Field suitable for finite-field simulations, dielectric response, and field-driven molecular dynamics.
13+
14+
---
15+
16+
## 1. Data format and required labels
17+
18+
MACE-Field is trained from ASE-readable datasets (typically extended XYZ). In addition to the usual structural data, field-aware training requires extra keys.
19+
20+
### 1.1. Required `atoms.info` keys (configuration-level)
21+
22+
- `REF_energy`
23+
Total DFT energy (eV)
24+
25+
- `REF_stress` *or* `REF_virials`
26+
Stress / virials tensor (Voigt-6 or 3×3)
27+
28+
- `REF_electric_field`
29+
Applied electric field vector, shape `(3,)` (V/Å)
30+
31+
- `REF_polarization`
32+
Macroscopic polarisation vector, shape `(3,)` (typically in e/Ų)
33+
34+
- `REF_polarizability`
35+
Polarizability tensor, shape `(3,3)` or flattened `(9,)` (in units of ε₀)
36+
37+
- `head` *(optional)*
38+
Head label, e.g. `"Default"`
39+
40+
### 1.2. Required `atoms.arrays` keys (per-atom)
41+
42+
- `REF_forces`
43+
Atomic forces, shape `(N, 3)` (eV/Å)
44+
45+
- `REF_becs`
46+
Born effective charges, shape `(N, 3, 3)` (units of |e|)
47+
48+
Key names can be overridden from the command line, but the above are the recommended defaults.
49+
50+
---
51+
52+
## 2. Training a MACE-Field model
53+
54+
Training is done via the standard MACE CLI with `--model MACEField` and the `universal_field` loss.
55+
56+
### 2.1. Example training command
57+
58+
```bash
59+
python -m mace.scripts.run_train \
60+
--model MACEField \
61+
--name macefield_model \
62+
--train_file data/field_train.xyz \
63+
--valid_fraction 0.2 \
64+
\
65+
--device cuda \
66+
--default_dtype float32 \
67+
\
68+
--r_max 5.0 \
69+
--num_interactions 2 \
70+
--num_channels 128 \
71+
--max_L 1 \
72+
--correlation 3 \
73+
\
74+
--loss universal_field \
75+
\
76+
--energy_key REF_energy \
77+
--forces_key REF_forces \
78+
--stress_key REF_stress \
79+
--virials_key REF_virials \
80+
--electric_field_key REF_electric_field \
81+
--polarization_key REF_polarization \
82+
--becs_key REF_becs \
83+
--polarizability_key REF_polarizability \
84+
\
85+
--energy_weight 1.0 \
86+
--forces_weight 100.0 \
87+
--stress_weight 1.0 \
88+
--polarization_weight 1.0 \
89+
--becs_weight 1.0 \
90+
--polarizability_weight 1.0 \
91+
\
92+
--batch_size 8 \
93+
--max_num_epochs 50 \
94+
--lr 1e-3
95+
```
96+
197
# <span style="font-size:larger;">MACE</span>
298

399
[![GitHub release](https://img.shields.io/github/release/ACEsuit/mace.svg)](https://GitHub.com/ACEsuit/mace/releases/)

0 commit comments

Comments
 (0)