Bayesian workflows for fixed-charge molecular force fields
Project description
Bayesic Force Fields
Bayesic Force Fields (BFF) is a workflow-oriented Python package for learning fixed-charge molecular force-field parameters from molecular dynamics observables. It combines system preparation, sampled MD campaigns, QoI analysis, surrogate training and posterior inference in one toolchain.
The public CLI is centered around six workflows:
bff preparebff simulatebff qoibff trainbff learnbff validate
Examples can be fetched on demand with:
bff examples
Documentation lives under docs/ and is intended to be published with MkDocs on GitHub Pages.
Published documentation: vojtechkostal.github.io/BayesicForceFields
How to Cite
If you use BFF, please cite:
Kostal, V.; Shanks, B. L.; Jungwirth, P.; Martinez-Seara, H.
Bayesian Learning for Accurate and Robust Biomolecular Force Fields.
J. Chem. Theory Comput. 2026, 22 (5), 2652-2663.
https://doi.org/10.1021/acs.jctc.5c02051
Paper: Bayesian Learning for Accurate and Robust Biomolecular Force Fields
Preprint: arXiv:2511.05398
Installation
Recommended user installation:
mamba create -n bfflearn python=3.10 pip
mamba activate bfflearn
Install a matching PyTorch build for your machine before training or learning. The recommended way is to use the selector on the official PyTorch install page: https://pytorch.org/get-started/locally/
Example for Linux with CUDA 12.6:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
Then install BFF from PyPI:
pip install bfflearn
If you want the exact code used for the paper, do not install v0.0.1
directly through a pip Git URL. That archived tag predates the packaging
cleanup. Instead, clone the repository, check out the archived tag, and follow
the README.md and environment.yaml shipped with that snapshot:
git clone https://github.com/vojtechkostal/BayesicForceFields.git
cd BayesicForceFields
git checkout v0.0.1
Use v0.0.1 for exact reproduction of the published paper data. The current
bfflearn release line is the post-paper refactored workflow.
External tools are still required for full workflows:
- Gromacs for
prepare,simulate, andvalidate - CP2K for staged reference calculations
- PLUMED only for PLUMED-biased systems
- PyTorch installed separately for
train,learn, and posterior notebooks
PyTorch is not installed by default because the appropriate CPU or CUDA build depends on the target machine. Install the matching PyTorch build first, then install BFF.
For development work on the repository itself, use:
mamba env create -f environment.yaml
mamba activate bfflearn
If you prefer to start from an existing environment instead:
pip install -e ".[dev,docs,notebook]"
Quick Start
The acetate example in examples/acetate/ shows the intended stage order:
cd examples/acetate/01-prepare/colvars
bff prepare config.yaml
cd ../../03-training-trjs
bff simulate config-local.yaml
cd ../04-qoi
bff qoi config.yaml
cd ../05-train-lgp
bff train config.yaml
cd ../06-learn
bff learn config.yaml
Validation is configured separately in stage 08:
cd ../08-validate
bff validate config.yaml
Two notebooks are included in the example:
- 06-learn/interactive.ipynb shows interactive surrogate training, posterior sampling, and posterior sample export.
- 07-visualize/visualize.ipynb focuses on plotting and inspection only.
If you installed BFF from PyPI and want the example tree locally, run:
bff examples
cd examples/acetate
Repository Layout
- bff/ contains the package code.
- examples/acetate/ contains the worked example.
- data/ contains repository example inputs.
- docs/ contains the documentation source.
Documentation Locally
Preview the docs locally with MkDocs:
mkdocs serve
Build the static site with:
mkdocs build --strict
Shortcuts are also available:
make docs
make docs-build
Shell Completion
When bff runs inside an activated conda environment, it writes a small
completion hook for bash and zsh into that environment. After the first bff
run, reactivate the environment once:
conda deactivate
conda activate bfflearn
After that, bff <TAB> should offer the public workflow commands.
Development and Release
Packaging, docs, and deployment configuration live in:
The release and publication strategy is documented in docs/development.md.
License
BFF is distributed under the GNU GPL v3. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bfflearn-0.1.0.dev2.tar.gz.
File metadata
- Download URL: bfflearn-0.1.0.dev2.tar.gz
- Upload date:
- Size: 130.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60ea448ca4e950ff2d571ae4794eb0125ccaf770f07eed76f766e17cbc54c3e2
|
|
| MD5 |
9c9545aea0d73a43d5801260bff5cbba
|
|
| BLAKE2b-256 |
b88341562445f0ae697f2f977e51962100a0fe66ef78d9ba8c36fe2073fd0fe0
|
Provenance
The following attestation bundles were made for bfflearn-0.1.0.dev2.tar.gz:
Publisher:
publish.yml on vojtechkostal/BayesicForceFields
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bfflearn-0.1.0.dev2.tar.gz -
Subject digest:
60ea448ca4e950ff2d571ae4794eb0125ccaf770f07eed76f766e17cbc54c3e2 - Sigstore transparency entry: 1225923270
- Sigstore integration time:
-
Permalink:
vojtechkostal/BayesicForceFields@0e33fb038d66083ab422009a9ab56d89ea388a54 -
Branch / Tag:
refs/tags/v0.1.0.dev2 - Owner: https://github.com/vojtechkostal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e33fb038d66083ab422009a9ab56d89ea388a54 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bfflearn-0.1.0.dev2-py3-none-any.whl.
File metadata
- Download URL: bfflearn-0.1.0.dev2-py3-none-any.whl
- Upload date:
- Size: 134.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac81beb9bf737c3c72b246435228aeacd3278eeaddf25368b31ad3a5eed3a196
|
|
| MD5 |
34ae682c549c9360428ebe85f3d68f0b
|
|
| BLAKE2b-256 |
0b4fb04fdc7d5f7fe37680dabaf446627c09a900dd22bcba5c3c18ee5860e4e0
|
Provenance
The following attestation bundles were made for bfflearn-0.1.0.dev2-py3-none-any.whl:
Publisher:
publish.yml on vojtechkostal/BayesicForceFields
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bfflearn-0.1.0.dev2-py3-none-any.whl -
Subject digest:
ac81beb9bf737c3c72b246435228aeacd3278eeaddf25368b31ad3a5eed3a196 - Sigstore transparency entry: 1225923325
- Sigstore integration time:
-
Permalink:
vojtechkostal/BayesicForceFields@0e33fb038d66083ab422009a9ab56d89ea388a54 -
Branch / Tag:
refs/tags/v0.1.0.dev2 - Owner: https://github.com/vojtechkostal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e33fb038d66083ab422009a9ab56d89ea388a54 -
Trigger Event:
release
-
Statement type: