Re-attach structure properties and support D3 dispersion in TorchSim - #1544
Open
akwarii wants to merge 2 commits into
Open
Re-attach structure properties and support D3 dispersion in TorchSim#1544akwarii wants to merge 2 commits into
akwarii wants to merge 2 commits into
Conversation
Contributor
Author
|
The test that failed seems to be related to the recent bump of phonopy to v4 and not to this PR. |
Member
|
Could you restrict phonopy for now? Thanks a lot! |
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.
Summary
Preserve
Structure.propertiesandStructure.site_propertiesacross TorchSim runs. TorchSim's SimState conversions (ts.io.structures_to_state()/state.to_structures()) currently drops both, so properties set on the input structures are re-attached onto the output ones once the calculation finishes.Add support for a D3 dispersion correction on any TorchSim model. Passing
dispersion=True(plusa1,a2,s8, and ad3_paramsD3Parametersinstance, withs6optional) to a maker's model_kwargs now builds aD3DispersionModeland sums it with the base model viaSumModel. The dispersion correction intentionally does not inherit the base model's cutoff, since D3's long-range tail needs a much larger cutoff than typical short-range ML potentials.None of these changes are breaking.
Additional dependencies introduced (if any)
None.
Note
The functional-dependent BJ damping parameters (a1, a2, s8) and the element reference data (d3_params) must currently be supplied explicitly by the caller; there is no bundled lookup table for common XC functionals (e.g. from https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml).
Checklist
Work-in-progress pull requests are encouraged, but please put [WIP] in the pull request
title.
Before a pull request can be merged, the following items must be checked:
The easiest way to handle this is to run the following in the correct sequence on
your local machine. Start with running
ruffandruff formaton your new code. This willautomatically reformat your code to PEP8 conventions and fix many linting issues.
Run ruff on your code.
type check your code.
Note that the CI system will run all the above checks. But it will be much more
efficient if you already fix most errors prior to submitting the PR. It is highly
recommended that you use the pre-commit hook provided in the repository. Simply run
pre-commit installand a check will be run prior to allowing commits.