rgpycrumbs.eon.plt_kmc

Visualize an eOn aKMC trajectory: N2 ejection vs simulation time.

Added in version 1.8.0.

Reads an eOn aKMC output directory (dynamics.txt + per-state states/<id>/reactant.con) and plots, against cumulative KMC simulation time:

  1. the cumulative number of N2 molecules ejected from the Si core, and

  2. the system energy and visited-state index.

An N2 is detected as a bonded N-N pair whose midpoint lies further than a threshold (default 4 Angstrom) from the Si-core center of mass. The reader is robust to partial aKMC directories (missing states are skipped).

Attributes

Classes

DynamicsStep

One accepted aKMC transition from dynamics.txt.

KmcTimeline

Cumulative N2 ejection and energy vs time across visited states.

Functions

parse_dynamics(→ list[DynamicsStep])

Parse an eOn aKMC dynamics.txt into ordered DynamicsStep.

visited_state_sequence(→ list[int])

Ordered list of visited state ids: initial reactant then each product.

count_ejected_n2(→ int)

Count N2 molecules ejected from the Si core in an ASE Atoms.

collect_kmc_n2_timeline(→ KmcTimeline)

Build the N2-ejection timeline for an eOn aKMC directory.

plot_kmc_timeline(timeline, out_path[, log_time])

Render the two-panel N2-ejection + energy figure to out_path.

main(akmc_dir, out_path, core_threshold, nn_cutoff, ...)

Plot N2 ejection vs KMC time for an eOn aKMC directory.

Module Contents

rgpycrumbs.eon.plt_kmc.warn_on_direct_script_import = None[source]
rgpycrumbs.eon.plt_kmc.log[source]
class rgpycrumbs.eon.plt_kmc.DynamicsStep[source]

One accepted aKMC transition from dynamics.txt.

Added in version 1.8.0.

step: int[source]
reactant_id: int[source]
process_id: int[source]
product_id: int[source]
step_time: float[source]
total_time: float[source]
barrier: float[source]
rate: float[source]
energy: float[source]
rgpycrumbs.eon.plt_kmc._COLUMN_ALIASES[source]
rgpycrumbs.eon.plt_kmc._DEFAULT_ORDER = ['step', 'reactant_id', 'process_id', 'product_id', 'step_time', 'total_time', 'barrier',...[source]
rgpycrumbs.eon.plt_kmc.parse_dynamics(dynamics_file) list[DynamicsStep][source]

Parse an eOn aKMC dynamics.txt into ordered DynamicsStep.

Uses the header row to map columns when present; otherwise assumes the canonical eOn column order. Separator and comment lines are skipped.

Added in version 1.8.0.

rgpycrumbs.eon.plt_kmc.visited_state_sequence(steps: list[DynamicsStep]) list[int][source]

Ordered list of visited state ids: initial reactant then each product.

Added in version 1.8.0.

rgpycrumbs.eon.plt_kmc.count_ejected_n2(atoms, core_threshold: float = 4.0, nn_cutoff: float = 1.6) int[source]

Count N2 molecules ejected from the Si core in an ASE Atoms.

An N2 is a bonded N-N pair (separation < nn_cutoff) whose midpoint lies further than core_threshold from the Si-atom center of mass. N atoms are greedily paired nearest-first. Falls back to the all-atom COM as the core reference when no Si atoms are present.

Added in version 1.8.0.

class rgpycrumbs.eon.plt_kmc.KmcTimeline[source]

Cumulative N2 ejection and energy vs time across visited states.

Added in version 1.8.0.

times: list[float][source]
cumulative_n2: list[int][source]
energies: list[float][source]
state_ids: list[int][source]
rgpycrumbs.eon.plt_kmc.collect_kmc_n2_timeline(akmc_dir, core_threshold: float = 4.0, nn_cutoff: float = 1.6) KmcTimeline[source]

Build the N2-ejection timeline for an eOn aKMC directory.

Robust to partial directories: states missing reactant.con reuse the previous count. Requires readcon and ase.

Added in version 1.8.0.

rgpycrumbs.eon.plt_kmc.plot_kmc_timeline(timeline: KmcTimeline, out_path, log_time: bool = True)[source]

Render the two-panel N2-ejection + energy figure to out_path.

Added in version 1.8.0.

rgpycrumbs.eon.plt_kmc.main(akmc_dir: pathlib.Path, out_path: pathlib.Path | None, core_threshold: float, nn_cutoff: float, log_time: bool)[source]

Plot N2 ejection vs KMC time for an eOn aKMC directory.