.. Autogenerated in conf.py .. _examples-dg: Derivations and Reaction Networks ################################################################################ Rule Application ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transformation rules (reaction patterns) can be applied to graphs (molecules) to create new graphs (molecules). The transformations (reactions) implicitly form a directed (multi-)hypergraph (chemical reaction network). `Explore in the playground `__. .. literalinclude:: /_static/examples/py/0210_dgFixed.py :language: python :linenos: :lines: 1-14 :tab-width: 3 Repetition ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A sub-strategy can be repeated. `Explore in the playground `__. .. literalinclude:: /_static/examples/py/0211_dgRepeat.py :language: python :linenos: :lines: 1-12 :tab-width: 3 Application Constraints ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ We may want to impose constraints on which reactions are accepted. E.g., in formose the molecules should not have too many carbon atoms. `Explore in the playground `__. .. literalinclude:: /_static/examples/py/0212_dgPredicate.py :language: python :linenos: :lines: 1-18 :tab-width: 3 Advanced Printing ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Reaction networks can become large, and often it is necessary to hide parts of the network, or in general change the appearance. `Explore in the playground `__. .. literalinclude:: /_static/examples/py/0250_dgPrinting.py :language: python :linenos: :lines: 1-17 :tab-width: 3 Double Pushout Printing ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Each reaction/derivation can be visualised as a DPO diagram. `Explore in the playground `__. .. literalinclude:: /_static/examples/py/0260_dpoPrinting.py :language: python :linenos: :lines: 1-3 :tab-width: 3