AtomicSystem.elements#

property AtomicSystem.elements#

Return a mapping of atom types to their elemental symbols (read-only).

The element is inferred from the atom type’s mass. A type whose mass matches no element within ELEMENT_MASS_TOLERANCE is left out of the mapping rather than assigned the nearest entry: an element is not something this can always know.

That happens in two situations. A united-atom force field folds apolar hydrogens into their carbon, so GROMOS CH3 weighs 15.035 and the nearest element is oxygen – the information needed to say “carbon” is simply not in the mass. And an element absent from the internal table (hydrogen through bismuth, plus thorium, protactinium and uranium; the other radioactive elements have no unambiguous mass) would otherwise be reported as the nearest one that is present.

Returns:
dict[str | int, str]

Atom type to element symbol, for the types whose mass identifies one. Callers should treat a missing key as “unknown” – see set_types_from_elements(), which warns and keeps the original type.