Repository navigation
fix(pme): correct virial prefactor sign after box updates - #77
Merged
xiaoxuan-yu merged 1 commit intoOct 8, 2026
Merged
xiaoxuan-yu merged 1 commit into
xiaoxuan-yu merged 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
PME 初始化使用正的
mprefactor = π²/β²,但控压更新盒子时使用负值,却仍沿用维里系数中的1 + mprefactor * m²,导致该项从正确的1 + π²m²/β²变为1 - π²m²/β²。因此,NPT 运行在控压更新后会计算出错误的 PME 维里,影响后续压力计算。
修复
将盒子更新路径的
mprefactor统一为正值,并将指数改为exp(-mprefactor * m²)。两处修改保持倒易空间能量系数不变,同时使六个维里分量与初始化公式一致。
验证