Species Handling
Helpers for mapping between species identifiers and the codes required by KIM-API models.
KIM_API.SpeciesSymbols — ConstantSpeciesSymbolsTuple containing all chemical element symbols supported by KIM-API.
This includes all elements from the periodic table from hydrogen (H) to oganesson (Og), plus "electron" as a special particle type. The order corresponds to the atomic numbers, with "electron" at index 1.
Example
SpeciesSymbols[2] # "H" (hydrogen)
SpeciesSymbols[15] # "Si" (silicon)KIM_API.SpeciesToAtomicNumbers — ConstantSpeciesToAtomicNumbersSimple dict map between species symbol and atomic numbers
KIM_API.SpeciesName — Typespecies.jlKIM-API species management and utilities.
This module provides functions for handling chemical species in KIM-API, including species name lookup, validation, and mapping between string representations and integer codes used by KIM models.
Key Types
SpeciesName: Type alias for species integer codes
Constants
SpeciesSymbols: Tuple of all supported chemical element symbols
Key Functions
get_species_number: Convert species string to integer codeget_species_symbol: Convert species integer code to stringget_species_codes_from_model: Map species strings to model-specific codesget_species_map_closure: Create efficient species mapping function
Model Integration
The module provides functions to check which species are supported by a specific KIM model and create efficient mappings for repeated use.
KIM_API.get_species_codes_from_model — Methodget_species_codes(model::Model, species_strings::Vector{String})Check species support and return array of KIM species codes for each particle. Throws error if any species not supported. From mdstresslab++
KIM_API.get_species_map_closure — Methodget_static_species_map(model::Model, species_list::Vector{String}) -> Vector{Cint}
Get a static closure that maps species strings to their codes.KIM_API.get_species_number — Methodget_species_number(name::String) -> CintGet species name constant from string
KIM_API.get_species_support_and_code — Methodget_species_support_and_code(model::Model, species::Cint) -> (supported, code)Check if a species is supported and get its code.
KIM_API.get_species_symbol — Methodget_species_number(species::Cint) -> StringGet species symbol constant from string (e.g., "Ar", "Si", etc.)
KIM_API.get_supported_species_map — Methodget_unique_species_map(model::Model, species_list::Vector{String})Map all species strings to their codes from the model. TODO: Rename :symbol? It might gte confusing with actual Julia :Symbols
KIM_API.get_unique_species_map — Methodget_unique_species_map(model::Model, species_list::Vector{String})Check unique species and return mapping dict. More efficient when many particles of same species.
KIM_API.species_name_equal — Methodspecies_name_equal(lhs::SpeciesName, rhs::SpeciesName) -> BoolCheck if two species names are equal.
KIM_API.species_name_known — Methodspecies_name_known(species::SpeciesName) -> BoolCheck if species name is known/valid in KIM-API.
KIM_API.species_name_not_equal — Methodspecies_name_not_equal(lhs::SpeciesName, rhs::SpeciesName) -> BoolCheck if two species names are not equal.