Skip to content

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Aug 8, 2025

This addresses #3099.

Summary by CodeRabbit

  • Documentation
    • Added a new citation for the "DeePMD-kit v3" paper to the list of recommended references.
    • Clarified best practices for applying D3 dispersion corrections, advising users to train models without dispersion and apply corrections during simulation.
    • Introduced a new section in the documentation explaining how to combine DeePMD models with D3 dispersion in LAMMPS, including example commands.
    • Updated example README files with guidance on efficient model training and use of dispersion corrections.

Copilot AI review requested due to automatic review settings August 8, 2025 08:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds documentation about using LAMMPS D3 dispersion corrections with DeePMD-kit models. The documentation explains that it's more efficient to train models on plain DFT data without dispersion and add the dispersion correction during simulation using LAMMPS commands.

  • Adds a new section to LAMMPS command documentation explaining D3 dispersion integration
  • Includes practical examples of using pair_style dispersion/d3 with DeePMD models
  • Updates existing documentation to discourage training directly against dispersion-corrected data

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
examples/water/d3/README.md Adds important note discouraging training against dispersion-corrected data
doc/third-party/lammps-command.md Adds new D3 dispersion section with examples and reorganizes content structure
doc/model/pairtab.md Adds note referencing the new D3 dispersion documentation
doc/index.rst Updates citation with DeePMD-kit v3 reference

@njzjz njzjz linked an issue Aug 8, 2025 that may be closed by this pull request
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jinzhe Zeng <njzjz@qq.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

The documentation was updated to add a new citation for the DeePMD-kit v3 paper and to clarify best practices for applying D3 dispersion corrections. Instructions and notes were added to multiple documentation files, emphasizing that dispersion corrections should be applied during simulation rather than during model training.

Changes

Cohort / File(s) Change Summary
Citation Update
doc/index.rst
Added a new citation entry for the DeePMD-kit v3 paper published in 2025.
D3 Dispersion Best Practices
doc/model/pairtab.md, examples/water/d3/README.md
Added notes advising users to train models without dispersion corrections and to apply D3 dispersion during simulation using LAMMPS.
LAMMPS Documentation Restructuring & D3 Dispersion Usage
doc/third-party/lammps-command.md
Reorganized documentation to group related sections and added a new subsection explaining how to use D3 dispersion corrections in LAMMPS with DeePMD models.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DeePMD Model
    participant LAMMPS
    participant D3 Dispersion

    User->>DeePMD Model: Train model (without dispersion correction)
    User->>LAMMPS: Set up simulation with DeePMD model
    User->>LAMMPS: Add pair_style dispersion/d3
    LAMMPS->>D3 Dispersion: Apply D3 correction during simulation
    LAMMPS->>User: Output results (with D3 correction applied)
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

LAMMPS

Suggested reviewers

  • wanghan-iapcm
  • njzjz

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02ba4e7 and b1bfba0.

📒 Files selected for processing (1)
  • doc/third-party/lammps-command.md (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • doc/third-party/lammps-command.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (27)
  • GitHub Check: Test Python (6, 3.12)
  • GitHub Check: Test Python (6, 3.9)
  • GitHub Check: Test Python (5, 3.9)
  • GitHub Check: Test Python (5, 3.12)
  • GitHub Check: Test Python (4, 3.12)
  • GitHub Check: Test Python (2, 3.12)
  • GitHub Check: Test Python (3, 3.12)
  • GitHub Check: Test Python (3, 3.9)
  • GitHub Check: Test Python (4, 3.9)
  • GitHub Check: Test Python (1, 3.9)
  • GitHub Check: Test Python (2, 3.9)
  • GitHub Check: Test Python (1, 3.12)
  • GitHub Check: Test C++ (true)
  • GitHub Check: Test C++ (false)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (c-cpp)
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Build C++ (clang, clang)
  • GitHub Check: Build C++ (rocm, rocm)
  • GitHub Check: Build wheels for cp311-macosx_x86_64
  • GitHub Check: Build wheels for cp311-win_amd64
  • GitHub Check: Build C++ (cuda120, cuda)
  • GitHub Check: Build C++ (cuda, cuda)
  • GitHub Check: Build wheels for cp310-manylinux_aarch64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)
  • GitHub Check: Build C library (2.14, >=2.5.0,<2.15, libdeepmd_c_cu11.tar.gz)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
examples/water/d3/README.md (1)

3-6: Tighten wording and fix grammar in the IMPORTANT note

Improve readability and correctness; no technical content change.

 > [!IMPORTANT]
- > It is more efficiently to train a model using plain DFT calculations without the dispersion correction, and add the dispersion correction during the simulation via the LAMMPS [`pair_style dispersion/d3` command](https://docs.lammps.org/pair_dispersion_d3.html#pair-style-dispersion-d3-command).
- > Train against data with dispersion directly is discouraged.
+ > It is more efficient to train models on plain DFT calculations (without dispersion corrections) and to add the dispersion correction during simulation via the LAMMPS [`pair_style dispersion/d3` command](https://docs.lammps.org/pair_dispersion_d3.html#pair-style-dispersion-d3-command).
+ > Training directly against dispersion‑corrected data is discouraged.
doc/model/pairtab.md (1)

106-112: Polish the note’s wording (grammar/clarity)

Small grammar fixes; no change in meaning.

-:::{note}
-The above example shows a example of combining D3 dispersion.
-However, it is more efficiently to train a model using plain DFT calculations without the dispersion correction, and add the dispersion correction during the simulation via the LAMMPS [`pair_style dispersion/d3` command](https://docs.lammps.org/pair_dispersion_d3.html#pair-style-dispersion-d3-command).
-Train against data with dispersion directly is discouraged.
-See the [D3 dispersion section](../third-party/lammps-command.md#d3-dispersion) for details.
-:::
+:::{note}
+The above is an example of combining D3 dispersion.
+However, it is more efficient to train models on plain DFT calculations (without dispersion corrections) and to add the dispersion correction during simulation via the LAMMPS [`pair_style dispersion/d3` command](https://docs.lammps.org/pair_dispersion_d3.html#pair-style-dispersion-d3-command).
+Training directly against dispersion‑corrected data is discouraged.
+See the [D3 dispersion section](../third-party/lammps-command.md#d3-dispersion) for details.
+:::
doc/third-party/lammps-command.md (2)

267-276: Minor wording fix in the examples lead-in

Tighten phrasing.

-In order of computing the 9-component per-atom stress
+To compute the 9‑component per‑atom stress

294-303: Fix typo “detailes” → “details”

Small editorial cleanup.

-`c_flux` is a global vector of length 6. The first three components are the $x$, $y$ and $z$ components of the full heat flux vector. The others are the components of the so-called convective portion, see [LAMMPS doc page](https://docs.lammps.org/compute_heat_flux.html) for more detailes.
+`c_flux` is a global vector of length 6. The first three components are the $x$, $y$, and $z$ components of the full heat flux vector. The others are the components of the so-called convective portion; see the [LAMMPS doc page](https://docs.lammps.org/compute_heat_flux.html) for more details.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3be0755 and 973d5d2.

📒 Files selected for processing (4)
  • doc/index.rst (1 hunks)
  • doc/model/pairtab.md (1 hunks)
  • doc/third-party/lammps-command.md (6 hunks)
  • examples/water/d3/README.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:32:11.479Z
Learnt from: 1azyking
PR: deepmodeling/deepmd-kit#4169
File: examples/hessian/single-task/input.json:3-59
Timestamp: 2024-10-08T15:32:11.479Z
Learning: In the deepmd-kit project, having different `rcut` values for `repinit` and `repformer` is acceptable when they align with existing configurations, such as in `examples/water/dpa2/input_torch.json`.

Applied to files:

  • doc/model/pairtab.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (29)
  • GitHub Check: Test Python (6, 3.9)
  • GitHub Check: Test Python (6, 3.12)
  • GitHub Check: Test Python (4, 3.9)
  • GitHub Check: Test Python (4, 3.12)
  • GitHub Check: Test Python (5, 3.12)
  • GitHub Check: Test Python (2, 3.12)
  • GitHub Check: Test Python (5, 3.9)
  • GitHub Check: Test Python (2, 3.9)
  • GitHub Check: Test Python (3, 3.9)
  • GitHub Check: Test Python (1, 3.12)
  • GitHub Check: Test Python (3, 3.12)
  • GitHub Check: Test Python (1, 3.9)
  • GitHub Check: Analyze (python)
  • GitHub Check: Test C++ (false)
  • GitHub Check: Test C++ (true)
  • GitHub Check: Build wheels for cp311-macosx_arm64
  • GitHub Check: Build wheels for cp311-macosx_x86_64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Build wheels for cp310-manylinux_aarch64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Build wheels for cp311-win_amd64
  • GitHub Check: Analyze (c-cpp)
  • GitHub Check: Build C library (2.14, >=2.5.0,<2.15, libdeepmd_c_cu11.tar.gz)
  • GitHub Check: Build C++ (cuda, cuda)
  • GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)
  • GitHub Check: Build C++ (clang, clang)
  • GitHub Check: Build C++ (cpu, cpu)
  • GitHub Check: Build C++ (cuda120, cuda)
  • GitHub Check: Build C++ (rocm, rocm)
🔇 Additional comments (1)
doc/third-party/lammps-command.md (1)

232-232: Section reorganization LGTM

Introducing “Combine with other commands” improves discoverability and structure.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
@njzjz njzjz requested a review from wanghan-iapcm August 8, 2025 08:23
@codecov
Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.70%. Comparing base (3be0755) to head (b1bfba0).
⚠️ Report is 75 commits behind head on devel.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #4875   +/-   ##
=======================================
  Coverage   84.70%   84.70%           
=======================================
  Files         700      700           
  Lines       68146    68146           
  Branches     3542     3542           
=======================================
+ Hits        57720    57722    +2     
- Misses       9291     9292    +1     
+ Partials     1135     1132    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Aug 11, 2025
Merged via the queue into deepmodeling:devel with commit c7d8da6 Aug 11, 2025
60 checks passed
ChiahsinChu pushed a commit to ChiahsinChu/deepmd-kit that referenced this pull request Dec 17, 2025
This addresses deepmodeling#3099.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Added a new citation for the "DeePMD-kit v3" paper to the list of
recommended references.
* Clarified best practices for applying D3 dispersion corrections,
advising users to train models without dispersion and apply corrections
during simulation.
* Introduced a new section in the documentation explaining how to
combine DeePMD models with D3 dispersion in LAMMPS, including example
commands.
* Updated example README files with guidance on efficient model training
and use of dispersion corrections.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <njzjz@qq.com>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] _Integrate Grimme DFTD-3 or DFTD-4 into DeepMD-kit

2 participants