hop

Fast endpoint-state helpers for KMC hops.

class kmcpy.event.hop.HopStateLookup(mobile_state_by_site, vacancy_state_by_site)[source]

Precomputed mobile/vacancy state codes for each active site.

annotate_event(event)[source]

Attach hot-loop state codes to an event in compact active-site space.

Return type:

None

annotate_event_lib(event_lib)[source]

Attach precomputed state codes to every event in an event library.

Return type:

None

classmethod from_active_site_order(active_site_order, mobile_ion_specie)[source]

Build site-indexed state-code arrays from active-site metadata.

Return type:

HopStateLookup

kmcpy.event.hop.endpoint_direction_from_codes(from_occ, to_occ, codes)[source]

Return direction from endpoint states and precomputed hop state codes.

Return type:

int

kmcpy.event.hop.event_direction(occupations, event)[source]

Return +1, -1, or 0 using only endpoint integer state comparisons.

Return type:

int