﻿# NequIP atom types are model indices, not atomic numbers

Preserve NequIP chemical-species to model-type mapping, type-name order, custom labels, and external simulator type correspondence in atomistic deployments.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-nequip-chemical-species-model-type-mapping/
Language: en

## Integer compatibility can hide a species swap

An atomistic deployment may export chemical elements as integers and pass them directly into a trained NequIP model. The numeric dtype matches, but model type indices need not equal atomic numbers. An unnoticed mapping error can attach a learned species representation to the wrong atom.

The [NequIP transform reference](https://nequip.readthedocs.io/en/latest/api/data_transforms.html) explicitly describes a chemical-species-to-atom-type mapper. Use the mapping associated with the trained artifact rather than constructing a new ordering from the current input subset.

## Type names define an ordered model vocabulary

The model operates on abstract type indices with corresponding names. Those names can match chemical symbols in a common configuration, but custom names require an explicit relationship to source species. Matching spelling in a display table does not determine index order.

A system containing only a subset of trained species should retain the original model map. Renumbering the subset locally can change the meaning of every index while preserving a compact and apparently valid input tensor.

## External simulators introduce another type domain

The [LAMMPS integration guide](https://raw.githubusercontent.com/mir-group/pair_nequip_allegro/main/README.md) describes mapping simulator atom types to the model type names in their declared order. Simulator type identifiers are therefore another coordinate system, not an alternative spelling of atomic number.

Store a table containing source species, simulator type, and model type name/index. The [tensor-axis guide](/journal/tensor-axes-batch-sequence-hidden/) explains why numerically compatible indexing domains must remain semantically distinct.

## Saved configuration belongs with the parameters

The [saved-model reference](https://nequip.readthedocs.io/en/latest/api/save_model.html) explains packaged model interfaces. Preserve type metadata when exporting or compiling a trained artifact; a weight matrix alone cannot explain which chemical identity each embedding row represents.

If an adapter renames types, make that transformation explicit and test the full map. A renamed label is harmless only when every associated lookup and external interface continues to refer to the intended species.

## Check identity before diagnosing force errors

Inspect a small structure with distinguishable elements and trace each atom through the complete mapping. Confirm that unsupported species are reported rather than silently reassigned to an existing type.

The [artifact validation guide](/journal/safetensors-artifact-validation/) supports retaining the mapping with model provenance. Correct species assignment is a prerequisite for interpreting predictions; it does not establish accuracy for an unseen chemical environment or experimental validity of a subsequent simulation.
