chemreac.util.stoich

Collects stoichiometry related functions.

chemreac.util.stoich.identify_equilibria(stoich_reac, stoich_prod)[source]

Identify equilibria from stoichiometry

Parameters
stoich_reac: iterable of iterables of integers

per reaction iterables of specie indices for reactants

stoich_prod: iterable of iterables of integers

per reaction iterables of specie indices for products

Returns
Set of tuples of reaction indices forming equilibria

Examples

>>> identify_equilibria([[0,0], [1]], [[1], [0,0]]) == set([(0, 1)])
True