Electronic entropy uses q = 2S+1 (thermo.py:_compute_electronic_partition_function), but the spin comes from system.py spin(charge) which only checks charge parity: 0.5 if charge is odd else 0.0. It never counts electrons and there is no way to specify the multiplicity, so open-shell neutral species get the wrong electronic partition function and entropy, silently.
Repro:
from ThermoScreening.thermo.system import spin
print(spin(0)) # 0.0 -> multiplicity 1
# O2 is a ground-state triplet (multiplicity 3); OH/NO/CH3 radicals are doublets (multiplicity 2)
Impact (S_elec, cal/(mol*K)): O2 triplet gets 0.0 instead of R*ln(3)=2.18 (~0.65 kcal/mol error in -TS); neutral doublet radicals get 0.0 instead of R*ln(2)=1.38. Charged species happen to work for the odd/even cases the parity heuristic covers.
Suggested fix: compute electrons = sum(atomic numbers) - charge and derive the default multiplicity from its parity; preferably add an explicit spin/multiplicity argument to System (threaded through Thermo) so triplets and higher multiplicities are representable, warning when spin is guessed. The thermo.py formulas (q=2S+1, S_elec=R ln q) are correct given the spin. Found alongside #59.
Electronic entropy uses
q = 2S+1(thermo.py:_compute_electronic_partition_function), but the spin comes fromsystem.py spin(charge)which only checks charge parity:0.5 if charge is odd else 0.0. It never counts electrons and there is no way to specify the multiplicity, so open-shell neutral species get the wrong electronic partition function and entropy, silently.Repro:
Impact (S_elec, cal/(mol*K)): O2 triplet gets 0.0 instead of
R*ln(3)=2.18(~0.65 kcal/mol error in -TS); neutral doublet radicals get 0.0 instead ofR*ln(2)=1.38. Charged species happen to work for the odd/even cases the parity heuristic covers.Suggested fix: compute electrons = sum(atomic numbers) - charge and derive the default multiplicity from its parity; preferably add an explicit spin/multiplicity argument to
System(threaded throughThermo) so triplets and higher multiplicities are representable, warning when spin is guessed. Thethermo.pyformulas (q=2S+1,S_elec=R ln q) are correct given the spin. Found alongside #59.