Force Fields — Molecular Mechanics for MD Simulations
Classical force fields define the potential energy of a molecular system as a sum of bonded and non-bonded terms. The parameters (k, r0, θ0, ε, σ, q) define how molecules move and interact. Python-first stack: OpenMM (engine) + OpenFF toolkit (SMIRNOFF small molecule parameterization).
When to Use This Skill
- Setting up MD simulations with AMBER, CHARMM, or OpenFF force fields
- Parameterizing drug-like small molecules (GAFF2, SMIRNOFF Sage)
- Running energy minimization and MD with OpenMM
- Assigning partial charges (AM1-BCC, RESP)
- Understanding energy terms: bonds, angles, torsions, vdW, electrostatics
- Choosing water model (TIP3P, OPC, TIP4P-Ew)
- Analyzing energy decomposition by force group
Quick Start
# Protein-ligand simulation with OpenMM + OpenFF (SMIRNOFF Sage)
from openff.toolkit import Molecule, ForceField
from openff.toolkit.utils.exceptions import ParameterLookupError
from openmmforcefields.generators import SystemGenerator
import openmm.app as app
import openmm as mm
import openmm.unit as unit
# 1. Load protein topology
pdb = app.PDBFile('protein.pdb')
# 2. Parameterize ligand with OpenFF Sage
ligand = Molecule.from_smiles('c1ccc(cc1)CN')
ligand.generate_conformers(n_conformers=1)
# 3. Build system
system_generator = SystemGenerator(
forcefields=['amber/ff14SB.xml', 'amber/tip3p_standard.xml'],
small_molecule_forcefield='openff-2.2.0',
molecules=[ligand],
forcefield_kwargs={'nonbondedMethod': app.PME, 'constraints': app.HBonds},
)
system = system_generator.create_system(pdb.topology, molecules=[ligand])
# 4. Run with Langevin integrator
integrator = mm.LangevinMiddleIntegrator(
300 * unit.kelvin, 1.0 / unit.picosecond, 2.0 * unit.femtoseconds
)
simulation = app.Simulation(pdb.topology, system, integrator)
simulation.context.setPositions(pdb.positions)
simulation.minimizeEnergy(maxIterations=500)
simulation.reporters.append(app.DCDReporter('traj.dcd', 1000))
simulation.step(50000) # 100 ps
Router — What to Read
| Task |
Reference |
| Force field theory: energy terms, AMBER/CHARMM/OPLS/GROMOS families |
references/ff-fundamentals.md |
| OpenMM: System, Simulation, integrators, reporters, NPT, restart |
references/openmm-basics.md |
| OpenFF SMIRNOFF toolkit: Molecule, parameterization, Sage 2.2 |
references/openff-smirnoff.md |
| GAFF2/antechamber, acpype, CGenFF, AM1-BCC, RESP charges |
references/parameterization.md |
| Energy decomposition, PME, cutoffs, water models, troubleshooting |
references/energy-analysis.md |
Force Field Families at a Glance
| Family |
Protein FF |
Small Molecule FF |
Engine |
| AMBER |
ff14SB, ff19SB |
GAFF2 |
OpenMM, AMBER |
| CHARMM |
CHARMM36m |
CGenFF |
OpenMM, NAMD, GROMACS |
| OPLS |
OPLS-AA/M |
OPLS3e |
GROMACS, Schrödinger |
| OpenFF |
— |
Sage 2.2, Parsley |
OpenMM |
| GROMOS |
54A7 |
GROMOS-compat |
GROMACS (united-atom) |
Installation
# OpenMM (engine)
conda install -c conda-forge openmm
# OpenFF toolkit + Sage FF
pip install openff-toolkit
pip install openmmforcefields # bridges OpenFF → OpenMM + GAFF2
# AMBER Tools (antechamber / tleap)
conda install -c conda-forge ambertools
# acpype (antechamber wrapper → GROMACS/AMBER topology)
conda install -c conda-forge acpype
# ParmEd (topology manipulation)
pip install parmed
# Verify
python -c "import openmm; print(openmm.__version__)"
python -c "from openff.toolkit import Molecule; print('OpenFF OK')"
Related Skills
ase — geometry optimization with QM calculators (ORCA, xTB, GPAW)
mdanalysis — trajectory analysis after MD runs
docking — pre-docking protein prep; post-MD ensemble docking
scientific-skills:pymatgen — periodic materials, materials force fields (ReaxFF)
- scripts:
chem_3d.py — RDKit 3D conformer generation (pre-MD structure)
1---2name: force-fields3description: Use when working with molecular mechanics force fields for MD simulations. Covers force field theory (AMBER/CHARMM/OPLS/SMIRNOFF), OpenMM simulation setup, OpenFF/SMIRNOFF parameterization of small molecules, GAFF2/antechamber, partial charge methods (AM1-BCC, RESP), energy decomposition, and water models.4---56# Force Fields — Molecular Mechanics for MD Simulations78Classical force fields define the potential energy of a molecular system as a sum of bonded and non-bonded terms. The parameters (k, r0, θ0, ε, σ, q) define how molecules move and interact. Python-first stack: **OpenMM** (engine) + **OpenFF toolkit** (SMIRNOFF small molecule parameterization).910## When to Use This Skill1112- Setting up MD simulations with AMBER, CHARMM, or OpenFF force fields13- Parameterizing drug-like small molecules (GAFF2, SMIRNOFF Sage)14- Running energy minimization and MD with OpenMM15- Assigning partial charges (AM1-BCC, RESP)16- Understanding energy terms: bonds, angles, torsions, vdW, electrostatics17- Choosing water model (TIP3P, OPC, TIP4P-Ew)18- Analyzing energy decomposition by force group1920## Quick Start2122```python23# Protein-ligand simulation with OpenMM + OpenFF (SMIRNOFF Sage)24from openff.toolkit import Molecule, ForceField25from openff.toolkit.utils.exceptions import ParameterLookupError26from openmmforcefields.generators import SystemGenerator27import openmm.app as app28import openmm as mm29import openmm.unit as unit3031# 1. Load protein topology32pdb = app.PDBFile('protein.pdb')3334# 2. Parameterize ligand with OpenFF Sage35ligand = Molecule.from_smiles('c1ccc(cc1)CN')36ligand.generate_conformers(n_conformers=1)3738# 3. Build system39system_generator = SystemGenerator(40 forcefields=['amber/ff14SB.xml', 'amber/tip3p_standard.xml'],41 small_molecule_forcefield='openff-2.2.0',42 molecules=[ligand],43 forcefield_kwargs={'nonbondedMethod': app.PME, 'constraints': app.HBonds},44)45system = system_generator.create_system(pdb.topology, molecules=[ligand])4647# 4. Run with Langevin integrator48integrator = mm.LangevinMiddleIntegrator(49 300 * unit.kelvin, 1.0 / unit.picosecond, 2.0 * unit.femtoseconds50)51simulation = app.Simulation(pdb.topology, system, integrator)52simulation.context.setPositions(pdb.positions)53simulation.minimizeEnergy(maxIterations=500)54simulation.reporters.append(app.DCDReporter('traj.dcd', 1000))55simulation.step(50000) # 100 ps56```5758## Router — What to Read5960| Task | Reference |61|------|-----------|62| Force field theory: energy terms, AMBER/CHARMM/OPLS/GROMOS families | `references/ff-fundamentals.md` |63| OpenMM: System, Simulation, integrators, reporters, NPT, restart | `references/openmm-basics.md` |64| OpenFF SMIRNOFF toolkit: Molecule, parameterization, Sage 2.2 | `references/openff-smirnoff.md` |65| GAFF2/antechamber, acpype, CGenFF, AM1-BCC, RESP charges | `references/parameterization.md` |66| Energy decomposition, PME, cutoffs, water models, troubleshooting | `references/energy-analysis.md` |6768## Force Field Families at a Glance6970| Family | Protein FF | Small Molecule FF | Engine |71|--------|-----------|-------------------|--------|72| AMBER | ff14SB, ff19SB | GAFF2 | OpenMM, AMBER |73| CHARMM | CHARMM36m | CGenFF | OpenMM, NAMD, GROMACS |74| OPLS | OPLS-AA/M | OPLS3e | GROMACS, Schrödinger |75| OpenFF | — | Sage 2.2, Parsley | OpenMM |76| GROMOS | 54A7 | GROMOS-compat | GROMACS (united-atom) |7778## Installation7980```bash81# OpenMM (engine)82conda install -c conda-forge openmm8384# OpenFF toolkit + Sage FF85pip install openff-toolkit86pip install openmmforcefields # bridges OpenFF → OpenMM + GAFF28788# AMBER Tools (antechamber / tleap)89conda install -c conda-forge ambertools9091# acpype (antechamber wrapper → GROMACS/AMBER topology)92conda install -c conda-forge acpype9394# ParmEd (topology manipulation)95pip install parmed9697# Verify98python -c "import openmm; print(openmm.__version__)"99python -c "from openff.toolkit import Molecule; print('OpenFF OK')"100```101102## Related Skills103104- `ase` — geometry optimization with QM calculators (ORCA, xTB, GPAW)105- `mdanalysis` — trajectory analysis after MD runs106- `docking` — pre-docking protein prep; post-MD ensemble docking107- `scientific-skills:pymatgen` — periodic materials, materials force fields (ReaxFF)108- scripts: `chem_3d.py` — RDKit 3D conformer generation (pre-MD structure)