$npx -y skills add jinzhezenggroup/computational-chemistry-agent-skills --skill lammps-deepmdA tool and knowledge base for running molecular dynamics (MD) simulations in LAMMPS with the DeePMD-kit plugin. It handles input script preparation, ensemble selection (NVE/NVT/NPT), and job execution via uv or offline binaries. USE WHEN you need to set up, write, explain, or e
| 1 | # LAMMPS + DeePMD-kit |
| 2 | |
| 3 | Use this skill when the user wants to run molecular dynamics in LAMMPS with a DeePMD-kit potential, prepare or explain an `input.lammps` file, or switch between common ensembles such as NVE, NVT, and NPT. |
| 4 | |
| 5 | ## Agent responsibilities |
| 6 | |
| 7 | 1. Confirm the available execution mode: |
| 8 | - **Online mode**: if internet access is available and `uv` is installed, prefer |
| 9 | `uvx --from lammps --with deepmd-kit[gpu,torch,lmp] lmp ...` |
| 10 | - **Offline mode**: do **not** guess the executable. Ask the user which LAMMPS command, module, or container should be used. |
| 11 | 1. Confirm the minimum simulation inputs: |
| 12 | - structure/data file (for example `data.system`) |
| 13 | - DeePMD model file (for example `graph.pb` or compressed model) |
| 14 | - atom type to element mapping, including required per-type masses if the data file does not define them |
| 15 | - target ensemble (NVE, NVT, NPT, or another explicitly requested setup) |
| 16 | - temperature, pressure if applicable, timestep, and total number of steps |
| 17 | 1. Write the LAMMPS input script yourself instead of asking the user to hand-write it. |
| 18 | 1. Keep the example readable and fully explained. If you include an example input script, explain what **every command** does. |
| 19 | 1. When possible, validate command availability against the LAMMPS docs or local `lmp -h` output before execution. |
| 20 | 1. Report clearly which command was run, which files were used, and where outputs were written. |
| 21 | |
| 22 | ## Decide the execution mode |
| 23 | |
| 24 | ### Online mode (preferred when internet access is available) |
| 25 | |
| 26 | Use: |
| 27 | |
| 28 | ```bash |
| 29 | uvx --from lammps --with deepmd-kit[gpu,torch,lmp] lmp -in input.lammps |
| 30 | ``` |
| 31 | |
| 32 | If you need to inspect the local command-line help: |
| 33 | |
| 34 | ```bash |
| 35 | uvx --from lammps --with deepmd-kit[gpu,torch,lmp] lmp -h | tee /dev/tty |
| 36 | ``` |
| 37 | |
| 38 | Notes: |
| 39 | |
| 40 | - This is the preferred path because it can provision LAMMPS and DeePMD-kit on demand. |
| 41 | - The `gpu,torch,lmp` extras match the requested runtime pattern from the user. |
| 42 | - If the environment is slow or the packages are large, warn the user that the first run may take time. |
| 43 | |
| 44 | ### Offline mode |
| 45 | |
| 46 | If internet access is unavailable or the user explicitly wants a site-installed binary, ask a concrete question such as: |
| 47 | |
| 48 | - "Which LAMMPS executable should I use, for example `lmp`, `lmp_mpi`, `mpirun -np 8 lmp`, or an HPC module command?" |
| 49 | - "Do you already have a DeePMD-enabled LAMMPS build on this machine or cluster?" |
| 50 | |
| 51 | Do not invent a binary name or module name. |
| 52 | |
| 53 | ## Minimal information to collect |
| 54 | |
| 55 | Ask only for what is missing: |
| 56 | |
| 57 | - DeePMD model path |
| 58 | - LAMMPS data file path |
| 59 | - ensemble |
| 60 | - target temperature |
| 61 | - target pressure if using NPT |
| 62 | - timestep |
| 63 | - run length in steps |
| 64 | - whether velocities should be generated from scratch |
| 65 | - preferred execution command if offline |
| 66 | |
| 67 | ## Recommended workflow |
| 68 | |
| 69 | 1. Inspect available files in the working directory. |
| 70 | 1. Draft `input.lammps`. |
| 71 | 1. Explain the script to the user if they asked for an explanation or if the script is nontrivial. |
| 72 | 1. Run a short smoke test first when reasonable. |
| 73 | 1. Run the full simulation. |
| 74 | 1. Summarize outputs such as `log.lammps`, dump trajectories, restart files, and thermodynamic data. |
| 75 | |
| 76 | ## Example: annotated NVT input |
| 77 | |
| 78 | The following example is adapted from the user-provided tutorial pattern and slightly generalized. See also `assets/input.nvt.lammps`. |
| 79 | |
| 80 | ```lammps |
| 81 | variable NSTEPS equal 1000000 |
| 82 | variable THERMO_FREQ equal 1000 |
| 83 | variable DUMP_FREQ equal 1000 |
| 84 | variable TEMP equal 300.0 |
| 85 | variable TAU_T equal 0.1 |
| 86 | |
| 87 | units metal |
| 88 | boundary p p p |
| 89 | atom_style atomic |
| 90 | |
| 91 | neighbor 1.0 bin |
| 92 | |
| 93 | read_data data.system |
| 94 | mass 1 28.0855 |
| 95 | mass 2 15.999 |
| 96 | pair_style deepmd graph_compressed.pb |
| 97 | pair_coeff * * |
| 98 | |
| 99 | thermo_style custom step temp pe ke etotal press vol lx ly lz xy xz yz |
| 100 | thermo ${THERMO_FREQ} |
| 101 | dump 1 all custom ${DUMP_FREQ} traj.lammpstrj id type x y z |
| 102 | |
| 103 | velocity all create ${TEMP} 743574 |
| 104 | fix 1 all nvt temp ${TEMP} ${TEMP} ${TAU_T} |
| 105 | |
| 106 | timestep 0.0005 |
| 107 | run ${NSTEPS} |
| 108 | ``` |
| 109 | |
| 110 | ### What every command means |
| 111 | |
| 112 | - `variable NSTEPS equal 1000000` |
| 113 | |
| 114 | - Defines a numeric variable called `NSTEPS` with value `1000000 |