Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion arc/species/species.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,12 @@ def from_dict(self, species_dict):
if self.bond_corrections:
self.long_thermo_description += f'Bond corrections: {self.bond_corrections}\n'
if self.multiplicity is None:
self.multiplicity = self.mol.multiplicity
if self.is_ts and self.get_xyz(generate=False):
self.determine_multiplicity_from_xyz()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding a log line here- so it will be easier to debug if there's a multiplicity issue that still arises.

Something like:
logger.debug(f"TS species {self.label}: using xyz-based multiplicity {self.multiplicity} (ignored mol.multiplicity)") would make debugging much easier down the road, especially since a wrong multiplicity here causes Gaussian to reject the job entirely.

logger.debug(f'TS species {self.label}: using xyz-based multiplicity '
f'{self.multiplicity} (ignored mol.multiplicity)')
else:
self.multiplicity = self.mol.multiplicity
if self.charge is None:
self.charge = self.mol.get_net_charge()
if 'conformers' in species_dict:
Expand Down
23 changes: 23 additions & 0 deletions arc/species/species_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,29 @@ def test_determine_multiplicity(self):
ch_ts = ARCSpecies(label='C--H-TS', xyz='C 0 0 0\nH 1 2 5', is_ts=True)
self.assertEqual(ch_ts.multiplicity, 2)

ts_1_xyz = """H -2.99394700 1.00970200 0.09451400
O -4.10192200 0.13578500 -0.05953100
H -4.43761000 -0.35213100 0.70859500
C -2.22272000 0.16048700 -0.01004900
O -1.59892700 -0.79618100 0.08758500"""
ts_1_spc = ARCSpecies(label='TS1', is_ts=True, xyz=ts_1_xyz)
self.assertEqual(ts_1_spc.multiplicity, 1)

ts_1_spc_from_dict = ARCSpecies(species_dict={'label': 'TS1', 'is_ts': True, 'xyz': ts_1_xyz})
self.assertEqual(ts_1_spc_from_dict.multiplicity, 1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a known TS with a multiplicity of 2 (actual radical) to make sure the XYZ doesn't flatten it to 1?

# Test a known doublet TS from a Gaussian output file (NH3 + H = NH2 + H2).
# Verify that xyz-based electron counting (11 electrons → mult 2) wins over mol.multiplicity.
ts_doublet_path = os.path.join(ARC_TESTING_PATH, 'freq', 'TS_NH3+H=NH2+H2.out')
ts_doublet = ARCSpecies(label='TS_NH3+H', is_ts=True, xyz=ts_doublet_path)
self.assertIsNotNone(ts_doublet.mol)
self.assertEqual(ts_doublet.multiplicity, 2)
# Simulate a mol that incorrectly perceives multiplicity as 1, and verify xyz detection still gives 2.
ts_doublet.multiplicity = None
ts_doublet.mol.multiplicity = 1
ts_doublet.determine_multiplicity_from_xyz()
self.assertEqual(ts_doublet.multiplicity, 2)

def test_cluster_tsgs(self):
"""Test the cluster_tsgs() method."""
xyz_1 = """N 0.9177905887 0.5194617797 0.0000000000
Expand Down