Species Handling

Helpers for mapping between species identifiers and the codes required by KIM-API models.

KIM_API.SpeciesSymbolsConstant
SpeciesSymbols

Tuple 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)
source
KIM_API.SpeciesNameType
species.jl

KIM-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 code
  • get_species_symbol: Convert species integer code to string
  • get_species_codes_from_model: Map species strings to model-specific codes
  • get_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.

source
KIM_API.get_species_codes_from_modelMethod
get_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++

source
KIM_API.get_species_map_closureMethod
get_static_species_map(model::Model, species_list::Vector{String}) -> Vector{Cint}
Get a static closure that maps species strings to their codes.
source
KIM_API.get_supported_species_mapMethod
get_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

source
KIM_API.get_unique_species_mapMethod
get_unique_species_map(model::Model, species_list::Vector{String})

Check unique species and return mapping dict. More efficient when many particles of same species.

source