Packmol generate mixture

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

Packmol generate mixture is an AI agent skill from the GitHub repository jinzhezenggroup/computational-chemistry-agent-skills. A tool for generating initial packed molecular configurations (XYZ format) from single-molecule structures by calculating box dimensions, writing input scripts, and executing Packmol. USE WHEN you need to randomly pack a specific number of molecules into a simulation box (defined by target density o

How to use this skill

Skill file

packmol-generate-mixture

Use Packmol to generate an initial packed configuration for a molecular mixture.

Agent responsibilities (do these in order)

  1. Collect inputs (ask if missing; do not guess):
  1. Validate inputs:
  1. Decide box size:
  1. Create a working folder at the requested output location:
  1. Write Packmol input ${system_name}.inp:
  1. Run Packmol locally:
  1. Report results:
  1. (Optional) Post-process for LAMMPS

If the user plans to run LAMMPS (especially ReaxFF), they often need a LAMMPS data file with correct box bounds.

uvx --from lammps-md-tools lammps-fix-box \
    --in  input.data \
    --out output.boxfix.data \
    --L 60.690 \
    --wrap

This rewrites xlo/xhi, ylo/yhi, zlo/zhi to 0..L, zeroes tilt factors, and optionally wraps atoms into the box.

What to ask the user (plain language)

If the user didn’t specify them, ask at minimum:

If the user says “use defaults”, propose defaults:

Input schema (recommended)

Example (replace with your own species/files):

system_name: mixture_pack
output_dir: /path/to/output/packed
# Choose ONE of the following:
density_g_cm3: 0.25
# box_length_A: 60.69

tolerance_A: 2.0
components:
  - name: species1
    structure_file: /path/to/species1.xyz
    number: 100
  - name: species2
    structure_file: /path/to/species2.xyz
    number: 650

Density → cubic box length (Å)

When density_g_cm3 is provided and box_length_A is not, estimate L from total mass:

This is an initial packing estimate (geometry construction), not an equilibrated density.

Output contract

The run should produce (within output_dir):

Limitations (be explicit)

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.