Kinetics#

The classes from which a kinetic Monte Carlo simulation is built, meaning the barrier model of a hop type and the transition that pairs it with an attempt frequency. KineticMonteCarloEnsemble samples with them.

LocalClusterExpansionCalculator#

class mchammer.kinetics.LocalClusterExpansionCalculator(structure, local_cluster_expansion)[source]#

The per-supercell form of a local cluster expansion.

The calculator locates every instance of the event prototype in the supercell at construction and builds a compiled evaluator from them, so that runtime evaluation reduces to a gather from a point-function table, a product over cluster sites, and a dot with the parameters.

Every instance is one image of the prototype translated by a lattice vector, so the orbits are resolved once per image and an instance is a pair of an image and the cell it sits in. The setup and the memory of the calculator are therefore linear in the supercell with a small coefficient, and the term that grows with it is the table of supercell site indices the evaluator holds, one entry per cell and per lattice site the orbits reference.

Parameters:
  • structure (Atoms) – Supercell for which to set up the calculator. Only the geometry of the structure enters the setup, occupations are supplied at evaluation time.

  • local_cluster_expansion (LocalClusterExpansion) – Local cluster expansion from which to build the calculator.

calculate_augmentation(occupations)[source]#

Returns the augmentation contribution for one occupation vector.

The contribution is zero for a model without augmentation. For a model with augmentation it depends only on quantities that are invariant during a kinetic Monte Carlo run whose hops conserve the occupation multiset of every sublattice group, which is what lets an ensemble evaluate it once and treat it as a constant offset per transition.

Parameters:

occupations (ndarray) – Occupation vector of the supercell by atomic number.

Return type:

float

calculate_kra_local_many(instance_indices, occupations)[source]#

Returns the local parts for a batch of event instances.

The augmentation contribution is excluded, which is what a sampling loop needs when it accounts for the augmentation through a constant offset, see calculate_augmentation().

Parameters:
  • instance_indices (ndarray) – Indices of the instances in event_instances.

  • occupations (ndarray) – Occupation vector of the supercell by atomic number.

Return type:

ndarray

calculate_kra_many(instance_indices, occupations)[source]#

Returns the local properties of a batch of event instances.

All instances are evaluated against the same occupation vector, one result per requested instance. Each value is the local part plus the augmentation contribution when the model carries one, consistent with LocalClusterExpansion.predict().

Parameters:
  • instance_indices (ndarray) – Indices of the instances in event_instances.

  • occupations (ndarray) – Occupation vector of the supercell by atomic number.

Return type:

ndarray

property event_instances: list#

Undirected event instances as tuples of supercell site indices.

property local_cluster_expansion: LocalClusterExpansion#

Local cluster expansion from which the calculator was set up.

property migrating_number: int#

Atomic number of the migrating species.

property structure: Atoms#

Supercell for which the calculator was set up (copy).

Transition#

class mchammer.kinetics.Transition(calculator, attempt_frequency)[source]#

Descriptor of one transition type in a kinetic Monte Carlo simulation.

A transition bundles the barrier model of a hop type with its attempt frequency. The event catalog of a simulation derives from the event prototypes of its transitions.

Parameters:
  • calculator (LocalClusterExpansionCalculator) – Calculator for the kinetically resolved activation energy of the hop type, in eV.

  • attempt_frequency (float) – Attempt frequency of the hop in Hz, which sets the absolute time scale of the simulation.

property attempt_frequency: float#

Attempt frequency of the hop in Hz.

property calculator: LocalClusterExpansionCalculator#

Calculator for the kinetically resolved activation energy.

property migrating_number: int#

Atomic number of the migrating species.