Repository navigation
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 unlessreversible=False).- Coefficients:
2 h,2*hor2h.*is the empty site when there is a single site type, whatever its label. speciesis a dict (e.g. fromread_from_db) or a list. A dict can also map CatMap names such as'*_s'to micki species.micki.reactions_from_stringsbuilds a whole mechanism forModel.add_reactions.- The species-object form,
Reaction(reactants, products, ts=...), works as before.
New checks (may raise errors in existing scripts)
- Atom balance: every
Reactionchecks 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. Passcheck_balance=Falsefor deliberately unbalanced steps. - Sites:
Model.set_initial_conditionsraises an error for an adsorbate that occupies no sites and is not itself an empty site (usually a forgottensites=), and, with a lattice, for a transition state without sites. Mark species that deliberately occupy no sites (e.g. mobile precursors) withAdsorbate(..., 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.