Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Mismatched conformer degrees of freedom pass silently through TST, then surface as a bare "Singular matrix" in the MSC solve

未关闭
#3,003 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@alongd 已经在做这个了。

开始于 2026年8月25日。

  • #3004 来自 @alongd —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
numpy, python
领域
backend

调研方向

从 rmgpy/reaction.py:1441 中的 Reaction.calculate_tst_rate_coefficient 和 rmgpy/pdep/msc.pyx 中的 np.linalg.solve 调用开始。跟踪现有的 b NaN 警告,并确定是否应报告不匹配的 mode 类或奇异矩阵上下文。完成标准是:非对称不匹配或求解失败会报告可采取行动的诊断详细信息,而不是静默失败或仅报告 "Singular matrix"。

由索引模型根据 Issue 内容生成。

描述

Ran into both of these while splicing QM transition states into an otherwise RMG-estimated pressure-dependent network, and they compound in a way that made the diagnosis much harder than it needed to be.

If the transition state conformer carries translation and rotation but the wells are vibration-only (or the other way round), Reaction.calculate_tst_rate_coefficient (rmgpy/reaction.py:1441) just multiplies the partition functions together — nothing anywhere in it looks at what modes either side actually has. In my case Q‡/Q_reactant was off by ~1e14 and k_TST(3200 K) came out at 1.8e26 s^-1 for a unimolecular step.

That rescales k(E), and the modified strong collision solve then dies at np.linalg.solve(a_mat, b) in rmgpy/pdep/msc.pyx with nothing but numpy.linalg.LinAlgError: Singular matrix — no grain, no J, no temperature, no pressure. I ended up bisecting by hand down to grain 346 / J=0 / 3200 K / 0.1 bar.

The bit that struck me is that the intent is already there a few lines up: b gets checked with np.isnan and logs a warning naming the grain and the isomer. a_mat has no equivalent check, and it's the argument that actually fails.

A warning in calculate_tst_rate_coefficient when the reactant and TS conformers carry different mode classes, or just the grain/J/T/P coordinates on the singular-matrix failure, would have turned a two-hour hunt into an immediate error message. Either one alone would have done it.

One thing worth flagging for anyone fixing this: the loud failure only happens when the mismatch is asymmetric. I checked afterwards, and if you put translation and rotation on the wells and the TS alike, the partition functions cancel again — the solve succeeds and the rate coefficient comes back unchanged, on a network that's still wrong. So the singular matrix isn't a general tripwire for this, which is an argument for the warning rather than relying on the crash.

Happy to open a PR for both.

主要语言
Python
星标
539
派生
264
平均合并
7 天 19 小时
30 天内合并 PR
2

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ReactionMechanismGenerator/RMG-Py 的其他 Issue

查看 ReactionMechanismGenerator/RMG-Py 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。