Dpgen simplify

From jinzhezenggroup/computational-chemistry-agent-skills · View interactive version

Dpgen simplify is an AI agent skill from the GitHub repository jinzhezenggroup/computational-chemistry-agent-skills. Prepare, explain, validate, and run DP-GEN simplify workflows for reducing repeated or redundant DeepMD datasets. Use when the user wants to generate or modify `param.json` and `machine.json`, run `dpgen simplify param.json machine.json`, organize repeated simplify experiments, or inspect simplify o

How to use this skill

Skill file

DP-GEN Simplify

Use this skill when the user wants to prepare, explain, validate, or execute the dpgen simplify workflow.

This skill is for dataset simplification workflows where the user already has candidate data in DeepMD-compatible format and wants to reduce repeated or redundant structures through iterative selection.

Core Rule (Critical)

DP-GEN simplify always uses two parameter classes and therefore two JSON files:

Run exactly:

dpgen simplify param.json machine.json

Environment boundary rule:

Agent responsibilities

When using this skill, the agent should:

  1. confirm that the task is a simplify workflow
  2. check whether existing configs or templates are already available
  3. collect only the missing dataset, training, FP, and machine inputs
  4. generate or patch param.json
  5. generate or patch machine.json
  6. explain important simplify parameters in plain language when asked
  7. validate the workflow before execution
  8. provide the exact command for running simplify
  9. if requested, help structure repeated experiments
  10. after execution, summarize outputs and next inspection targets

Working policy

1. Ask only for missing inputs

Do not ask the user for everything if part of the configuration is already available.

If the user already provides:

then patch those files instead of rebuilding everything from scratch.

2. Preserve the user's scientific choices

Do not silently change:

If a value looks scientifically questionable, explain the concern instead of silently replacing it.

3. Keep local and scheduler execution explicit

If the user wants local execution, produce local-friendly commands.

If the user wants scheduler execution, produce scheduler-friendly commands and keep queue, partition, and resource requests explicit.

Do not invent scheduler module names or executable paths.

4. Do not invent environment activation commands

If the user already has a working activation command such as:

reuse it exactly.

If execution is requested and the activation method is unknown, ask the user for the precise activation command.

Do not guess conda environment names, module names, or site-specific paths.

4.1 Outer launcher policy

Use an activated DP-GEN environment and verify with:

dpgen -h

Do not start simplify from a shell where dpgen is unavailable.

4.2 Outer vs inner runtime boundaries (critical)

Treat simplify execution as two separate environment layers:

  1. Outer layer: the shell that launches dpgen simplify param.json machine.json (must have dpgen in PATH)
  2. Inner layer: stage tasks dispatched by DP-GEN (train / model_devi / fp) on server/runtime side

Even if the outer layer is correct, inner stage tasks still need explicit runtime setup in machine.json.

Do not assume the outer shell environment will be inherited by dispatched stage jobs.

For scheduler-style execution, resources.source_list must explicitly activate the required runtime environment.

5. Prefer reproducible output layout

When generating a simplify workflow, keep files organized and predictable.

Recommended structure:

project/
├── param.json
├── machine.json
├── run.sh
├── logs/
└── summary/

For repeated experiments:

project/
├── base/
├── exp_01/
├── exp_02/
├── exp_03/
└── summary/

Minimum required inputs

Collect the following information before generating files.

Dataset information

Simplify controls

Training setup

FP setup

Execution setup

For each stage train, model_devi, and fp, collect or preserve:

Choose a runtime profile first, then fill the matching template:

How to build `param.json`

Construct param.json around these logical blocks:

  1. element and mass definitions
  2. data source and batch settings
  3. model ensemble count
  4. default DeePMD training parameters
  5. FP backend settings
  6. simplify pick settings
  7. trust thresholds

Key fields usually include:

selected FP schema requires them

If the user is doing grid experiments, keep a base template and derive variants from it.

Official reference example (QM7-style, adapted with path placeholders):

How to build `machine.json`

Construct machine.json with separate stage blocks for:

For each stage, keep the following explicit:

Do not merge all stages into one vague machine block.

Validation before run

Before execution, validate the workflow in this order:

  1. confirm outer-layer dpgen is available:
dpgen -h
  1. validate JSON syntax:
python -m json.tool param.json
python -m json.tool machine.json
  1. verify required dataset paths exist
  2. verify stage commands match the selected software stack
  3. if fp_style is none, do not require FP-specific backend settings
  4. only then run:
dpgen simplify param.json machine.json

Output contract

Always provide:

  1. final absolute paths to param.json and machine.json
  2. the exact simplify command to run (dpgen simplify param.json machine.json)
  3. a short pre-run checklist
  4. any unresolved required fields
  5. if execution was performed, the main output locations and next files to inspect

Guardrails

no-op command true when fp_style is none.

References and bundled files

Use these bundled files:

External references:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.