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.0

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.0
File Size Uploaded
bfflearn-0.4.0.tar.gz 281.5 kB Details

Built distribution (wheel)

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

Total release size: 442.4 kB

Release files / bfflearn-0.4.0.tar.gz

Download URL bfflearn-0.4.0.tar.gz
Size 281.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8531ac0dee2793cac4e88877ddb8aab560ada684561790ee6de63ebcafedeac0
BLAKE2b-256 checksum
How to use checksums
571c2cc34643e35f87da52606a9dcf51e0dd4b8eb423c305be54359ef2cc13a8
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.0-py3-none-any.whl

Download URL bfflearn-0.4.0-py3-none-any.whl
Size 160.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e63aa70380511bac434c17802b73224ae55eaec0b873756fae824b25035d79a
BLAKE2b-256 checksum
How to use checksums
4553938dcd689008b8ef213cd236aa39549572377b5103f271cbec7a1bf2f37d
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

0.4.1

2 release files

This release

0.4.0 This release

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