Multi-Component System Workflows in dpgen/dpgen2#
Multi-component systems—binary alloys, ternary alloys, mixed oxides—require workflow design that accounts for both structural and chemical degrees of freedom. Two code bases support this work: dpgen (classic, param.json-driven) and dpgen2 (second generation, featuring automated alloy structure generation). The key references are the Al-Mg dpgen2 example, the AlloyConfGenerator class, the Mg-Y tutorial for metallic alloys, and GitHub discussion #1876 for the Bi-Mo-O multi-component oxide case study.
dpgen2: Alloy Configuration Generation#
The AlloyConfGenerator in dpgen2 automates starting structure creation for alloy exploration . Key parameters:
| Parameter | Purpose |
|---|---|
lattice | Lattice type ("bcc", "fcc", "hcp", "sc", "diamond") and constant, or a dpdata.System |
concentration | List[float] (fixed), List[List[float]] (random pick per conf), or None (equal) |
cell_pert_frac | Cell shape perturbation fraction |
atom_pert_dist | Atomic displacement distance (Å) |
When concentration is a nested list, dpgen2 randomly selects one concentration row per generated configuration . The Al-Mg example demonstrates multi-point sampling:
"concentration": [[1.0, 0.0], [0.5, 0.5], [0.0, 1.0]]
This generates configurations spanning pure Al, equimolar Al-Mg, and pure Mg without manually constructing per-composition datasets. Exploration stages map configurations to temperature/ensemble settings via conf_idx . The model seeds from separate Al and Mg AIMD data to avoid starting blind on pure-element chemistry.
dpgen (Classic): Dataset Merging and sys_configs Patterns#
Seeding init_data_sys with Single-Element Data#
The Mg-Y tutorial demonstrates the canonical bootstrap pattern: complete single-element DP-GEN runs for Mg and Y separately, then merge those datasets into init_data_sys alongside multi-component Mg-Y data. This seeds the binary model with element-specific knowledge before exploring alloy chemistry.
Merging by Structure Type, Not Temperature#
For multi-component oxide systems, merge POSCARs from all temperatures into a single directory per environment type, then vary temperature via temps in model_devi_jobs . This avoids combinatorial explosion:
"sys_configs": [
["o2_adsorption/all_poscars/POSCAR_*"],
["o_adsorption/all_poscars/POSCAR_*"]
]
Group by chemistry (O₂ adsorption vs. O adsorption), not by temperature . For init_data_sys, entries with the same atom count should also be merged using dpdata . dpdata automatically handles differing atom orderings during append()—only atom types and counts must match .
Sampling Imbalance and prob_sys_size#
stop_batch is a global parameter; frames are sampled by prob_sys_size (proportional to frame count) by default . A real Bi-Mo-O example showed O-atom adsorption at only 6.67% accuracy vs. 90.48% for O₂ adsorption because the O-atom data had fewer frames and received disproportionately fewer training samples . Remedies:
- Duplicate underrepresented entries in
init_data_sys - Use
"prob_uniform"to give all systems equal weight - Increase
stop_batch(400,000–800,000 for heterogeneous multi-component systems; 100,000 is too low)
Active Learning Strategy for Multi-Component Systems#
Staged Temperature Expansion#
The community consensus for complex systems :
"model_devi_jobs": [
{"sys_idx": [0,1,2,3], "temps": [725], ...}, // early: 1 T
{"sys_idx": [0,1,2,3], "temps": [725, 1100], ...}, // mid: add T
{"sys_idx": [0,1,2,3], "temps": [725, 1100, 2000], ...} // late: full T
]
Alternatively, the original DP-GEN paper (Cu example) explores the full temperature list from iteration 0 and instead progressively expands sys_idx to add new structure types . Both approaches are valid; staged temperature expansion is more conservative for reactive/surface systems.
Initial Dataset for Phase-Transformation Systems#
For systems undergoing surface segregation or volatilization (Bi-Mo-O), bulk + stoichiometric surface alone is insufficient. Required categories :
| Category | Reason |
|---|---|
| Bulk phases (all endpoints) | Equilibrium reference |
| Stoichiometric surface slabs (≥6 layers) | Baseline surface |
| Species-depleted surfaces (1, 2, N vacancies) | Critical intermediates |
| Bi-enriched / reorganized surface | Post-transformation states |
| Desorbing species 3–4 Å above surface | Transition-state region |
| Isolated gas-phase species | Fully desorbed endpoint |
For metallic alloys, the Mg-Y tutorial adds defective structures and amorphous phases using hybrid MC/MD .
Critical Rules#
- Never fix bottom-layer atoms in slabs. dpgen strips selective dynamics flags when writing FP inputs; inconsistent force labels degrade the model. Use thick slabs (≥6 layers) instead .
- Identical DFT settings (functional, ENCUT, KSPACING, pseudopotentials) across all AIMD and dpgen
fpsteps . sel: "auto"is strongly recommended for multi-component systems; invertedselvalues cause >99% failed frames .numb_modelsmust be ≥ 3 for valid ensemble uncertainty .
Key Source Files and References#
| Resource | Location |
|---|---|
| dpgen2 Al-Mg example | examples/almg/input.json |
AlloyConfGenerator implementation | dpgen2/conf/alloy_conf.py |
| Mg-Y alloy tutorial (dpgen) | source/CaseStudies/Mg-Y_alloy/Mg-Y_alloy.md |
| Bi-Mo-O workflow Q&A (dpgen) | GitHub discussion #1876 |
dpgen prob_sys_size sampling logic | dpgen/generator/run.py:515-535 |
| DeePMD-kit training-advanced (prob options) | https://docs.deepmodeling.com/projects/deepmd/en/latest/train/training-advanced.html |