jinzhezenggroup/computational-chemistry-agent-skills/deepmd-python-inference
Claude Code and agent skill by jinzhezenggroup/computational-chemistry-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Run Python inference with DeePMD-kit models using the DeepPot API. Use when the user wants to load a checkpoint, frozen model (.pb or .pth), DPA4/SeZM AOTInductor deployment archive (.pt2), or built-in pretrained model in Python; predict energy/force/virial; evaluate supported descriptors; calculate model deviation; or use `dp test` against labeled data.
Install
npx vskill@latest install jinzhezenggroup/computational-chemistry-agent-skills/deepmd-python-inferenceSKILL.md
DeePMD-kit Python Inference
Load a trained DeePMD-kit model in Python and predict energy, forces, and virial for atomic configurations. Also covers CLI-based testing with dp test.
Quick Start
Agent Responsibilities
- Determine the model source:
- Frozen model file (
.pthfor conventional PyTorch,.pbfor TensorFlow, or.pt2for DPA4/SeZM) - Built-in pretrained model name (e.g.,
DPA-3.2-5M) - PyTorch checkpoint (
.pt), whose stored model configuration must be inspected before choosing an inference or export path
- Read
references/model-artifacts.mdfor.pt/.pt2models or whenever the artifact route is unclear. - Read
references/held-out-evaluation.mdfor complete labeled evaluation used for checkpoint selection or production admission. - Determine the inference task:
- Single-frame prediction (energy, force, virial)
- Batch prediction over multiple frames
- Descriptor evaluation
- Model deviation calculation
- CLI-based testing against labeled data
- Before using descriptor or embedding hooks, confirm that the selected
artifact supports them; a loadable .pt2 does not necessarily contain the serialized model required by those hooks.
- Help the user prepare input arrays in the correct format.
- Run inference and report results.
Python API: DeepPot
Load a Model
Built-in pretrained model names include DPA-3.3-1M, DPA-3.2-5M, DPA-3.1-3M, DPA3-Omol-Large, etc. DeePMD-kit will automatically download and cache the model on first use.
Predict Energy, Forces, and Virial
Non-periodic Systems
For non-periodic (isolated) systems, pass cell=None:
Batch Prediction
Process multiple frames at once:
Evaluate Descriptors
Extract the descriptor (atomic environment representation) from the model:
This can also be done via CLI:
Calculate Model Deviation
Compare predictions from multiple models to estimate uncertainty:
Important: avoid loading the same model multiple times in a loop, as this can cause memory leaks.
CLI Testing: dp test
Test a frozen model against labeled data:
dp test Options
| Option | Description | |
|---|---|---|
-m MODEL | Path to the frozen model file | |
-s SYSTEM | Path to the test data system | |
-n NUMB | Number of test frames | |
-d DETAIL | Output prefix for detailed results | |
--shuffle-test | Shuffle test frames |
Output
dp test prints RMSE values for energy, force, and virial:
With -d test_detail, per-frame predictions are saved to files for further analysis.
The 30-frame commands above are bounded examples, not complete held-out evaluation. Use references/held-out-evaluation.md when the result admits a model for production.
Complete Example: Train, Freeze, and Inference
Using Pretrained Models Directly
Built-in pretrained models can be used without any training:
To download pretrained models explicitly:
Input Array Format Reference
| Array | Shape | Unit | Description | |
|---|---|---|---|---|
coord | (nframes, natoms\*3) | Angstrom | Atomic coordinates, flattened | |
cell | (nframes, 9) | Angstrom | Cell vectors, row-major (a1x,a1y,a1z,a2x,...) | |
atype | (natoms,) | - | Atom type indices matching model's type_map |
| Output | Shape | Unit | Description | |
|---|---|---|---|---|
e | (nframes, 1) | eV | Total energy per frame | |
f | (nframes, natoms, 3) | eV/A | Forces on each atom | |
v | (nframes, 9) | eV | Virial tensor per frame |
Agent Checklist
- [ ] Model file exists and is accessible (
.pb,.pth,.pt,.pt2, or valid pretrained name) - [ ] An ambiguous
.ptcheckpoint was classified from its stored configuration, not its filename - [ ] The requested descriptor or embedding operation is supported by the specific artifact, not inferred from its suffix
- [ ]
coordarray is shaped (nframes, natoms\*3) and in Angstrom - [ ]
cellarray is shaped (nframes, 9) orNonefor non-periodic systems - [ ]
atypeindices match the model'stype_mapordering - [ ] For model deviation, multiple models are loaded only once (not in a loop)
- [ ] Results are reported with correct units (eV, eV/A)
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmachine-learning-potentials/deepmd-python-inference/SKILL.md
Popularity
- Repository stars
- 155
- Repository forks
- 29
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jinzhezenggroup/computational-chemistry-agent-skills/deepmd-python-inference)