Skip to main content

Bayesic Force Fields

BFF logo

Docs Paper Release License

Bayesic Force Fields (BFF) is a Python toolkit for learning fixed-charge molecular force-field parameters from molecular-dynamics observables. It coordinates simulation campaigns, trajectory analysis, surrogate fitting, and Bayesian posterior learning.

Posterior learning supports explicit or data-derived effective observation counts for scalar and curve-valued observables. It also writes QoI-attributed marginals that show which observables support different posterior regions.

Full documentation: vojtechkostal.github.io/BayesicForceFields

Workflow

build -> label-snapshots -> external MLIP workflow
      -> sample-parameters -> build-qoi-datasets -> fit-lgp -> learn -> validate

The command-line interface guides a force-field model from prepared molecular systems to sampled trajectories, quantities of interest, surrogate models, and validated posterior samples. See the CLI reference for the individual commands.

Installation

Create an environment, install the PyTorch build appropriate for your machine, and then install BFF:

mamba create -n bfflearn python=3.10 pip
mamba activate bfflearn
pip install bfflearn

For Jupyter notebooks, install the optional notebook tools:

pip install "bfflearn[notebook]"

WARNING: GPU-enabled PyTorch must be installed separately. Use the official PyTorch installation selector to choose the command matching your CUDA version before running fitting, learning, or the posterior notebooks.

Full MD workflows also require GROMACS. CP2K and PLUMED are needed only for the stages that use them. See the installation guide for details, CUDA guidance, and the repository-development setup.

Quick Start

Install the example tree and choose a walkthrough:

bff examples
cd examples/acetate
  • Acetate: complete BFF stage template with an explicit external MLIP handoff.
  • Arbitrary data: notebook using existing tabular simulation results and targets.
  • Neon Mie: notebook using published RDF data.

The examples guide explains which starting point fits your data. The acetate walkthrough shows the full command sequence.

Supported Parameters

BFF currently updates and learns four GROMACS force-field parameter families:

Parameter Bound label example
Partial charge charge O1 O2
Lennard-Jones sigma sigma OW
Lennard-Jones epsilon epsilon OW
Function-9 dihedral force constant dihedraltype9_3_180

Multiple names in one label share one learned value. Charges can additionally participate in hierarchical residue- or system-level constraints. The sample configuration reference documents the complete syntax and matching rules.

Architecture

flowchart LR
    A["YAML configs or Python API"] --> B["Simulation workflows"]
    B --> C["Trajectories and reference data"]
    C --> D["QoIDataset"]
    D --> E["Gaussian-process surrogates"]
    E --> F["Posterior learning and validation"]

The architecture guide describes the package modules, workflow stages, persisted artifacts, and repository layout.

Documentation

Citation

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

The exact publication snapshot is archived as v0.0.1.

License

BFF is distributed under the GNU GPL v3.

Metadata

Release files for bfflearn 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bfflearn 0.4.1
File Size Uploaded
bfflearn-0.4.1.tar.gz 279.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bfflearn 0.4.1
File Interpreter ABI Platform
bfflearn-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 440.6 kB

Release files / bfflearn-0.4.1.tar.gz

Download URL bfflearn-0.4.1.tar.gz
Size 279.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d69b6d1b7281271b744e78a3b6adaa46ed16c2011d720885650ad813cd635714
BLAKE2b-256 checksum
How to use checksums
2e25109544e06f10521b2e5e987cab4d56e72ca788446f9b81508196b8ba8055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / bfflearn-0.4.1-py3-none-any.whl

Download URL bfflearn-0.4.1-py3-none-any.whl
Size 160.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24902f564937e3e89dc0f8f12370a265326cb9132ca8850109a93fa03626b7c1
BLAKE2b-256 checksum
How to use checksums
e6a2037e52e6577425c24deafe873d4a378dad4fd98e82012a68356ff1aeb07b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page