alchemlyb
the simple alchemistry library
What it is and what it does
alchemlyb is a Python library for analyzing alchemical free energy calculations from molecular dynamics simulations. It sits atop the PyData stack (numpy, pandas, scipy, scikit-learn, matplotlib) and provides three main layers: parsers that extract raw data from output files of common MD engines (GROMACS, AMBER, NAMD, and others), subsamplers that extract uncorrelated and equilibrated samples from timeseries data using techniques like those in pymbar, and estimators that compute free energies directly using best-practices methods including multistate Bennett acceptance ratio (MBAR), BAR, and thermodynamic integration (TI).
The package is designed for computational chemists and molecular dynamics practitioners who need to post-process simulation output and extract thermodynamic quantities. It abstracts away the boilerplate of parsing heterogeneous file formats and handling statistical correlation in timeseries, letting users focus on the analysis and interpretation of results. The library is actively maintained, supports modern Python versions (3.11–3.14), and has no compiled dependencies.
Use it for:
- Extract and analyze free energy differences from GROMACS, AMBER, or NAMD simulations using MBAR or BAR estimators.
- Detect equilibration in molecular dynamics trajectories and subsample to obtain independent, uncorrelated configurations for downstream analysis.
- Compute free energies via thermodynamic integration from alchemical simulation data.
- Parse and standardize output from multiple MD engines into a common pandas-based data structure for comparative analysis.
- Automate post-processing of alchemical free energy perturbation (FEP) calculations in high-throughput workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
alchemlyb parses molecular dynamics simulation output, extracts uncorrelated samples from timeseries data, and estimates free energies using MBAR, BAR, and thermodynamic integration methods.
Yes. alchemlyb is actively maintained, has no known vulnerabilities, carries a permissive BSD-3-Clause license, and requires only standard PyData stack dependencies (low install friction). It is purpose-built for a specific, well-defined task—free energy analysis from MD simulations—and does it with established statistical methods. Install it if you work with alchemical free energy calculations; skip it if you do not.
Install
alchemlyb on PyPI
pip
pip install alchemlybuv
uv add alchemlybpoetry
poetry add alchemlybInstalling alchemlyb
Before you install
Low friction: pure Python wheel with no compiled dependencies. Active maintenance (last commit 2026-06-01, 296 days since release). Requires Python 3.11 or later and 9 runtime dependencies from the PyData stack (numpy, pandas, scipy, scikit-learn, matplotlib, pymbar, loguru, pyarrow, joblib).
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute alchemlyb freely in commercial and private projects provided you include the license notice.
Quickstart
pip install alchemlyb
import alchemlyb
from alchemlyb.parsing import gromacs
# Parse GROMACS free energy output
data = gromacs.extract_u_nk('md.xvg')
from alchemlyb.estimators import MBAR
estimator = MBAR()
estimator.fit(data)
print(estimator.delta_f_) # Free energy differences
Requires Python 3.11 or later. Input files must come from supported MD engines (GROMACS, AMBER, NAMD, etc.); parser availability depends on the engine used.
Verify before relying
- Whether parsers support all simulation engines mentioned (GROMACS, AMBER, NAMD, others) equally well or if some are more mature than others.
- Performance characteristics when handling large timeseries datasets or high-dimensional free energy landscapes.
- Whether the package includes example workflows or tutorials for common use cases beyond the basic API.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — numpy, pandas, pymbar, scipy, scikit-learn, matplotlib, loguru, pyarrow, joblib |
| Maintenance | actively maintained — 296 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 392,931/month — #7,002 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: alchemlyb-2.5.0-py3-none-any.whl
Keywords: free energy, MBAR, thermodynamic integration, free energy perturbation, FEP, alchemistry, analysis, GROMACS, NAMD, AMBER, molecular dynamics
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
pymbarpymbar implements the multistate Bennett…
permissive · top 15,000 on PyPI
MDAnalysisMDAnalysis reads and analyzes molecular…
copyleft · top 15,000 on PyPI
mdtrajMDTraj reads, writes, and analyzes molecular…
copyleft · top 15,000 on PyPI
OpenMMOpenMM is a Python wrapper for a C++ molecular…
permissive · top 15,000 on PyPI
pyscfPySCF is a Python framework for quantum…
permissive · top 15,000 on PyPI
primer3-pyprimer3-py wraps the Primer3 library to provide…
copyleft · top 15,000 on PyPI
lammpslammps provides pre-built Python bindings to…
copyleft · top 15,000 on PyPI
chemicalsRetrieves and calculates chemical properties…
permissive · top 15,000 on PyPI
pymzmlpymzml parses mzML mass spectrometry data files…
permissive · top 15,000 on PyPI
CoolPropCoolProp provides thermodynamic and transport…
permissive · top 5,000 on PyPI