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

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.2
File Size Uploaded
bfflearn-0.4.2.tar.gz 287.7 kB Details

Built distribution (wheel)

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

Total release size: 452.5 kB

Release files / bfflearn-0.4.2.tar.gz

Download URL bfflearn-0.4.2.tar.gz
Size 287.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2684a1606bdf670fcd990a276f6a02a93dedfb0f4b80f05f80a9dc333119e726
BLAKE2b-256 checksum
How to use checksums
e7ba717a1ff3de40219b6e83865bd80e1c79d784d6c5f6a1b7d08e487e34a8c1
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 Oct 2, 2026.

Transparency log

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

Download URL bfflearn-0.4.2-py3-none-any.whl
Size 164.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aaca60bb66ef4e85731a8724bd5e8066aa3d335a197122567420c9365c672814
BLAKE2b-256 checksum
How to use checksums
b9b73a946d681bf91af43abba8b0eccf8bd133e83217941125906b735687790d
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 Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.2 This release

2 release files

0.4.1

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