Repository navigation
Add torsion_window option to avoid torsion singularities at linear angles - #287
Merged
Merged
Conversation
lohedges
had a problem deploying
to
somd2-build
November 11, 2026 12:43 — with
GitHub Actions
Failure
This branch had an error being deployed
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.
Adds a
torsion_windowoption,autoby default, to avoid simulations crashing when an angle of a perturbable molecule becomes linear at one end state, e.g. a C=C bond that becomes C≡C, or a methyl that becomes a nitrile.Torsions and impropers through such an angle are interpolated to zero while the angle opens towards 180°. Near the linear end state they still carry part of their force constant while the angle's atoms are almost collinear, where their forces diverge. This crashed hiv1_protease 13~14 from the OpenFE benchmark set at λ = 0.8–0.9, with or without replica exchange, and matches the failures OpenFE reported for single-to-triple-bond edges in janssen_bace.
When
autofinds an angle that is linear at only one end state, with a non-zero torsion or improper through it at the other end state, the torsions and impropers of that molecule change over only part of each stage of the λ schedule: the first half when the angle is linear at λ = 1, the second half when it is linear at λ = 0, and the middle half (with a warning) when both occur. Within that window they follow a smoothstep, which roughly doubled the exchange rate at the end of the window for hiv1 13~14, compared with a linear ramp. Other molecules keep the original schedule, via a per-molecule schedule.trueapplies the window whenever an angle becomes linear, and is an error if it can't be applied.falsedisables it. A warning is logged if a non-zero term passes through an angle at the end state where it's linear, which the schedule can't help.With the window, hiv1 13~14 runs with all 11 windows exchanging, and the alkyne angles reach 179.5° at λ = 1 without problems. A scan of the 604 OpenFE benchmark edges found that
autoapplies the window to 5 of them: hiv1_protease 13~14, bace CAT-17i~CAT-17c and CAT-24~CAT-17i, tyk2 jmc_28~jmc_30, and p38 2aa~3flw.Other changes:
torsion_windows, and restarts check that they match. Simulations started before this option existed must be restarted withtorsion_windowset tofalseif a window would now be applied.