Skip to content

Commit 1ac1dd5

Browse files
committed
remove non-spin conserving reactions in explorer
1 parent 36bceb3 commit 1ac1dd5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

arkane/explorer.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,16 @@ def execute(self, output_file, plot, file_format='pdf', print_summary=True, spec
264264
for r in rxn.reactants + rxn.products:
265265
if forbidden_structures.is_molecule_forbidden(r.molecule[0]):
266266
rm_rxns.append(rxn)
267+
268+
print("In ExplorerJob.execute\n",flush=True)
269+
print(f"Num reactants {len(rxn.reactants)}, num products {len(rxn.products)}\n",flush=True)
270+
if len(rxn.reactants) > 1 and len(rxn.products) > 1:
271+
num_unpaired_electrons_reactants = sum([r.multiplicity-1 for r in rxn.reactants])
272+
num_unpaired_electrons_products = sum([r.multiplicity-1 for r in rxn.products])
273+
print(f"Unpaired electrons {num_unpaired_electrons_reactants} => {num_unpaired_electrons_products}\n",flush=True)
274+
if num_unpaired_electrons_products!=num_unpaired_electrons_reactants:
275+
print("Removing reaction\n",flush=True)
276+
rm_rxns.append(rxn)
267277

268278
for rxn in rm_rxns:
269279
logging.info('Removing forbidden reaction: {0}'.format(rxn))

0 commit comments

Comments
 (0)