Skip to content

Commit 1039e88

Browse files
authored
Send the species multiplicity to Arkane's input file (#804)
To allow Arkane to process (and differentiate between) singlet and triplet forms of the same structure. See ReactionMechanismGenerator/RMG-Py#2854
2 parents edf2b0f + 470debc commit 1039e88

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

arc/statmech/arkane.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
% for spc in species_list:
5151
% if spc['smiles']:
5252
species('${spc['label']}', '${spc['path']}'${spc['pdep_data'] if 'pdep_data' in spc else ''},
53-
structure=SMILES('${spc['smiles']}'))
53+
structure=SMILES('${spc['smiles']}'), spinMultiplicity=${spc['multiplicity']})
5454
% else:
5555
species('${spc['label']}', '${spc['path']}'${spc['pdep_data'] if 'pdep_data' in spc else ''})
5656
% endif
@@ -325,7 +325,9 @@ def render_arkane_input_template(self,
325325
if e0_only or spc.compute_thermo:
326326
species_list.append({'label': spc.label,
327327
'path': spc.yml_path or os.path.join(statmech_dir, 'species', f'{spc.label}.py'),
328-
'smiles': spc.mol.copy(deep=True).to_smiles() if not spc.is_ts else ''})
328+
'smiles': spc.mol.copy(deep=True).to_smiles() if not spc.is_ts else '',
329+
'multiplicity': spc.multiplicity,
330+
})
329331
ts_list = [{'label': rxn.ts_species.label,
330332
'path': rxn.ts_species.yml_path or os.path.join(statmech_dir, 'TSs', f'{rxn.ts_species.label}.py')}
331333
for rxn in self.reactions] if self.reactions else list()

arc/statmech/arkane_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def test_generate_arkane_input(self):
154154
input_path = os.path.join(statmech_dir, 'input.py')
155155
expected_lines = ["#!/usr/bin/env python",
156156
"title = 'Arkane kinetics calculation'",
157-
" structure=SMILES('C[NH]'))",
158-
" structure=SMILES('[CH2]N'))",
157+
" structure=SMILES('C[NH]'), spinMultiplicity=2)",
158+
" structure=SMILES('[CH2]N'), spinMultiplicity=2)",
159159
" label='CH3NH <=> CH2NH2',",
160160
" reactants=['CH3NH'],",
161161
" products=['CH2NH2'],",

0 commit comments

Comments
 (0)