graeter-group / kimmdy

Reactive MD pipeline for GROMACS using Kinetic Monte Carlo / Molecular Dynamics (KIMMDY)
https://graeter-group.github.io/kimmdy/
GNU General Public License v3.0
8 stars 1 forks source link

Clarify handling of multiple reactions #23

Closed jmbuhr closed 2 years ago

jmbuhr commented 2 years ago

The current implementation assumes just one ReactionRecipe where the RunManager stores results and the decision strategy picks one conversion to perform based on the rates from this recipe, which breaks if we have multiple reactions. In the PR that will follow after the network troubles are resolved I disentangling this at the level of our reaction specification and for the run manager.

jmbuhr commented 2 years ago

Q: Can a reaction move or break multiple things in one step?

jmbuhr commented 2 years ago

Too clarify the question:

https://github.com/hits-mbm-dev/kimmdy/blob/e1a37914aae29d30e2086eeb88f84b86e888ed6a/src/kimmdy/reaction.py#L6-L42

Notice, how I made it so that every reaction has to return a ReactionResult. This in turn contains a list of rates and a list of ConversionRecipes (one recipe per rate, though this is not enforced, which might be a subtle problem in the future). A ConversionRecipe can break exactly one bond or move one atom. This in turn means that the datamodel fails if multiple conversions should happen as part of the same reaction within one event / rate. There are probably reactions that want to do that, right?

(Although, it previously looked like we had this when ConversionRecipes.atom_idx was a list of tuples, we were missing a list level around that at the time, I simply moved the iteration level one step up the chain and didn't add the extra list. I will add this with my next PR.)