From 29a4a6e43e3173c7637c308d14bdae93fbe9b6c3 Mon Sep 17 00:00:00 2001 From: Anna Doner Date: Fri, 22 Nov 2024 11:36:49 -0500 Subject: [PATCH] spin conservation check Nov 22 2024 --- rmgpy/data/kinetics/database.py | 1 + rmgpy/data/kinetics/family.py | 28 +- rmgpy/rmg/decay.py | 846 ++++++++++++++++---------------- 3 files changed, 447 insertions(+), 428 deletions(-) diff --git a/rmgpy/data/kinetics/database.py b/rmgpy/data/kinetics/database.py index 91b13e3972..8d41c12771 100644 --- a/rmgpy/data/kinetics/database.py +++ b/rmgpy/data/kinetics/database.py @@ -429,6 +429,7 @@ def generate_reactions(self, reactants, products=None, only_families=None, reson reaction_list = [] if only_families is None: reaction_list.extend(self.generate_reactions_from_libraries(reactants, products)) + reaction_list.extend(self.generate_reactions_from_families(reactants, products, only_families=only_families, resonance=resonance)) return reaction_list diff --git a/rmgpy/data/kinetics/family.py b/rmgpy/data/kinetics/family.py index 22c10f225a..442be2ddf6 100644 --- a/rmgpy/data/kinetics/family.py +++ b/rmgpy/data/kinetics/family.py @@ -219,13 +219,15 @@ def calculate_combined_spin(self): if len(self.reactants) == 1: reactant_combined_spin = {self.reactants[0].multiplicity} elif len(self.reactants) == 2: - reactant_combined_spin = set([self.reactants[0].multiplicity + self.reactants[1].multiplicity -1, np.abs(self.reactants[0].multiplicity-self.reactants[1].multiplicity)+1]) + reactant_spin_string = "+".join(sorted([str(reactant.multiplicity) for reactant in self.reactants])) + reactant_combined_spin = allowed_spin[reactant_spin_string] else: return None if len(self.products) == 1: product_combined_spin = {self.products[0].multiplicity} elif len(self.products) == 2: - product_combined_spin = set([self.products[0].multiplicity + self.products[1].multiplicity -1, np.abs(self.products[0].multiplicity-self.products[1].multiplicity)+1]) + product_spin_string = "+".join(sorted([str(product.multiplicity) for product in self.products])) + product_combined_spin = allowed_spin[product_spin_string] else: return None return reactant_combined_spin, product_combined_spin @@ -1539,6 +1541,7 @@ def _generate_product_structures(self, reactant_structures, maps, forward, relab # Apply the generated species constraints (if given) for struct in product_structures: if self.is_molecule_forbidden(struct): + # logging.info(f"{str(struct)} is forbidden!") raise ForbiddenStructureException() if fails_species_constraints(struct): raise ForbiddenStructureException() @@ -1592,8 +1595,8 @@ def _create_reaction(self, reactants, products, is_forward, check_spin = True): reaction.labeled_atoms[key] = dict(reaction.labeled_atoms[key], **species.get_all_labeled_atoms()) if check_spin: if not reaction.check_if_spin_allowed(): - logging.warn("Did not create the following reaction, which violates conservation of spin...") - logging.warn(str(reaction)) + logging.info("Did not create the following reaction, which violates conservation of spin...") + logging.info(str(reaction)) return None return reaction @@ -1855,6 +1858,7 @@ def _generate_reactions(self, reactants, products=None, forward=True, prod_reson reactant_num = self.product_num if self.auto_generated and reactant_num != len(reactants): + # logging.info("self.auto_generated and reactant_num != len(reactants)") return [] if len(reactants) > len(template.reactants): @@ -4534,4 +4538,18 @@ def average_kinetics(kinetics_list): ) return averaged_kinetics -allowed_spin_violation_families =['1,2-Birad_to_alkene','1,4_Cyclic_birad_scission','1,4_Linear_birad_scission'] \ No newline at end of file +allowed_spin_violation_families =['1,2-Birad_to_alkene','1,4_Cyclic_birad_scission','1,4_Linear_birad_scission'] +allowed_spin = { + "1+1": set([1]), + "1+2": set([2]), + "1+3": set([3]), + "1+4": set([4]), + "1+5": set([5]), + "2+2": set([1,3]), + "2+3": set([2,4]), + "2+4": set([3,5]), + "2+5": set([4,6]), + "3+3": set([1,3,5]), + "3+4": set([2,4,6]), + "3+5": set([3,5,7]), +} \ No newline at end of file diff --git a/rmgpy/rmg/decay.py b/rmgpy/rmg/decay.py index 2b05e8765e..884c5b9fae 100644 --- a/rmgpy/rmg/decay.py +++ b/rmgpy/rmg/decay.py @@ -48,459 +48,459 @@ ['GAIN_RADICAL','*3','1'] ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 O u0 p3 c-1 {2,S} -2 *1 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} -3 *2 N u1 p1 c0 {2,S} {4,S} -4 O u0 p2 c0 {3,S} {7,S} -5 *3 N u1 p1 c0 {2,S} {8,S} -6 H u0 p0 c0 {2,S} -7 H u0 p0 c0 {4,S} -8 H u0 p0 c0 {5,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*1', 1, '*2'], - ['CHANGE_BOND', '*1', 1, '*3'], - ['LOSE_RADICAL', '*3','1'], - ['GAIN_RADICAL','*2','1'] - ])), +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 O u0 p3 c-1 {2,S} +# 2 *1 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} +# 3 *2 N u1 p1 c0 {2,S} {4,S} +# 4 O u0 p2 c0 {3,S} {7,S} +# 5 *3 N u1 p1 c0 {2,S} {8,S} +# 6 H u0 p0 c0 {2,S} +# 7 H u0 p0 c0 {4,S} +# 8 H u0 p0 c0 {5,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*1', 1, '*2'], +# ['CHANGE_BOND', '*1', 1, '*3'], +# ['LOSE_RADICAL', '*3','1'], +# ['GAIN_RADICAL','*2','1'] +# ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *3 O u0 p3 c-1 {2,S} -2 *5 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} -3 *4 N u0 p1 c0 {2,S} {4,D} -4 *1 N u0 p1 c0 {3,D} {7,S} -5 H u0 p0 c0 {2,S} -6 H u0 p0 c0 {2,S} -7 *2 H u0 p0 c0 {4,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*1', 1, '*2'], - ['BREAK_BOND', '*4', 1, '*5'], - ['FORM_BOND', '*2', 1, '*3'], - ['CHANGE_BOND', '*1', 1, '*4'], - ['LOSE_PAIR', '*3', 1], - ['GAIN_PAIR', '*5', 1], +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *3 O u0 p3 c-1 {2,S} +# 2 *5 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} +# 3 *4 N u0 p1 c0 {2,S} {4,D} +# 4 *1 N u0 p1 c0 {3,D} {7,S} +# 5 H u0 p0 c0 {2,S} +# 6 H u0 p0 c0 {2,S} +# 7 *2 H u0 p0 c0 {4,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*1', 1, '*2'], +# ['BREAK_BOND', '*4', 1, '*5'], +# ['FORM_BOND', '*2', 1, '*3'], +# ['CHANGE_BOND', '*1', 1, '*4'], +# ['LOSE_PAIR', '*3', 1], +# ['GAIN_PAIR', '*5', 1], - ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *5 N u0 p2 c-1 {2,S} {5,S} -2 *4 O u0 p2 c0 {1,S} {3,S} -3 *3 O u0 p2 c0 {2,S} {4,S} -4 *2 N u0 p1 c0 {3,S} {5,S} {6,S} -5 *1 N u0 p0 c+1 {1,S} {4,S} {7,S} {8,S} -6 H u0 p0 c0 {4,S} -7 H u0 p0 c0 {5,S} -8 H u0 p0 c0 {5,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*3', 1, '*4'], - ['BREAK_BOND', '*1', 1, '*2'], - ['CHANGE_BOND', '*2', 1, '*3'], - ['CHANGE_BOND', '*5', 1, '*4'], - ['LOSE_PAIR', '*5', 1], - ['GAIN_PAIR', '*1', 1], +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *5 N u0 p2 c-1 {2,S} {5,S} +# 2 *4 O u0 p2 c0 {1,S} {3,S} +# 3 *3 O u0 p2 c0 {2,S} {4,S} +# 4 *2 N u0 p1 c0 {3,S} {5,S} {6,S} +# 5 *1 N u0 p0 c+1 {1,S} {4,S} {7,S} {8,S} +# 6 H u0 p0 c0 {4,S} +# 7 H u0 p0 c0 {5,S} +# 8 H u0 p0 c0 {5,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*3', 1, '*4'], +# ['BREAK_BOND', '*1', 1, '*2'], +# ['CHANGE_BOND', '*2', 1, '*3'], +# ['CHANGE_BOND', '*5', 1, '*4'], +# ['LOSE_PAIR', '*5', 1], +# ['GAIN_PAIR', '*1', 1], - ])), +# ])), -(Group().from_adjacency_list(""" -multiplicity [2] -1 *4 O u0 p2 c0 {2,S} {6,S} -2 *3 N u0 p1 c0 {1,S} {3,D} -3 *1 N u0 p0 c+1 {2,D} {4,S} {5,S} -4 *6 O u0 p2 c0 {3,S} {7,S} -5 *2 N u1 p2 c-1 {3,S} -6 *5 H u0 p0 c0 {1,S} -7 H u0 p0 c0 {4,S} -"""), - ReactionRecipe(actions=[ - ['FORM_BOND', '*5', 1, '*6'], - ['BREAK_BOND', '*1', 1, '*6'], - ['BREAK_BOND', '*1', 2, '*3'], - ['BREAK_BOND', '*4', 1, '*5'], - ['CHANGE_BOND', '*3', 1, '*4'], - ['CHANGE_BOND', '*1', 2, '*2'], - ['GAIN_RADICAL', '*3', '1'], - ['LOSE_RADICAL', '*2', '1'], - ['LOSE_PAIR', '*2', 1], - ['GAIN_PAIR', '*1', 1], +# (Group().from_adjacency_list(""" +# multiplicity [2] +# 1 *4 O u0 p2 c0 {2,S} {6,S} +# 2 *3 N u0 p1 c0 {1,S} {3,D} +# 3 *1 N u0 p0 c+1 {2,D} {4,S} {5,S} +# 4 *6 O u0 p2 c0 {3,S} {7,S} +# 5 *2 N u1 p2 c-1 {3,S} +# 6 *5 H u0 p0 c0 {1,S} +# 7 H u0 p0 c0 {4,S} +# """), +# ReactionRecipe(actions=[ +# ['FORM_BOND', '*5', 1, '*6'], +# ['BREAK_BOND', '*1', 1, '*6'], +# ['BREAK_BOND', '*1', 2, '*3'], +# ['BREAK_BOND', '*4', 1, '*5'], +# ['CHANGE_BOND', '*3', 1, '*4'], +# ['CHANGE_BOND', '*1', 2, '*2'], +# ['GAIN_RADICAL', '*3', '1'], +# ['LOSE_RADICAL', '*2', '1'], +# ['LOSE_PAIR', '*2', 1], +# ['GAIN_PAIR', '*1', 1], - ])), +# ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 *1 N u2 p1 c0 {2,S} -2 *2 N u0 p1 c0 {1,S} {3,S} {5,S} -3 *3 N u0 p1 c0 {2,S} {4,S} {6,S} -4 O u0 p2 c0 {3,S} {5,S} -5 *4 O u0 p2 c0 {2,S} {4,S} -6 H u0 p0 c0 {3,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2', 1, '*3'], - ['BREAK_BOND', '*2', 1, '*4'], - ['CHANGE_BOND', '*1',2,'*2'], - ['LOSE_RADICAL','*1',2], - ['GAIN_RADICAL','*3',1], - ['GAIN_RADICAL','*4',1], +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 *1 N u2 p1 c0 {2,S} +# 2 *2 N u0 p1 c0 {1,S} {3,S} {5,S} +# 3 *3 N u0 p1 c0 {2,S} {4,S} {6,S} +# 4 O u0 p2 c0 {3,S} {5,S} +# 5 *4 O u0 p2 c0 {2,S} {4,S} +# 6 H u0 p0 c0 {3,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2', 1, '*3'], +# ['BREAK_BOND', '*2', 1, '*4'], +# ['CHANGE_BOND', '*1',2,'*2'], +# ['LOSE_RADICAL','*1',2], +# ['GAIN_RADICAL','*3',1], +# ['GAIN_RADICAL','*4',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 *1 N u2 p1 c0 {2,S} -2 *2 O u0 p2 c0 {1,S} {3,S} -3 *3 O u0 p2 c0 {2,S} {4,S} -4 H u0 p0 c0 {3,S} -"""), - ReactionRecipe(actions=[ - ['CHANGE_BOND', '*1',1,'*2'], - ['BREAK_BOND', '*2',1,'*3'], - ['LOSE_RADICAL','*1',1], - ['GAIN_RADICAL','*3',1], - ])), +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 *1 N u2 p1 c0 {2,S} +# 2 *2 O u0 p2 c0 {1,S} {3,S} +# 3 *3 O u0 p2 c0 {2,S} {4,S} +# 4 H u0 p0 c0 {3,S} +# """), +# ReactionRecipe(actions=[ +# ['CHANGE_BOND', '*1',1,'*2'], +# ['BREAK_BOND', '*2',1,'*3'], +# ['LOSE_RADICAL','*1',1], +# ['GAIN_RADICAL','*3',1], +# ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *1 N u0 p2 c-1 {2,D} -2 *2 N u0 p0 c+1 {1,D} {3,S} {4,S} -3 *4 O u0 p2 c0 {2,S} {4,S} -4 *3 N u0 p1 c0 {2,S} {3,S} {5,S} -5 O u0 p2 c0 {4,S} {6,S} -6 H u0 p0 c0 {5,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*4'], - ['CHANGE_BOND','*3',1,'*4'], - ['GAIN_PAIR','*2',1], - ['LOSE_PAIR','*3',1], +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *1 N u0 p2 c-1 {2,D} +# 2 *2 N u0 p0 c+1 {1,D} {3,S} {4,S} +# 3 *4 O u0 p2 c0 {2,S} {4,S} +# 4 *3 N u0 p1 c0 {2,S} {3,S} {5,S} +# 5 O u0 p2 c0 {4,S} {6,S} +# 6 H u0 p0 c0 {5,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*4'], +# ['CHANGE_BOND','*3',1,'*4'], +# ['GAIN_PAIR','*2',1], +# ['LOSE_PAIR','*3',1], - ])), +# ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *1 N u0 p2 c-1 {2,S} {5,S} -2 *2 N u0 p0 c+1 {1,S} {3,S} {4,S} {6,S} -3 *3 N u0 p1 c0 {2,S} {4,S} {7,S} -4 *4 O u0 p2 c0 {2,S} {3,S} -5 H u0 p0 c0 {1,S} -6 H u0 p0 c0 {2,S} -7 H u0 p0 c0 {3,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*4'], - ['CHANGE_BOND','*3',1,'*4'], - ['GAIN_PAIR','*2',1], - ['LOSE_PAIR','*3',1], +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *1 N u0 p2 c-1 {2,S} {5,S} +# 2 *2 N u0 p0 c+1 {1,S} {3,S} {4,S} {6,S} +# 3 *3 N u0 p1 c0 {2,S} {4,S} {7,S} +# 4 *4 O u0 p2 c0 {2,S} {3,S} +# 5 H u0 p0 c0 {1,S} +# 6 H u0 p0 c0 {2,S} +# 7 H u0 p0 c0 {3,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*4'], +# ['CHANGE_BOND','*3',1,'*4'], +# ['GAIN_PAIR','*2',1], +# ['LOSE_PAIR','*3',1], - ])), +# ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *1 O u0 p3 c-1 {2,S} -2 *2 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} -3 *3 N u0 p1 c0 {2,S} {4,D} -4 *4 N u0 p1 c0 {3,D} {7,S} -5 O u0 p2 c0 {2,S} {8,S} -6 H u0 p0 c0 {2,S} -7 *5 H u0 p0 c0 {4,S} -8 H u0 p0 c0 {5,S} -"""), - ReactionRecipe(actions=[ - ['FORM_BOND', '*1',1,'*5'], - ['BREAK_BOND','*4',1,'*5'], - ['CHANGE_BOND','*3',1,'*4'], - ['BREAK_BOND','*2',1,'*3'], - ['GAIN_PAIR','*2',1], - ['LOSE_PAIR','*1',1], +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *1 O u0 p3 c-1 {2,S} +# 2 *2 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} +# 3 *3 N u0 p1 c0 {2,S} {4,D} +# 4 *4 N u0 p1 c0 {3,D} {7,S} +# 5 O u0 p2 c0 {2,S} {8,S} +# 6 H u0 p0 c0 {2,S} +# 7 *5 H u0 p0 c0 {4,S} +# 8 H u0 p0 c0 {5,S} +# """), +# ReactionRecipe(actions=[ +# ['FORM_BOND', '*1',1,'*5'], +# ['BREAK_BOND','*4',1,'*5'], +# ['CHANGE_BOND','*3',1,'*4'], +# ['BREAK_BOND','*2',1,'*3'], +# ['GAIN_PAIR','*2',1], +# ['LOSE_PAIR','*1',1], - ])), +# ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 *1 N u1 p2 c-1 {2,S} -2 *2 N u0 p0 c+1 {1,S} {3,S} {4,S} {5,S} -3 O u1 p2 c0 {2,S} -4 N u0 p1 c0 {2,S} {5,S} {6,S} -5 *3 O u0 p2 c0 {2,S} {4,S} -6 H u0 p0 c0 {4,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND','*2',1,'*3'], - ['CHANGE_BOND', '*1',1,'*2'], - ['GAIN_RADICAL','*3',1], - ['LOSE_RADICAL','*1',1], +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 *1 N u1 p2 c-1 {2,S} +# 2 *2 N u0 p0 c+1 {1,S} {3,S} {4,S} {5,S} +# 3 O u1 p2 c0 {2,S} +# 4 N u0 p1 c0 {2,S} {5,S} {6,S} +# 5 *3 O u0 p2 c0 {2,S} {4,S} +# 6 H u0 p0 c0 {4,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND','*2',1,'*3'], +# ['CHANGE_BOND', '*1',1,'*2'], +# ['GAIN_RADICAL','*3',1], +# ['LOSE_RADICAL','*1',1], - ])), +# ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *1 N u0 p1 c0 {2,D} {6,S} -2 *5 N u0 p1 c0 {1,D} {3,S} -3 *4 O u0 p2 c0 {2,S} {4,S} -4 *3 N u0 p1 c0 {3,S} {5,D} -5 O u0 p2 c0 {4,D} -6 *2 H u0 p0 c0 {1,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND','*4',1,'*5'], - ['BREAK_BOND', '*1',1,'*2'], - ['FORM_BOND','*2',1,'*3'], - ['GAIN_PAIR','*4',1], - ['CHANGE_BOND','*1',1,'*5'], - ['LOSE_PAIR','*3',1], +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *1 N u0 p1 c0 {2,D} {6,S} +# 2 *5 N u0 p1 c0 {1,D} {3,S} +# 3 *4 O u0 p2 c0 {2,S} {4,S} +# 4 *3 N u0 p1 c0 {3,S} {5,D} +# 5 O u0 p2 c0 {4,D} +# 6 *2 H u0 p0 c0 {1,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND','*4',1,'*5'], +# ['BREAK_BOND', '*1',1,'*2'], +# ['FORM_BOND','*2',1,'*3'], +# ['GAIN_PAIR','*4',1], +# ['CHANGE_BOND','*1',1,'*5'], +# ['LOSE_PAIR','*3',1], - ])), +# ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 N u0 p2 c-1 {2,D} -2 *1 N u0 p0 c+1 {1,D} {3,S} {4,S} -3 *2 N u0 p1 c0 {2,S} {4,S} {5,S} -4 *3 O u0 p2 c0 {2,S} {3,S} -5 H u0 p0 c0 {3,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND','*1',1,'*3'], - ['CHANGE_BOND','*2',1,'*3'], - ['GAIN_PAIR','*1',1], - ['LOSE_PAIR','*2',1], +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 N u0 p2 c-1 {2,D} +# 2 *1 N u0 p0 c+1 {1,D} {3,S} {4,S} +# 3 *2 N u0 p1 c0 {2,S} {4,S} {5,S} +# 4 *3 O u0 p2 c0 {2,S} {3,S} +# 5 H u0 p0 c0 {3,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND','*1',1,'*3'], +# ['CHANGE_BOND','*2',1,'*3'], +# ['GAIN_PAIR','*1',1], +# ['LOSE_PAIR','*2',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 *1 N u1 p1 c0 {2,S} {5,S} -2 *2 N u0 p1 c0 {1,S} {3,D} -3 *3 N u0 p1 c0 {2,D} {4,S} -4 *4 O u1 p2 c0 {3,S} -5 H u0 p0 c0 {1,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND','*2',2,'*3'], - ['CHANGE_BOND','*4',1,'*3'], - ['CHANGE_BOND','*1',1,'*2'], - ['GAIN_RADICAL','*3',1], - ['LOSE_RADICAL','*4',1], - ['GAIN_RADICAL','*2',1], - ['LOSE_RADICAL','*1',1], +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 *1 N u1 p1 c0 {2,S} {5,S} +# 2 *2 N u0 p1 c0 {1,S} {3,D} +# 3 *3 N u0 p1 c0 {2,D} {4,S} +# 4 *4 O u1 p2 c0 {3,S} +# 5 H u0 p0 c0 {1,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND','*2',2,'*3'], +# ['CHANGE_BOND','*4',1,'*3'], +# ['CHANGE_BOND','*1',1,'*2'], +# ['GAIN_RADICAL','*3',1], +# ['LOSE_RADICAL','*4',1], +# ['GAIN_RADICAL','*2',1], +# ['LOSE_RADICAL','*1',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *1 O u0 p3 c-1 {2,S} -2 *2 N u0 p0 c+1 {1,S} {3,S} {4,S} {6,S} -3 *3 O u0 p2 c0 {2,S} {4,S} -4 *4 N u0 p1 c0 {2,S} {3,S} {5,S} -5 *5 N u0 p1 c0 {4,S} {7,S} {8,S} -6 H u0 p0 c0 {2,S} -7 H u0 p0 c0 {5,S} -8 H u0 p0 c0 {5,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['BREAK_BOND', '*2',1,'*4'], - ['CHANGE_BOND', '*3',1,'*4'], - ['CHANGE_BOND', '*1',1,'*2'], - ['LOSE_PAIR','*1',1], - ['GAIN_PAIR','*2',1], +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *1 O u0 p3 c-1 {2,S} +# 2 *2 N u0 p0 c+1 {1,S} {3,S} {4,S} {6,S} +# 3 *3 O u0 p2 c0 {2,S} {4,S} +# 4 *4 N u0 p1 c0 {2,S} {3,S} {5,S} +# 5 *5 N u0 p1 c0 {4,S} {7,S} {8,S} +# 6 H u0 p0 c0 {2,S} +# 7 H u0 p0 c0 {5,S} +# 8 H u0 p0 c0 {5,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['BREAK_BOND', '*2',1,'*4'], +# ['CHANGE_BOND', '*3',1,'*4'], +# ['CHANGE_BOND', '*1',1,'*2'], +# ['LOSE_PAIR','*1',1], +# ['GAIN_PAIR','*2',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [2] -1 *2 N u0 p2 c-1 {2,S} {4,S} -2 *3 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} -3 N u0 p1 c0 {2,S} {7,S} {8,S} -4 *1 O u1 p2 c0 {1,S} -5 H u0 p0 c0 {2,S} -6 H u0 p0 c0 {2,S} -7 H u0 p0 c0 {3,S} -8 H u0 p0 c0 {3,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['CHANGE_BOND', '*1',1,'*2'], - ['LOSE_RADICAL','*1',1], - ['GAIN_RADICAL','*2',1], - ['LOSE_PAIR','*2',1], - ['GAIN_PAIR','*3',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *1 N u0 p2 c-1 {2,S} {6,S} -2 *2 N u0 p0 c+1 {1,S} {3,S} {7,S} {8,S} -3 *4 O u0 p2 c0 {2,S} {4,S} -4 N u0 p1 c0 {3,S} {5,D} -5 O u0 p2 c0 {4,D} -6 H u0 p0 c0 {1,S} -7 *3 H u0 p0 c0 {2,S} -8 H u0 p0 c0 {2,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['BREAK_BOND', '*2',1,'*4'], - ['FORM_BOND','*3',1,'*4'], - ['CHANGE_BOND', '*1',1,'*2'], - ['LOSE_PAIR','*1',1], - ['GAIN_PAIR','*2',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 *3 N u2 p1 c0 {2,S} -2 *2 N u0 p1 c0 {1,S} {3,S} {5,S} -3 *4 N u0 p1 c0 {2,S} {4,D} -4 O u0 p2 c0 {3,D} -5 *1 O u0 p2 c0 {2,S} {6,S} -6 H u0 p0 c0 {5,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*1'], - ['BREAK_BOND', '*2',1,'*4'], - ['CHANGE_BOND', '*3',2,'*2'], - ['LOSE_RADICAL','*3',2], - ['GAIN_RADICAL','*1',1], - ['GAIN_RADICAL','*4',1], - ])), +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [2] +# 1 *2 N u0 p2 c-1 {2,S} {4,S} +# 2 *3 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} +# 3 N u0 p1 c0 {2,S} {7,S} {8,S} +# 4 *1 O u1 p2 c0 {1,S} +# 5 H u0 p0 c0 {2,S} +# 6 H u0 p0 c0 {2,S} +# 7 H u0 p0 c0 {3,S} +# 8 H u0 p0 c0 {3,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['CHANGE_BOND', '*1',1,'*2'], +# ['LOSE_RADICAL','*1',1], +# ['GAIN_RADICAL','*2',1], +# ['LOSE_PAIR','*2',1], +# ['GAIN_PAIR','*3',1], +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *1 N u0 p2 c-1 {2,S} {6,S} +# 2 *2 N u0 p0 c+1 {1,S} {3,S} {7,S} {8,S} +# 3 *4 O u0 p2 c0 {2,S} {4,S} +# 4 N u0 p1 c0 {3,S} {5,D} +# 5 O u0 p2 c0 {4,D} +# 6 H u0 p0 c0 {1,S} +# 7 *3 H u0 p0 c0 {2,S} +# 8 H u0 p0 c0 {2,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['BREAK_BOND', '*2',1,'*4'], +# ['FORM_BOND','*3',1,'*4'], +# ['CHANGE_BOND', '*1',1,'*2'], +# ['LOSE_PAIR','*1',1], +# ['GAIN_PAIR','*2',1], +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 *3 N u2 p1 c0 {2,S} +# 2 *2 N u0 p1 c0 {1,S} {3,S} {5,S} +# 3 *4 N u0 p1 c0 {2,S} {4,D} +# 4 O u0 p2 c0 {3,D} +# 5 *1 O u0 p2 c0 {2,S} {6,S} +# 6 H u0 p0 c0 {5,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*1'], +# ['BREAK_BOND', '*2',1,'*4'], +# ['CHANGE_BOND', '*3',2,'*2'], +# ['LOSE_RADICAL','*3',2], +# ['GAIN_RADICAL','*1',1], +# ['GAIN_RADICAL','*4',1], +# ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *2 N u0 p2 c-1 {2,S} {5,S} -2 *3 O u0 p2 c0 {1,S} {3,S} -3 *4 N u0 p1 c0 {2,S} {4,S} {6,S} -4 *5 O u0 p2 c0 {3,S} {5,S} -5 *1 N u0 p0 c+1 {1,S} {4,S} {7,S} {8,S} -6 H u0 p0 c0 {3,S} -7 H u0 p0 c0 {5,S} -8 H u0 p0 c0 {5,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*5',1,'*1'], - ['BREAK_BOND', '*3',1,'*4'], - ['CHANGE_BOND', '*4',1,'*5'], - ['CHANGE_BOND', '*2',1,'*3'], - ['LOSE_PAIR','*2',1], - ['GAIN_PAIR','*1',1], - ])), +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *2 N u0 p2 c-1 {2,S} {5,S} +# 2 *3 O u0 p2 c0 {1,S} {3,S} +# 3 *4 N u0 p1 c0 {2,S} {4,S} {6,S} +# 4 *5 O u0 p2 c0 {3,S} {5,S} +# 5 *1 N u0 p0 c+1 {1,S} {4,S} {7,S} {8,S} +# 6 H u0 p0 c0 {3,S} +# 7 H u0 p0 c0 {5,S} +# 8 H u0 p0 c0 {5,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*5',1,'*1'], +# ['BREAK_BOND', '*3',1,'*4'], +# ['CHANGE_BOND', '*4',1,'*5'], +# ['CHANGE_BOND', '*2',1,'*3'], +# ['LOSE_PAIR','*2',1], +# ['GAIN_PAIR','*1',1], +# ])), -(Group().from_adjacency_list(""" -multiplicity [1] -1 *1 O u0 p3 c-1 {2,S} -2 *2 N u0 p0 c+1 {1,S} {3,S} {4,S} {5,S} -3 N u0 p1 c0 {2,S} {6,S} {7,S} -4 *3 N u0 p1 c0 {2,S} {5,S} {8,S} -5 *4 O u0 p2 c0 {2,S} {4,S} -6 H u0 p0 c0 {3,S} -7 H u0 p0 c0 {3,S} -8 H u0 p0 c0 {4,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['BREAK_BOND', '*2',1,'*4'], - ['CHANGE_BOND', '*1',1,'*2'], - ['CHANGE_BOND', '*4',1,'*3'], - ['LOSE_PAIR','*1',1], - ['GAIN_PAIR','*2',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 *4 N u1 p1 c0 {2,S} {5,S} -2 *3 N u0 p1 c0 {1,S} {3,S} {6,S} -3 *2 O u0 p2 c0 {2,S} {4,S} -4 *1 O u1 p2 c0 {3,S} -5 H u0 p0 c0 {1,S} -6 H u0 p0 c0 {2,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['CHANGE_BOND', '*4',1,'*3'], - ['LOSE_RADICAL','*4',1], - ['GAIN_RADICAL','*2',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [2] -1 *1 O u0 p3 c-1 {2,S} -2 *2 O u0 p2 c0 {1,S} {3,S} -3 *3 N u0 p0 c+1 {2,S} {4,D} {5,S} -4 N u1 p1 c0 {3,D} -5 N u0 p1 c0 {3,S} {6,S} {7,S} -6 H u0 p0 c0 {5,S} -7 H u0 p0 c0 {5,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['LOSE_PAIR','*1',1], - ['GAIN_PAIR','*3',1], - ['GAIN_RADICAL','*2',1], - ['GAIN_RADICAL','*1',1], - ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 *1 N u1 p1 c0 {2,S} {5,S} -2 *2 O u0 p2 c0 {1,S} {3,S} -3 *3 N u0 p1 c0 {2,S} {4,D} -4 *4 N u1 p1 c0 {3,D} -5 H u0 p0 c0 {1,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['CHANGE_BOND', '*3',1,'*4'], - ['LOSE_RADICAL','*4',1], - ['GAIN_RADICAL','*2',1], - ])), +# (Group().from_adjacency_list(""" +# multiplicity [1] +# 1 *1 O u0 p3 c-1 {2,S} +# 2 *2 N u0 p0 c+1 {1,S} {3,S} {4,S} {5,S} +# 3 N u0 p1 c0 {2,S} {6,S} {7,S} +# 4 *3 N u0 p1 c0 {2,S} {5,S} {8,S} +# 5 *4 O u0 p2 c0 {2,S} {4,S} +# 6 H u0 p0 c0 {3,S} +# 7 H u0 p0 c0 {3,S} +# 8 H u0 p0 c0 {4,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['BREAK_BOND', '*2',1,'*4'], +# ['CHANGE_BOND', '*1',1,'*2'], +# ['CHANGE_BOND', '*4',1,'*3'], +# ['LOSE_PAIR','*1',1], +# ['GAIN_PAIR','*2',1], +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 *4 N u1 p1 c0 {2,S} {5,S} +# 2 *3 N u0 p1 c0 {1,S} {3,S} {6,S} +# 3 *2 O u0 p2 c0 {2,S} {4,S} +# 4 *1 O u1 p2 c0 {3,S} +# 5 H u0 p0 c0 {1,S} +# 6 H u0 p0 c0 {2,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['CHANGE_BOND', '*4',1,'*3'], +# ['LOSE_RADICAL','*4',1], +# ['GAIN_RADICAL','*2',1], +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [2] +# 1 *1 O u0 p3 c-1 {2,S} +# 2 *2 O u0 p2 c0 {1,S} {3,S} +# 3 *3 N u0 p0 c+1 {2,S} {4,D} {5,S} +# 4 N u1 p1 c0 {3,D} +# 5 N u0 p1 c0 {3,S} {6,S} {7,S} +# 6 H u0 p0 c0 {5,S} +# 7 H u0 p0 c0 {5,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['LOSE_PAIR','*1',1], +# ['GAIN_PAIR','*3',1], +# ['GAIN_RADICAL','*2',1], +# ['GAIN_RADICAL','*1',1], +# ])), +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 *1 N u1 p1 c0 {2,S} {5,S} +# 2 *2 O u0 p2 c0 {1,S} {3,S} +# 3 *3 N u0 p1 c0 {2,S} {4,D} +# 4 *4 N u1 p1 c0 {3,D} +# 5 H u0 p0 c0 {1,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['CHANGE_BOND', '*3',1,'*4'], +# ['LOSE_RADICAL','*4',1], +# ['GAIN_RADICAL','*2',1], +# ])), -(Group().from_adjacency_list(""" -multiplicity [2] -1 *1 O u0 p2 c0 {2,S} {4,S} -2 *2 N u0 p1 c0 {1,S} {3,D} -3 *3 N u1 p1 c0 {2,D} -4 H u0 p0 c0 {1,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*1'], - ['CHANGE_BOND', '*3',1,'*2'], - ['LOSE_RADICAL','*3',1], - ['GAIN_RADICAL','*1',1], - ])), +# (Group().from_adjacency_list(""" +# multiplicity [2] +# 1 *1 O u0 p2 c0 {2,S} {4,S} +# 2 *2 N u0 p1 c0 {1,S} {3,D} +# 3 *3 N u1 p1 c0 {2,D} +# 4 H u0 p0 c0 {1,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*1'], +# ['CHANGE_BOND', '*3',1,'*2'], +# ['LOSE_RADICAL','*3',1], +# ['GAIN_RADICAL','*1',1], +# ])), -(Group().from_adjacency_list(""" -multiplicity [3] -1 *2 N u0 p2 c-1 {2,S} {4,S} -2 *3 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} -3 N u1 p1 c0 {2,S} {7,S} -4 *1 O u1 p2 c0 {1,S} -5 H u0 p0 c0 {2,S} -6 H u0 p0 c0 {2,S} -7 H u0 p0 c0 {3,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['CHANGE_BOND', '*1',1,'*2'], - ['LOSE_RADICAL','*1',1], - ['GAIN_RADICAL','*2',1], - ['LOSE_PAIR','*2',1], - ['GAIN_PAIR','*3',1], - ])), +# (Group().from_adjacency_list(""" +# multiplicity [3] +# 1 *2 N u0 p2 c-1 {2,S} {4,S} +# 2 *3 N u0 p0 c+1 {1,S} {3,S} {5,S} {6,S} +# 3 N u1 p1 c0 {2,S} {7,S} +# 4 *1 O u1 p2 c0 {1,S} +# 5 H u0 p0 c0 {2,S} +# 6 H u0 p0 c0 {2,S} +# 7 H u0 p0 c0 {3,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['CHANGE_BOND', '*1',1,'*2'], +# ['LOSE_RADICAL','*1',1], +# ['GAIN_RADICAL','*2',1], +# ['LOSE_PAIR','*2',1], +# ['GAIN_PAIR','*3',1], +# ])), -(Group().from_adjacency_list(""" -multiplicity [2] -1 *1 N u1 p2 c-1 {2,S} -2 *2 O u0 p2 c0 {1,S} {3,S} -3 *3 N u0 p0 c+1 {2,S} {4,S} {5,S} {6,S} -4 H u0 p0 c0 {3,S} -5 H u0 p0 c0 {3,S} -6 H u0 p0 c0 {3,S} -"""), - ReactionRecipe(actions=[ - ['BREAK_BOND', '*2',1,'*3'], - ['CHANGE_BOND', '*1',1,'*2'], - ['LOSE_PAIR','*1',1], - ['GAIN_PAIR','*3',1], - ])), +# (Group().from_adjacency_list(""" +# multiplicity [2] +# 1 *1 N u1 p2 c-1 {2,S} +# 2 *2 O u0 p2 c0 {1,S} {3,S} +# 3 *3 N u0 p0 c+1 {2,S} {4,S} {5,S} {6,S} +# 4 H u0 p0 c0 {3,S} +# 5 H u0 p0 c0 {3,S} +# 6 H u0 p0 c0 {3,S} +# """), +# ReactionRecipe(actions=[ +# ['BREAK_BOND', '*2',1,'*3'], +# ['CHANGE_BOND', '*1',1,'*2'], +# ['LOSE_PAIR','*1',1], +# ['GAIN_PAIR','*3',1], +# ])), ] def decay_species(spc, check_deterministic=True):