Skip to content

Micki v2.2.0

Latest

Choose a tag to compare

@jrschmidt2 jrschmidt2 released this 08 Oct 15:13

Reactions as strings

Reactions can now be written as strings of species labels, which is the recommended form:

reactions = micki.reactions_from_strings(sp, {
    'co_ads': ('co_g + * -> co', {'method': 'STICK'}),
    'o2_ads': 'o2_g + 2* <-> o-o -> 2 o',
    'co_ox': 'co + o <-> o-co -> co2_g + 2*',
})
  • Reaction.from_string(expression, species, **kwargs) reads 'reactants -> products' or CatMap's 'reactants <-> ts -> products' (-> and <-> are interchangeable; steps stay reversible unless reversible=False).
  • Coefficients: 2 h, 2*h or 2h. * is the empty site when there is a single site type, whatever its label.
  • species is a dict (e.g. from read_from_db) or a list. A dict can also map CatMap names such as '*_s' to micki species.
  • micki.reactions_from_strings builds a whole mechanism for Model.add_reactions.
  • The species-object form, Reaction(reactants, products, ts=...), works as before.

New checks (may raise errors in existing scripts)

  • Atom balance: every Reaction checks that its reactants, products and transition state contain the same atoms. Empty sites and electrons are not counted, and an adsorbate's slab atoms are subtracted. Pass check_balance=False for deliberately unbalanced steps.
  • Sites: Model.set_initial_conditions raises an error for an adsorbate that occupies no sites and is not itself an empty site (usually a forgotten sites=), and, with a lattice, for a transition state without sites. Mark species that deliberately occupy no sites (e.g. mobile precursors) with Adsorbate(..., sitefree=True); this is stored in databases.

The water-gas shift model and the CatMap comparison models pass both checks unchanged.

Examples and documentation

  • examples/wgs.py: the water-gas shift model written with reaction strings, runnable from a clone (python examples/wgs.py), printing TOFs against experiment. A test checks that it matches the regression model.
  • The docs lead with reaction strings. The user guide's example explains its made-up energies and shows how species come from VASP output or an ASE calculator.