AlexandriaChemistry / AlexandriaChemistry/ACT

Fix custom long-range correction handling in `act_openmm.py`

未關閉
#1,344 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
C++
星號
18
分支
3
平均合併
42 分鐘
30 天內合併 PR
12

描述

`do_force_settings()` has two issues around `CustomNonbondedForce` long-range corrections.

First, there was a typo/mismatched method check:

```python
elif hasattr(force, 'setLongRangeCorrection'):
force.setUseLongRangeCorrection(useDispCorr)
```
The OpenMM method is setUseLongRangeCorrection(), so the check should be:

elif hasattr(force, 'setUseLongRangeCorrection'):

Second, after fixing that typo, useDispersionCorrection = True enables long-range correction for all custom nonbonded forces, including:
```
CoulombGAUSSIAN
UseLongRangeCorrection True
```

For PME with Gaussian charges, this seems wrong because PME already handles long-range electrostatics?

Suggested fix:

```
elif hasattr(force, 'setUseLongRangeCorrection'):
force.setUseLongRangeCorrection(
useDispCorr and force.getName().startswith("VanderWaals")
)
```
so it only enables LongRangeCorrection for VanderWaals.

Also note: a .dat key like useLongRangeCorrection = True is currently ignored; only useDispersionCorrection is read.
So maybe change that as well?

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start in act_openmm.py at do_force_settings() and inspect the CustomNonbondedForce method checks and .dat option parsing. Reproduce how useDispersionCorrection and useLongRangeCorrection are handled, then verify that the method check, force-name filtering, and configuration-key behavior match the resolved requirements.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
backend
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
64/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。