Yaff
Yet Another Force Field: flexible, scriptable molecular dynamics in Python.
Tool 031 of 100 in the MolForge directory of open-source tools. Every fact below was read from the repository's host on 2026-11-28.

What Yaff is
Yaff, Yet Another Force Field, is a molecular dynamics and force-field code written in Python with C extensions by the Center for Molecular Modeling at Ghent University. Its purpose is to make the force field itself the object of study: the energy terms, their functional forms and their parameters are described in plain text files and can be changed without touching compiled code. This suits the development and testing of new force fields, in particular those derived from quantum calculations for metal-organic frameworks and other periodic materials.
A Yaff script loads a system (atoms, bonds, cell) and a parameter file, builds a force field object and runs an optimisation or MD with thermostats and barostats. Trajectories and energies go to HDF5 files that can be read with h5py. Yaff is the natural partner of QuickFF, which derives force-field parameters from ab initio Hessians and writes them in Yaff format, and of the molmod library. It supports periodic systems with Ewald summation and allows cross terms between bonds and angles.
Yaff is a research code rather than a production engine: it is not GPU-accelerated and is not meant for long biomolecular simulations.
Features
- Force-field terms and parameters defined in editable text files
- Periodic systems with Ewald electrostatics and flexible cell dynamics
- Geometry and cell optimisation, NVT and NPT molecular dynamics
- Cross terms between bonds, bends and dihedrals for covalent frameworks
- HDF5 trajectory output and a pure Python scripting interface
- Companion to QuickFF for ab initio derived force fields
What it is for
- Test a new force field for a metal-organic framework before production runs
- Compute thermal expansion and phase behaviour of flexible porous crystals
- Validate parameters derived by QuickFF against reference quantum data
- Prototype an unusual energy term in Python
Verified facts
| Family | Classical molecular dynamics |
|---|---|
| Language or basis | Custom models |
| Repository | https://github.com/molmod/yaff (GitHub) |
| Licence | GPL-3.0 (SPDX identifier as declared in the repository) |
| Main language on GitHub | Python |
| Last commit | 2022-10-06 |
| Latest release | 1.6.0 (2019-10-21) |
| Stars | 41 on 2026-11-28 |
| Open issues and pull requests | 4 on 2026-11-28 |
| Repository created | 2012-08-17 |
| Verified | 2026-11-28 by MolForge's checking script, against the host's API |
Where Yaff fits
Force-field simulation engines for biomolecules, materials and soft matter. AMBER is commercial (AmberTools is free) and NAMD is free under its own licence.
Questions people ask
- What is Yaff used for?
- Mostly for force-field development on periodic materials such as metal-organic frameworks and zeolites. Because the energy expression is read from a parameter file, researchers can add terms, change functional forms and compare against quantum reference data quickly. It also runs ordinary MD and optimisations, but that is not where it stands out.
- How is Yaff different from LAMMPS or GROMACS?
- LAMMPS and GROMACS are production engines tuned for long simulations of large systems, with fixed menus of interaction styles. Yaff is a small Python code where the force field is a readable, editable object. It is chosen to design and validate a model; the finished model is often then ported to LAMMPS for production.
- Does Yaff work with QuickFF?
- Yes. QuickFF derives covalent force-field parameters from ab initio geometries and Hessians and writes them in the Yaff parameter format, so a Yaff force field can be assembled directly from its output together with electrostatic and van der Waals parameters from other sources.
- Is Yaff open source?
- Yes. The repository declares the GPL-3.0 licence (SPDX identifier read from the host on 2026-11-28). Read the licence text in the repository before redistributing or embedding it.
- Where is the Yaff source code?
- At https://github.com/molmod/yaff (GitHub). This is the address the host reported on the day of verification; renamed repositories are followed to their new home.
- Is Yaff still maintained?
- The last commit was pushed on 2022-10-06 and the latest tagged release is 1.6.0 from 2019-10-21; the repository had 4 open issues and pull requests on 2026-11-28.
- Does MolForge use Yaff?
- No. MolForge runs nine of the hundred tools in this directory (RDKit, OpenMM, AutoDock Vina, Open Babel, MDTraj, pymbar and NGL, plus PySCF and xTB in MFsig); Yaff is listed because of its place in classical molecular dynamics, not because we run it.
Our comments on Yaff
MolForge does not run Yaff in production. This page is a verified pointer, not a review: the facts above come from the repository on the date shown, the description is ours, and we make no claim about accuracy or speed that we have not measured. If you maintain Yaff and something here is wrong or out of date, write to hello@molforge.ai and we will correct the source file.
Test status
Not tested by MolForge. To check Yaff yourself: clone the repository, follow the installation section of its README, and run the test suite the project ships before trusting a result; the last-commit date and the open issue count above tell you how alive the project is.