MACE-Field is a field-aware extension of the MACE architecture that enables learning electric-field–dependent energy functionals for molecules and periodic materials. From a single scalar electric enthalpy, MACE-Field exposes physically consistent dielectric response properties via automatic differentiation:
-
Polarization
$\mathbf{P} = -\frac{1}{\Omega},\frac{\partial E}{\partial \mathbf{E}}$ -
Born effective charges (BECs)
$Z^\ast_{\kappa,\alpha\beta} = \frac{\partial P_\alpha}{\partial R_{\kappa,\beta}}$ -
Polarisability/susceptibility
$\chi_{\alpha\beta} = \frac{\partial P_\alpha}{\partial E_\beta}$
All quantities are derivative-consistent (Maxwell relations, acoustic sum rule) by construction.
MACE-Field can be:
- trained from scratch, or
- used to fine-tune existing MACE foundation models to become field-aware.
git clone https://github.com/mdi-group/mace-field.git
pip install ./maceNote
MACE-Field is in the process of being upstreamed into the main MACE repository
ACEsuit#1177
MACE-Field preserves the standard MACE backbone and readout, but injects a uniform electric field (an O(3) irrep 1o) into the latent equivariant features at each interaction layer.
Conceptually:
- Atomic neighbourhoods are expanded into equivariant “multipole-like” features (as in MACE / ACE).
- A global electric field couples to these features through symmetry-allowed Clebsch–Gordan tensor products.
- The final readout remains a scalar energy (electric enthalpy).
- Dielectric observables are obtained by exact differentiation of this scalar.
At zero field, MACE-Field reduces exactly to standard MACE, enabling foundation-weight reuse.
(See Fig. 1 in Martin et al., 2025 for an architectural schematic.)
MACE-Field uses ASE-readable datasets (typically extended XYZ).
| Key | Shape | Units |
|---|---|---|
REF_energy |
scalar | eV |
REF_stress or REF_virials |
(6,) or (3,3) | eV/ų |
REF_electric_field |
(3,) | V/Å |
REF_polarization |
(3,) | e/Ų |
REF_polarizability |
(3,3) or (9,) | e/(V·Å) |
| Key | Shape | Units |
|---|---|---|
REF_forces |
(N,3) | eV/Å |
REF_becs |
(N,3,3) | e |
Key names can be overridden via CLI flags.
Training uses the standard MACE CLI with:
--model MACEField--loss universal_field
python -m mace.scripts.run_train \
--model MACEField \
--name MACEField_model \
--train_file data/field_train.xyz \
--valid_fraction 0.2 \
--device cuda \
--r_max 5.0 \
--num_interactions 2 \
--num_channels 128 \
--max_L 1 \
--loss universal_field \
--energy_weight 1.0 \
--forces_weight 100.0 \
--polarization_weight 1.0 \
--becs_weight 100.0 \
--polarizability_weight 100.0Polarization is multi-valued in periodic systems. During training, MACE-Field compares folded polarization differences, ensuring a branch-invariant loss:
- avoids discontinuities,
- supports ferroelectric distortion paths,
- preserves a conservative derivative definition.
One of MACE-Field’s key strengths is foundation-model inheritance.
You can fine-tune a pretrained MACE model (e.g. mace-mp-0b3) to add polarization, BEC, and polarisability heads.
name: mace-field-mp-0b3-mh
foundation_model: mace-mp-0b3-medium.model
model: MACEField
loss: universal_field
multiheads_finetuning: true
heads:
mp-dielectric:
train_file: becs-polarizabilities-train.xyz
valid_file: becs-polarizabilities-valid.xyz
mp-polarization:
train_file: polarizations-train.xyz
valid_file: polarizations-valid.xyz
pt_train_file: mp_replay.xyz
compute_forces: true
compute_polarization: true
compute_becs: true
compute_polarizability: trueRun:
torchrun --standalone --nproc_per_node=gpu \
python -m mace.scripts.run_train --config config.yamlThis adds dielectric response without degrading the original energy/force accuracy.
from mace.calculators import MACECalculator
calc = MACECalculator(
model_path="MACEField.model",
model_type="MACEField",
electric_field=[0.0, 0.0, 0.02], # overrides per-structure field
)
atoms.calc = calc
E = atoms.get_potential_energy()
P = atoms.calc.results["polarization"]
Z = atoms.calc.results["becs"]
alpha = atoms.calc.results["polarizability"]mace_eval_configs \
--configs input.xyz \
--model MACEField.model \
--output output.xyz \
--compute_polarization \
--compute_becs \
--compute_polarizabilityMACE-Field integrates seamlessly with ASE MD drivers.
atoms.info["REF_electric_field"] = [0.0, 0.0, 0.1]
# Update dynamically if required:
calc.electric_field = [0.0, 0.0, Ez_t]This enables:
- ferroelectric hysteresis loops,
- IR / Raman spectra,
- finite-field response at finite temperature.
- Energy: eV
- Force: eV/Å
- Electric field: V/Å
- Polarization: e/Ų
- BECs: |e|
- Polarisability: e/(V·Å) (often reported in units of ε₀)
If you use this code, please cite:
@misc{martin2025generallearningelectricresponse,
title={General Learning of the Electric Response of Inorganic Materials},
author={Martin, Bradley A. A. and Ganose, Alex M. and Kapil, Venkat and Li, Tingwei and Butler, Keith T.},
year={2025},
eprint={2508.17870},
archivePrefix={arXiv},
primaryClass={cond-mat.mtrl-sci}
}and the main MACE papers:
@inproceedings{Batatia2022mace,
title={{MACE}: Higher Order Equivariant Message Passing Neural Networks for Fast and Accurate Force Fields},
author={Batatia, Ilyes and Kovacs, David Peter and Simm, Gregor N. C. and Ortner, Christoph and Csanyi, Gabor},
booktitle={Advances in Neural Information Processing Systems},
year={2022}
}
@misc{Batatia2022Design,
title = {The Design Space of E(3)-Equivariant Atom-Centered Interatomic Potentials},
author = {Batatia, Ilyes and Batzner, Simon and Kov{'a}cs, D{'a}vid P{'e}ter and Musaelian, Albert and Simm, Gregor N. C. and Drautz, Ralf and Ortner, Christoph and Kozinsky, Boris and Cs{'a}nyi, G{'a}bor},
year = {2022},
eprint = {2205.06643},
archiveprefix = {arXiv}
}- MACE-Field: [email protected]
- MACE core: [email protected]
- Issues & feature requests: https://github.com/mdi-group/mace-field/issues
MACE-Field is released under the MIT License.
(Some upstream MACE models may use different licenses.)
