-
Notifications
You must be signed in to change notification settings - Fork 1
fix(ml/mm): do ONIOM #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HaoZeke
wants to merge
23
commits into
metatomic
Choose a base branch
from
fix/oniom-subtraction
base: metatomic
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7abf851
fix(mta): implement ONIOM subtractive scheme for ML/MM boundary terms
HaoZeke 8cdda86
fix(mta): always set PyTorch threads to ntomp (fixes thread-MPI blow-up)
HaoZeke e45f75e
feat(mta): add link-atoms and electrostatic-embedding MDP options
HaoZeke 2314cd5
feat(mta): NNPot-style link atom replacement (correct ONIOM approach)
HaoZeke 16ba984
fix(mta): correct threading comment, model-driven embedding, link docs
HaoZeke 89616ec
fix(mta): provide requested charge inputs
HaoZeke dbb491e
merge: update metatomic base
HaoZeke 4c2bc65
test(mta): align ONIOM topology expectations
HaoZeke 0674569
test(threadmpi): wait on Windows thread handles
HaoZeke b21a99b
fix(mta): map link atoms by global atom index
HaoZeke 2799a41
chore(mta): avoid shadowed model index
HaoZeke 08b4864
fix(mta): support multiple link caps per boundary atom
HaoZeke 5cafa17
fix(mta): use active link distance value
HaoZeke e4f532e
fix(mta): honor PBC shifts for link caps
HaoZeke 42270f2
test(topology): cover shifted link force spread
HaoZeke eaae9b7
fix(mta): redistribute link cap output forces
HaoZeke cb7505c
test(topology): use tolerance for link force spread
HaoZeke 8d92223
fix(mta): single-own link cap outputs
HaoZeke 787a5f9
test(mta): require opt-in ONIOM preprocessing
HaoZeke ea93e8a
test(mta): fix ONIOM option test scaffolding
HaoZeke fa82917
feat(mta): make ONIOM preprocessing opt in
HaoZeke 9ffa3fe
test(mta): update ONIOM option refdata
HaoZeke d905082
fix(mta): build model pairlist from all plain pairs
HaoZeke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| .. _metatomic: | ||
|
|
||
| Metatomic potentials | ||
| ==================== | ||
|
|
||
| The Metatomic interface evaluates an exported atomistic model through the | ||
| applied-forces framework. The selected atoms are provided to the model as a | ||
| Metatomic ``System`` with positions, cell, periodic boundary conditions, atom | ||
| types, and engine-built neighbor lists. | ||
|
|
||
| By default, the Metatomic contribution is added on top of the unmodified | ||
| molecular-mechanics topology. This additive mode is useful as a control | ||
| calculation and for models that augment, rather than replace, force-field terms. | ||
|
|
||
| For embedded subsystem simulations where the Metatomic model replaces the | ||
| molecular-mechanics description of the selected atoms, :mdp:`metatomic-oniom` | ||
| enables the ONIOM-style subtractive scheme: | ||
|
|
||
| .. math:: | ||
|
|
||
| E = E_\mathrm{MM}(\mathrm{full}) + E_\mathrm{ML}(\mathrm{embedded}) | ||
| - E_\mathrm{MM}(\mathrm{embedded}) | ||
|
|
||
| The subtractive term is applied through embedded-system topology preprocessing: | ||
| bonded and non-bonded molecular-mechanics terms represented by the model are | ||
| removed from the classical force-field contribution, while the model energy is | ||
| added through the Metatomic force provider. Boundary bonded terms involving | ||
| both Metatomic and MM atoms remain in the molecular-mechanics topology. | ||
|
|
||
| Boundary link atoms | ||
| ------------------- | ||
|
|
||
| The :mdp:`metatomic-link-atoms` option enables hydrogen caps at bonds that cross | ||
| the Metatomic/MM boundary and requires :mdp:`metatomic-oniom`. Direct MM | ||
| neighbors bonded to selected Metatomic atoms are included in the embedded atom | ||
| set so the bonded terms at the boundary are handled consistently. During model | ||
| evaluation, these boundary atoms are represented as hydrogen link atoms placed | ||
| along the corresponding boundary bond. The link-atom position is part of the | ||
| automatic differentiation graph, so forces are propagated back to the real atoms | ||
| connected by the boundary bond. | ||
|
|
||
| This option requires a model trained for link-atom-capped boundary chemistry. | ||
| If the same boundary MM atom is bonded to multiple selected Metatomic atoms, | ||
| each cut bond is represented by a distinct hydrogen cap in the model input. | ||
|
|
||
| Model-requested charges | ||
| ----------------------- | ||
|
|
||
| Metatomic models can declare additional inputs through their | ||
| ``requested_inputs`` metadata. When a model requests ``charges`` or a | ||
| ``charges/<variant>`` input, |Gromacs| provides a per-atom Metatomic | ||
| ``TensorMap`` with ``quantity = charge`` and ``unit = e``. Charge inputs are | ||
| model-controlled; no :ref:`mdp` option enables or disables them. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,6 @@ the use of |Gromacs| for specific scientific problems. | |
| colvars | ||
| plumed | ||
| nnpot | ||
| metatomic | ||
| fmm | ||
|
|
||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3798,6 +3798,34 @@ interface implementation follow :ref:`nnpot`. | |
| (0.1) [nm] Distance between link atom and the bonded MM atom. | ||
|
|
||
|
|
||
| .. _mdp-metatomic: | ||
|
|
||
| Metatomic simulations | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| The Metatomic interface evaluates exported atomistic models through the | ||
| applied-forces framework. Further details are described in :ref:`metatomic`. | ||
|
|
||
| .. mdp:: metatomic-oniom | ||
|
|
||
| (false) Enable the subtractive ONIOM topology preprocessing for the selected | ||
| Metatomic input group. When enabled, bonded and non-bonded | ||
| molecular-mechanics terms represented by the model are removed from the | ||
| classical force-field contribution and the Metatomic model contribution is | ||
| added through the applied-forces framework. When disabled, the Metatomic | ||
| contribution is added on top of the unmodified molecular-mechanics topology. | ||
|
|
||
| .. mdp:: metatomic-link-atoms | ||
|
|
||
| (false) Enable hydrogen link atoms at bonds crossing the Metatomic/MM | ||
| boundary. Direct MM neighbors bonded to selected Metatomic atoms are included | ||
| in the embedded atom set and represented as hydrogen caps during model | ||
| evaluation. This requires :mdp:`metatomic-oniom` and a model trained for | ||
| link-atom-capped boundary chemistry. If a boundary MM atom is bonded to | ||
| multiple selected Metatomic atoms, each cut bond is represented by a distinct | ||
| hydrogen cap in the model input. | ||
|
Comment on lines
+3809
to
+3826
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the options exclusive? I wonder why we can't always turn on the ONIOM option. And maybe we should add a link to some deeper infos what ONIOM is. |
||
|
|
||
|
|
||
| .. _mdp-fmm: | ||
|
|
||
| Fast Multipole Method (FMM) Interface | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also link the page where we give all
additional inputsthat we support.