Skip to main content

Module helpers

Module helpers 

Source
Expand description

Element symbol and atomic number lookup.

Both lookups cover hydrogen through uranium (Z = 1..=92) plus the hydrogen isotopes deuterium (“D”) and tritium (“T”) which both map to Z = 1 since they share hydrogen’s nucleon charge. The reverse lookup (atomic_number_to_symbol) returns the standard “H” for Z = 1; callers that need to distinguish isotopes do so out of band (e.g. an isotope metadata key on the frame, or by storing “D” / “T” as the per-atom symbol).

The mapping is informational, not binding. The CON spec does not mandate that an atom’s symbol correspond to any periodic-table element; consumers commonly store ghost atoms (e.g. for QM/MM link atoms, virtual sites, dummy positions in NEB chains) with whatever symbol fits their workflow. Unknown inputs return a stable sentinel: symbol_to_atomic_number returns 0 for unknown symbols and atomic_number_to_symbol returns “X” for unknown atomic numbers.

The same lookup is exposed to C/C++ via crate::ffi::rkr_symbol_to_z and crate::ffi::rkr_z_to_symbol so downstream tools can drop their own copies of the periodic table.

Functions§

atomic_number_to_symbol
Returns the chemical symbol for an atomic number, or “X” if unknown.
symbol_to_atomic_number
Returns the atomic number for a chemical symbol, or 0 if unknown.