This comprises the essential input files and scripts necessary for generating the input atomistic trajectories, training the neural network potentials (NNPs), constructing the NNP-CG and CG-CG interactions, and conducting NNP/CG-MM simulations.
Corresponding paper: J. Chem. Theory Comput. 2026
NNP/CG-MM is a method by which an all-atom neural network potential (NNP) can be systematically embedded into a bottom-up coarse-grained (CG) environment. A small region of the system (e.g., one solute molecule) is kept at atomistic resolution and described by an NNP, while the rest of the system is represented by CG sites. A custom trained or foundational NNP can be used, and the multiscale coarse-graining (MS-CG) method (or force-matching) can be used for constructing the CG environment.
The repository covers three systems:
| Directory | System |
|---|---|
bulk_ccl4/ |
One atomistic CCl₄ molecule in 499 CG CCl₄ sites |
bulk_water/ |
One atomistic water molecule in 511 CG water sites |
hydrophobe_in_water/ |
One or two atomistic neopentane molecules in 900 CG water sites |
Key steps:
-
All-atom molecular dynamics simulations to generate reference trajectories (alternatively, QM/MM or AIMD trajectories can also be used)
-
Mapping at the CG resolution and constructing the NNP-CG coupling terms and CG-CG interactions using multiscale coarse-graining (MS-CG) force-matching (FM): OpenMSCG
-
Training a Neural Network Potential (NNP): DeePMD (alternatively, architectures such as MACE and Allegro can also be used)
- Other models used in this work (DNN@MB-pol, MACE-OFF, MACE-POLAR-1)
- NNP/CG-MM simulations: LAMMPS patched with DeePMD and PLUMED
Classical all-atom simulations (OPLS-AA for CCl₄ and neopentane, SPC/Fw for water) are run in LAMMPS: energy minimization, NPT equilibration at 300 K and 1 atm, then NVT production. Positions and forces are saved for mapping, force matching and NNP training.
The all-atom trajectory is mapped with OpenMSCG (cgmap): the molecule(s) in the atomistic region keep all their atoms, and every other molecule is mapped to one CG site at its center of mass. The NNP–CG and CG–CG pair interactions are then obtained by force matching (cgfm, B-spline basis) and tabulated (cgdump). The tables are converted from kcal/mol to eV, the units used by DeePMD.
Coordinates and forces from the all-atom trajectory are converted to the DeePMD format and split into training and validation sets. A DeePMD se_e2_a model is trained. Foundational models (MACE-OFF24, MACE-POLAR-1) are also used for fully atomistic comparison runs for CCl₄.
In LAMMPS, the NNP and the tabulated interactions are combined with pair_style hybrid/overlay deepmd ... table ...; the NNP acts only on the atomistic region, and the CG sites interact only through the tables. Structure is compared through radial distribution functions (OpenMSCG cgib) and three-body angular distribution functions (adf.py). For two neopentanes, the potential of mean force along their center-of-mass distance is computed by umbrella sampling with PLUMED.
Each system directory contains some or all of the following:
<system>/
├── AA/ # all-atom LAMMPS simulation
├── CG_mapping/ # cgmap mapping; RDFs (rdf/) and ADFs (adf/) of the mapped trajectory
├── force_matching/ # cgfm/cgdump force matching
│ └── kcal_to_eV/ # tables converted to eV
├── preparing_data_for_NNP/ # LAMMPS trajectory -> DeePMD training/validation sets
├── training_NNP/ # DeePMD training input and frozen model (*.pb)
├── NNP_CG_runs/ # NNP/CG-MM simulation; RDFs and ADFs
└── full_NNP/ # fully atomistic NNP simulations for comparison
System-specific directories:
bulk_ccl4/
├── full_NNP/{deepmd, mace_off, mace_polar_1}/ # DeePMD, MACE-OFF24 and MACE-POLAR-1 runs
└── RDFS_LR_role/ # CG–CG RDFs from different setups
hydrophobe_in_water/
├── one_hydrophobe/ # one neopentane in CG water (with mapping/ for RDFs and ADFs)
└── two_hydrophobes_US/
├── skeleton/ # input files for one umbrella-sampling window
├── us_main.sh # sets up and submits all windows
└── wham/ # WHAM input and potential of mean force
| File | Description |
|---|---|
map.yaml, cgmap.py |
OpenMSCG mapping definition and mapping script |
mscg.sh |
Force matching (cgfm) and table output (cgdump) |
*_eV.table |
Tabulated NNP–CG and CG–CG potentials (LAMMPS pair_style table format) |
convert.py, raw_to_set.sh |
Conversion of a LAMMPS dump to DeePMD raw and npy files |
*.json |
DeePMD training input |
*.pb |
Frozen DeePMD model |
in.*, *.in |
LAMMPS input scripts |
*.data / data.* |
LAMMPS data files |
plumed.in |
PLUMED input for umbrella sampling |
rdf.sh, adf.py |
RDF and ADF analysis |
Brief instructions only; see each package's documentation for full details.
- Python dependencies (for the conversion and analysis scripts):
pip install numpy matplotlib
- OpenMSCG: follow the installation instructions in the OpenMSCG documentation.
- DeePMD-kit: install with conda, pip, or the offline installer, following the DeePMD-kit installation guide. For example:
conda create -n deepmd deepmd-kit lammps -c conda-forge
- PLUMED: download from plumed.org, then build and install:
./configure --prefix=/path/to/plumed make && make install - LAMMPS + DeePMD + PLUMED: build LAMMPS with the DeePMD-kit interface following Install LAMMPS (DeePMD-kit), and enable the PLUMED package following the LAMMPS PLUMED build instructions. See also the LAMMPS installation page.
- MACE (optional; for the MACE-OFF and MACE-POLAR-1 comparison runs):
pip install mace-torch
- MACE-OFF models are available from ACEsuit/mace-off. To use MACE in LAMMPS (
pair_style mace), see MACE in LAMMPS. - MACE-POLAR-1 additionally requires the
graph_electrostaticspackage and is run here through ASE (pip install ase); see the MACE-POLAR documentation.
- MACE-OFF models are available from ACEsuit/mace-off. To use MACE in LAMMPS (
Paths to executables, environments, models and input files in the scripts are placeholders (/path/to/...) and should be set before running. The submission scripts are written for SLURM.
The steps below use bulk_ccl4/ as an example; the other systems follow the same pattern.
cd bulk_ccl4/AA
mpirun -np <N> lmp_mpi -in in.ccl4 # or: sbatch script.shcd bulk_ccl4/CG_mapping
python cgmap.py # maps the AA trajectory -> ccl4_AA_CG.lammpstrj
cd ../force_matching
bash mscg.sh # cgfm + cgdump -> Pair_*.tableThe tables are converted to eV before use (converted tables are provided in kcal_to_eV/).
cd bulk_ccl4/preparing_data_for_NNP
python convert.py <traj.lammpstrj> <natoms> <box_length> # writes box/type/coord/force .raw files
bash raw_to_set.sh # splits into set.000, set.001, ...Place the sets into training and validation directories, set their paths in the .json file, and train:
cd bulk_ccl4/training_NNP
dp train ccl4_se_e2_a.json
dp freeze -o ccl4_nn_3.pbcd bulk_ccl4/NNP_CG_runs
mpirun -np <N> lmp_mpi -in in.ccl4 -var SEED $RANDOM # or: sbatch lammps.shRDFs and ADFs are computed by running bash rdf.sh inside rdf/ and python adf.py inside adf/ (the atom types and distance cutoff for the ADF are set inside adf.py).
cd hydrophobe_in_water/two_hydrophobes_US
bash us_main.shThis copies skeleton/ into 18 windows (window_1 … window_18), replaces the XXX placeholder with the window center (4.5–13.0 Å in steps of 0.5 Å), and submits each window. The collective variable is written to COLVAR in each window. The windows are then combined into a potential of mean force with WHAM.
If you use these files, please cite:
Additional analysis codes and the trajectories can be obtained upon reasonable request.