Commit f04b5c2
authored
Fix TS multiplicity from YAML input (#882)
## 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.2 files changed
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | | - | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
936 | 941 | | |
937 | 942 | | |
938 | 943 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2188 | 2188 | | |
2189 | 2189 | | |
2190 | 2190 | | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
2191 | 2214 | | |
2192 | 2215 | | |
2193 | 2216 | | |
| |||
0 commit comments