Skip to main content

Bayesian workflows for fixed-charge molecular force fields

Project description

Bayesic Force Fields

Docs Paper Preprint Release License

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 prepare
  • bff simulate
  • bff qoi
  • bff train
  • bff learn
  • bff validate

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

External tools are still required for full workflows:

  • Gromacs for prepare, simulate, and validate
  • 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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bfflearn-0.1.0.dev1.tar.gz (128.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bfflearn-0.1.0.dev1-py3-none-any.whl (131.8 kB view details)

Uploaded Python 3

File details

Details for the file bfflearn-0.1.0.dev1.tar.gz.

File metadata

  • Download URL: bfflearn-0.1.0.dev1.tar.gz
  • Upload date:
  • Size: 128.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bfflearn-0.1.0.dev1.tar.gz
Algorithm Hash digest
SHA256 4b3dbcda07637c92313d3844509759c91d2235d5413816ba751f8a2c06541a11
MD5 3bc9044ab3f70bf11559aab8f898fb3f
BLAKE2b-256 2ddc7fa40dd85a96eaf06e40e2e006a7ad38eef9af3db5aa96cb898af9a4a819

See more details on using hashes here.

Provenance

The following attestation bundles were made for bfflearn-0.1.0.dev1.tar.gz:

Publisher: publish.yml on vojtechkostal/BayesicForceFields

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bfflearn-0.1.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: bfflearn-0.1.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 131.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bfflearn-0.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e093989ca1031a4f4d3ae5deee48d26601ddb587cc7b980847f2307046a96d4
MD5 db1d4bf24d2fa0236f872b67854eceb9
BLAKE2b-256 c9a0de206c7bd12a418faed2ccac346a88777330895500b237997ffae9745cd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for bfflearn-0.1.0.dev1-py3-none-any.whl:

Publisher: publish.yml on vojtechkostal/BayesicForceFields

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page