Repository navigation
Add ML potentials for the intramolecular energy of the perturbable molecule - #309
Merged
Merged
Conversation
…option for the EMLE model.
This branch was previously 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.
This PR adds an
ml_modeloption that replaces the force field with an ML potential for the intramolecular energy of the perturbable molecule, for relative and absolute free energies on the CUDA platform. It uses the end-state interpolation added to Sire in OpenBioSim/sire#559. The energy at λ is(1 − λ) E_ML(A) + λ E_ML(B) + E_MM(λ), where the ML energies of the two end states are evaluated as one batch each step, and the interactions with the environment stay MM, so the existing soft-core potentials and λ schedules are used unchanged.Options
ml_model: one of the following.ani2x,mace-off23-small,mace-off23-mediumormace-off23-large..model).file.py:functionormodule:function, that returns a custom model following the end-state interface documented in the README.ml_emle_model: the EMLE model used byani2xand MACE models for electrostatic embedding.ml_embedding:mechanical(default) orelectrostatic. With electrostatic embedding, stages are added at either end of the λ schedule that switch between mechanical and EMLE embedding, so that the alchemical stages use mechanical embedding. With theannihilateanddecoupleschedules, only the first stage is added, since the molecule is decoupled at λ = 1. The stages aren't saved in the configured schedule, so restarts and the config file are unaffected.ml_embedding_fraction: the fraction of λ taken by each embedding stage (default 0.1).ml_cutoff,ml_switch_widthandml_cuda_graph: the EMLE cutoff, the width of its switching region, and whether the model is captured in a CUDA graph.ML models aren't yet supported with GCMC, REST2 or
swap_end_states, and these combinations are rejected. Alchemical ions keep their end-state charges through the embedding stages.somd2-viewandsomd2-summaryignore the embedding settings when pairing vacuum legs with their free legs, since no embedding is applied without water.Validation
Ethane → methanol relative hydration free energies, and absolute hydration free energies of both molecules, were run with MM, ANI-2x with mechanical embedding and ANI-2x with EMLE embedding, using replica exchange with 11 windows and 1 ns per window.