Skip to content

Link atoms and subtractive embedding for ML/MM end-state FEP - #560

Merged
lohedges merged 18 commits into
develfrom
feature_ml_fep_link_atoms
Dec 4, 2026
Merged

lohedges merged 18 commits into
develfrom
feature_ml_fep_link_atoms

Conversation

@lohedges

@lohedges lohedges commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #559. The ML region of an interpolate="end_states" engine can now be part of a perturbable molecule, e.g. a mutated protein residue, and QM/MM electrostatic embedding is now subtractive.

Changes

  • Link atoms for end states. Each end state gets its own link atoms and charge shift. The atoms bonded across the boundary must be real, with the same element, in both end states. redistribute_charge works per end state, and QM regions in molecules that break or form bonds use each end state's connectivity.
  • Subtractive embedding. The QM atoms keep their MM charges, so OpenMM handles their long-range electrostatics (PME or reaction field). The embedding then only replaces the short-range Coulomb interactions with the switched MM charges, which are subtracted exactly, including the reaction field and excluded or scaled pairs. Truncating the embedding at the cutoff therefore no longer causes artefacts for charged QM regions. MM atoms are now selected and switched individually, which replaces the residue groups. The embed lever scales E_emb − E_C and scale_charges is removed from add_embedding_stages.
  • EMLE checks. sire.qm.emle warns if qm_charge doesn't match the MM charge of the QM region, and rejects calculators created with lambda_interpolate.
  • Constraint fix. A bond is now treated as broken or formed only when the connectivity0 and connectivity1 properties disagree. The previous zero-k check, added on devel in 13e11f7, dropped all X–H constraints in the QM region, so ML/MM dynamics blew up at 2 fs.
  • Faster GPU-resident embedding. QM–MM distances are no longer computed with cdist, whose exact mode took about half the GPU time. The RHFE EMLE water leg went from 4.3 to 1.9 ms/step.
  • Smaller fixes. The Python names of getMM2Atoms and get_link_atoms are fixed, and the reaction field of the QM forces is now serialised.

Validation

  • Chorismate mutase (charge −2 QM region, 16 Å cutoff). The RMS change in the forces on MM atoms between 16 and 30 Å cutoffs is 40–100× smaller than with the previous scheme, e.g. 0.84 rather than 37.8 kJ/mol/nm in the 16–18 Å shell. The energy changes by 0.16 rather than −337 kJ/mol. Dynamics at 2 fs with H-bond constraints were stable.

  • Ethane → methanol hydration with SOMD2 (kcal/mol, experiment −6.93):

    Model ΔΔG Cycle closure
    MM −5.83 ± 0.25
    ANI-2x mechanical −5.87 ± 0.15 −0.02 ± 0.18
    ANI-2x EMLE −8.55 ± 0.17 −0.04 ± 0.20

    Mechanical embedding agrees with MM. The EMLE excess over mechanical fell from about −3.5 to −2.7, since the cutoff artefact is gone. The rest is EMLE's known over-solvation with fixed-charge LJ and TIP3P.

  • SER → ALA in a capped pentapeptide, with the side chain and CA as the ML region and link atoms on CA–N and CA–C. Full results will come with the SOMD2 PR, which adds an ml_selection option.

Checklist

  • I confirm that I have merged the latest version of devel into this branch before issuing this pull request (e.g. by running git pull origin devel): [y]
  • I confirm that I have added a test for any new functionality in this pull request: [y]
  • I confirm that I have added documentation (e.g. a new tutorial page or detailed guide) for any new functionality in this pull request: [y]
  • I confirm that I have added a changelog entry to the changelog (we will add a link to this PR as part of the review): [y]
  • I confirm that I have permission to release this code under the MIT license (the Python API) or the LGPLv3+ license (everything else), as described in the LICENSE file: [y]

@lohedges

lohedges commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Looks like a C++ object is being destroyed after Python has shut down. Will debug locally.

@lohedges
lohedges merged commit 824de6d into devel Dec 4, 2026
5 checks passed
@lohedges
lohedges deleted the feature_ml_fep_link_atoms branch December 4, 2026 13:23

This branch was previously deployed

1 inactive deployment
sire-build — b10199c3 Deployed Dec 4, 2026 by lohedges via build (3.12, linux) #489
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant