﻿# ASE constrained forces and raw calculator forces are different training targets

ASE constrained forces and raw calculator forces are different training targets. A focused scientific-computing guide with the documented mechanism, a reproducible validation scenario, evidence and operational limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/science-ase-force-constraints-raw-labels/
Language: en

ASE get_forces can return forces adjusted by constraints instead of the raw calculator forces. Both can be valid under different tasks, but they are different training targets. A scientific AI pipeline that collects them under one unnamed force field can create contradictory labels even when the structure and underlying calculator are unchanged.

## The scientific interface

The documented ordinary get_forces call applies constraints by default, with apply_constraint=False exposing raw forces. The molecular-dynamics mode has additional behavior and should not be generalized from the ordinary path without checking its contract. A fixed or otherwise constrained degree of freedom can consequently have a different returned value from the underlying physical calculator response. That adjustment does not mean the raw force was absent or that the model should learn the constrained value for every unconstrained prediction task.

## Implementation details

Define the force target and preserve constraint configuration, selected mode and calculator identity with each example. Keep raw and adjusted arrays under distinct names when both are useful. Validate any relationship to energy targets under the actual scientific formulation rather than assuming all adjusted forces are interchangeable energy derivatives. After filtering or transforming atoms, check that constraints and per-atom labels still refer to the intended degrees of freedom. Do not strip constraint metadata while retaining adjusted labels and then advertise the resulting dataset as universally unconstrained reference forces.

## A constructed validation case

Use a controlled calculator and structure with a constraint that produces a known difference between raw and adjusted forces. Compare the ordinary call and explicitly unadjusted call while preserving the same configuration. Remove or change the constraint in a separate fixture and verify target provenance. Acceptance requires the intended force semantics and atom association, not equality of every returned array or a claim that a smaller constrained force proves better physical relaxation. Keep any molecular-dynamics-specific test separate from this ordinary-call validation.

## Numerical and data limits

This check separates target definitions, not the scientific quality of a potential or the correctness of every constraint. Those need independent validation. Preserve the distinction before training or evaluating AI force models so an application-level adjustment is not mistaken for changed underlying physics or model instability.

## Primary references

[ASE Atoms numerical and structural properties](https://docs.ase-lib.org/ase/atoms.html); [ASE constraints and force adjustment](https://docs.ase-lib.org/ase/constraints.html).

This is a proposed scientific-interface validation, not an executed Retrivium benchmark. Preserve the implementation version and unresolved outcomes; interface documentation does not establish the accuracy or performance of a scientific model.

## Related reading

[CHGNet energy: distinguish per-atom predictions from ASE total energy](/journal/fg2-chgnet-intensive-energy-ase-total-conversion/); [Tensor axes in a language model: batch, sequence and hidden width](/journal/tensor-axes-batch-sequence-hidden/).
