Skip to content

Fix TS multiplicity from YAML input#882

Open
alongd wants to merge 1 commit intomainfrom
ts_mult
Open

Fix TS multiplicity from YAML input#882
alongd wants to merge 1 commit intomainfrom
ts_mult

Conversation

@alongd
Copy link
Copy Markdown
Member

@alongd alongd commented Apr 27, 2026

Issue

A TS species defined in input.yml with only is_ts: true and xyz (no smiles/adjlist) could be assigned the wrong multiplicity, causing Gaussian to reject the input with GL301. For example, a closed-shell TS with 24 electrons was written as 0 2 (mult=2), which is electronically impossible.

Root cause

ARCSpecies.from_dict (the path taken when main.py loads species from YAML via ARCSpecies(species_dict=spc)) called mol_from_xyz to perceive a 2D graph from the TS geometry, then blindly assigned self.multiplicity = self.mol.multiplicity. RMG's perception of TS-like geometries (partial bonds, near-radical atoms) routinely returns spurious biradical structures — for the failing case it returned O=[C][H][OH] with mult=2. Direct construction (ARCSpecies(label=..., is_ts=True, xyz=...)) was unaffected because init routes through determine_multiplicity, which skips the descriptor path for TSs and uses electron parity from xyz.

Fix

In from_dict, when is_ts=True and xyz is available, fall back to determine_multiplicity_from_xyz (electron-parity) instead of trusting the perceived mol.multiplicity. Non-TS behavior is unchanged; TSs without xyz still fall through to mol.multiplicity since there's no parity signal.

Test

Added a dict-construction assertion to test_determine_multiplicity for the failing TS xyz — this is the path the bug actually went through. The pre-existing direct-construction assertion was insufficient because it bypassed from_dict entirely.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.40%. Comparing base (f30f9cc) to head (85b76f7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #882      +/-   ##
==========================================
- Coverage   60.42%   60.40%   -0.02%     
==========================================
  Files         102      102              
  Lines       31096    31098       +2     
  Branches     8103     8104       +1     
==========================================
- Hits        18791    18786       -5     
- Misses       9961     9969       +8     
+ Partials     2344     2343       -1     
Flag Coverage Δ
functionaltests 60.40% <ø> (-0.02%) ⬇️
unittests 60.40% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant