AlexandriaChemistry / AlexandriaChemistry/ACT

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

Aberta
#1,344 1 comentário 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
C++
Estrelas
18
Forks
3
Merge médio
42min
PRs com merge (30d)
12

Descrição

`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?

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
backend
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
64/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.