Repository navigation
Replies: 3 comments
|
The porposal looks good to me. For the possible erorrs, you can check if it is related to this PR #1877 |
|
Thank you for the quick review. About the force deviations: I checked PR #1877. It is already contained in the
For context, my own code before I applied the same normalisation as #1877 (it had the same weight underflow) showed errors of up to about 1 eV/Å in force on these structures for the zero-damping variant, so the fix matters for ordinary mixed-element systems too; I did not run upstream before #1877. I can share the scripts and the numbers, or look into the remaining deviation separately if you think it is worth it; I would not mix it into the D2/D3(0) work. Since the proposal looks good to you, I plan to proceed as follows, unless you prefer otherwise:
Two questions: who should review the |
|
You can start with the D3(0) case. All the PRs are reviewd by me. D2 does not seem to be very useful nowadays, and I need to make sure GPUMD doe not depend on other codes. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
I would like to propose two small additions to the empirical dispersion corrections that can be added to a NEP model in
run.in:dftd2: a new keyword that adds the pairwise DFT-D2 correction of Grimme (2006) to a NEP model (new module, no change to the existingdftd3keyword).dftd3: an optional last token,dftd3 <functional> <rc> <rc_cn> [zero|bj], selecting D3(0) zero damping. Without the token the behavior is unchanged (bj).Before writing any pull request I would like to ask whether these fit the development plan, how you would like them split, and who should review. I will not open a PR before we agree.
Motivation
We are building qNEP models for the dielectric response of polymers under AC electric fields. Modeling the density and the higher-order structure of polymers requires intra- and inter-chain dispersion interactions, which a NEP with a cutoff of a few angstrom cannot represent at long range.
Our training data are an open dataset of fluorocarbon molecules and PTFE structures computed with Quantum ESPRESSO using PBE-D3 with zero damping (dataset: https://doi.org/10.6084/m9.figshare.30801170, CC BY 4.0; described in Lee et al., J. Chem. Phys. 2026, https://doi.org/10.1063/5.0318718 and https://doi.org/10.1063/5.0315390) and our own Quantum ESPRESSO calculations at the same level (
vdw_corr = 'dft-d3',dftd3_version = 3). To avoid double counting, we subtract a two-body D3(0) contribution from the reference energies, forces and virials before training and add the same correction at run time. The run-time correction must be the same function as the one subtracted, which needs a D3(0) option in GPUMD (thedftd3keyword currently supports only BJ damping).Collaborators in our project also plan to compute new training data with the D2 form of Quantum ESPRESSO (
dftd3_version = 2: C6 and R0 from the D3 tables, as opposed tovdw_corr = 'grimme-d2'). They chose it for the cost of the reference calculations on very large systems and for how well it reproduces polymer densities in their own tests; we have not verified these points independently and mention them only as the reason for the request. A matching D2 correction (table qe, plain cutoff) would let us use the same function for subtraction and run-time addition.What is proposed
DFT-D2 (
dftd2 <s6> [<cutoff>] [table grimme2006|qe] [trunc sf|plain])-s6 C6_ij f(r)/r^6with the damping of Grimme (2006), C6 and R0 for H-Rn (Z <= 86), periodic images included, optionally with an energy- and force-shifted cutoff. The correction is external: it is not assumed to be part of the NEP training data.deformand NPT).dftd3.table qe/trunc plainreproduce the D2 form of Quantum ESPRESSOdftd3_version = 2(checked against QE 7.2). They are part of the proposal, because they are what our collaborators need to match their reference data. The defaulttable grimme2006is the table of Grimme (2006); it has not been validated against QE's owngrimme-d2option.D3(0) zero damping (
dftd3 pbe 12 6 zero)Validation done so far
(Local development fork; all numbers measured on one RTX A6000, CUDA 12.3.)
dftd3, so this looks like a float limit of the existing implementation, not of the new code. I can show the data.pytestfiles using small fixtures and an all-zero NEP model so that the dispersion term is isolated.Limitations I know of
gpu_macro.cuhwrappers and no CUDA-only calls, and the HIP makefile picks the files up by wildcard, but it has not been built. Help with a HIP build would be welcome.Questions
dftd3module? I would implement zero damping on top of the currentmasterversion offorce/dftd3/dftd3.cu, and I would not propose any other change to existing D3 code (no performance or bug-fix changes, since the module already evolves upstream).dftd2(new files plus the small registration changes inforce.cuh,nep.cu,run.cu, docs, example) and a second PR for thedftd3zero-damping token?doc/gpumd/input_parameters/)?Process
I have read
README.md(support and contributions) andAGENTS.md. Parts of the code were written with AI assistance (Claude Code); I reviewed them and am responsible for the validation. I will followAGENTS.mdand the PR template, and I will not submit anything outside the scope we agree on here.All reactions