﻿# MD17: coordinate transforms must preserve the energy-force relationship

Prepare MD17 molecular force-learning examples with consistent coordinate, energy and force units, rotating vector targets correctly and validating the force-gradient convention.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-md17-energy-force-coordinate-transform-contract/
Language: en

## Keep scalar and vector targets distinct

The [original force-field paper](https://arxiv.org/abs/1611.04678) develops learning from molecular energies and atomic forces. Energy is a scalar property of a configuration, while each force is a vector associated with a particular atom. A preprocessing pipeline must preserve that association. Flattening all target components into an unlabeled output array makes it easy to change atom order or coordinate conventions without noticing that the physical target has changed.

## Transform vectors with the configuration

A rigid rotation of an isolated molecular configuration should rotate its force vectors consistently while leaving its scalar energy unchanged. Rotating positions alone creates contradictory supervision. Likewise, a permutation of atoms must permute the corresponding target rows and atomic identities together. Test a small transformed configuration before enabling random augmentation across the dataset. A shape-preserving transform can still be physically wrong when only some related tensors are updated.

## Trace the unit chain explicitly

The [PyG MD17 implementation](https://pytorch-geometric.readthedocs.io/en/latest/_modules/torch_geometric/datasets/md17.html) documents its position, energy and force units. A force unit contains both an energy scale and an inverse length scale. Converting positions and energies independently while retaining the old force values breaks that relationship. Record conversions at the loading boundary and verify them on an inspection example. Do not interpret a lower numeric force error as an improvement until the physical units and reduction convention are aligned.

## Check the derivative sign and normalization

For an energy-based model, the force convention involves the negative coordinate derivative of energy. If coordinates or energy are normalized, the derivative chain must restore the appropriate scales. A predictor can fit normalized energies while returning incorrectly scaled physical forces. Compare a small displacement against the expected energy change and use the check to inspect sign, coordinate units and atom ordering. This diagnostic complements target error rather than being replaced by it.

## Separate fitting accuracy from stable dynamics

The [sGDML project](https://www.sgdml.org/) provides the original dataset and modeling context. A low held-out force error does not alone establish accurate long-time simulation behavior; trajectory stability and sampled configurations are additional experimental questions. The existing [entity-group guide](/journal/data-guide-entity-group-split-design/) and [software reproducibility guide](/journal/software-stack-reproducibility/) support related evaluation and environment records. Preserve coordinate transformations, physical units and derivative conventions together so that a reported force-learning score describes a reproducible physical quantity.
