Skip to content

mace_polar_1: pass charge/spin keys and use REF_energy/REF_forces#79

Open
lollcat wants to merge 1 commit into
ACEsuit:mainfrom
Angstrom-AI:fix/polar-1-charge-spin-keys
Open

mace_polar_1: pass charge/spin keys and use REF_energy/REF_forces#79
lollcat wants to merge 1 commit into
ACEsuit:mainfrom
Angstrom-AI:fix/polar-1-charge-spin-keys

Conversation

@lollcat

@lollcat lollcat commented Jul 7, 2026

Copy link
Copy Markdown

Problem

mace_polar_1/mace-polar-1-medium.sh and mace-polar-1-large.sh don't pass the charge/spin keys, and set --forces_key='forces'. On OMol .aselmdb data this means:

  • Charge/spin: OMol stores charge/spin under data["charge"] / data["spin"] (surfaced as atoms.info["charge"] / ["spin"]). Without --total_charge_key/--total_spin_key the defaults look for total_charge/total_spin, which are absent, so total_charge/total_spin fall back to 0 / 1every system trains as a neutral closed-shell singlet.
  • Forces: LMDBDataset populates forces under REF_forces. Once mace honors CLI key overrides (companion PR Honor the CLI key specification in LMDBDataset mace#1516), --forces_key='forces' selects the empty atoms.arrays["forces"] and forces load as zero. Reading REF_forces is correct. (On today's mace this override is ignored and forces happen to fall back to REF_forces, so this change is also correct on current mace.)

Fix

Set the key block to match mace_omol/mace-omol.sh:

-    --energy_key='energy' \
-    --forces_key='forces' \
+    --energy_key='REF_energy' \
+    --forces_key='REF_forces' \
+    --total_charge_key='charge' \
+    --total_spin_key='spin' \

Applied identically to the medium and large scripts.

Companion PR

This depends on ACEsuit/mace#1516, which makes LMDBDataset honor the CLI key specification (currently the charge/spin flags are silently ignored for .aselmdb/.lmdb datasets). That PR also documents the forces coupling above.

Order of merge does not matter for correctness, but both are needed for the polar-1 recipes to train with the correct charge/spin conditioning and non-zero forces.

The polar-1 medium/large scripts did not pass --total_charge_key /
--total_spin_key, so on OMol data every system trained as a neutral
closed-shell singlet. They also set --forces_key='forces'; once mace honors
CLI key overrides (ACEsuit/mace#1516) that selects an empty array, so forces
must read 'REF_forces'. Aligns the key block with mace_omol/mace-omol.sh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant