Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateReactions not isomorphic to normal Reaction? #1860

Closed
nateharms opened this issue Jan 6, 2020 · 2 comments
Closed

TemplateReactions not isomorphic to normal Reaction? #1860

nateharms opened this issue Jan 6, 2020 · 2 comments

Comments

@nateharms
Copy link

Bug Description

When trying to create an isomorphic template reaction, RMG's generate_reactions generates reactions from a KineticFamily, it creates template reactions which are not isomorphic to the input reaction of interest

How To Reproduce

In:

import rmgpy
from rmgpy.molecule import Molecule
from rmgpy.reaction import Reaction
from rmgpy.data.rmg import RMGDatabase

rmg_database = RMGDatabase()
database_path = rmgpy.settings['database.directory']
rmg_database.load(
    database_path,
    kinetics_families=["H_Abstraction"],
    transport_libraries=[],
    reaction_libraries=[],
    seed_mechanisms=[],
    thermo_libraries=[
        'primaryThermoLibrary',
        'thermo_DFT_CCSDTF12_BAC',
        'CBS_QB3_1dHR'],
    solvation=False,
)
family = rmg_database.kinetics.families["H_Abstraction"]

r1 = Reaction(reactants=[Molecule(smiles="[CH2]"), Molecule(smiles="[H]")], products=[Molecule(smiles="[H][H]"), Molecule(smiles="[CH]")])

print("Initial reactions is: {}".format(r1))
print("")
for i, r2 in enumerate(family.generate_reactions(r1.reactants)):
    print("The {}th generated reaction is {}".format(i, r2))
    print("Isomorphic?: {}".format(r2.is_isomorphic(r1)))
    for sp in r2.reactants + r2.products:
        sp.clear_labeled_atoms()

Out:

Initial reactions is: <Molecule "[CH2]"> + <Molecule "[H]"> <=> <Molecule "[H][H]"> + <Molecule "[CH]">

The 0th generated reaction is <Molecule "[H]"> + <Molecule "[CH2]"> <=> <Molecule "[H][H]"> + <Molecule "[CH]">
Isomorphic?: False
The 1th generated reaction is <Molecule "[H]"> + <Molecule "[CH2]"> <=> <Molecule "[H][H]"> + <Molecule "[CH]">
Isomorphic?: False

Expected Behavior

We expect one result to be True. However all are False. Also, I would only expect one reaction, however family.generate_reaction(r1.reactants) is list of length 2 of seemingly identical reactions but I'm guessing they are labeled differently.

Installation Information

Describe your installation method and system information.

  • OS (include version if known): macOS 10.15.2
  • Installation method: From source
  • RMG version information:
    • RMG-Py: latest master
    • RMG-database: latest master
@amarkpayne
Copy link
Member

I need to test this out, but I wonder if the fact that one of the species is a carbene is relevant. Are there differences in the [CH] molecules in the three reactions? Check the multiplicity and number of paired/unpaired electrons.

@nateharms
Copy link
Author

Oy vey... that'll do it... Not a bug, just me having a brain fart 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants