Skip to main content

Machine learning collective variables for enhanced sampling

Project description

Machine Learning Collective Variables for Enhanced Sampling

CODE Documentation Status GitHub Actions Build Status codecov license

PAPER paper preprint


mlcolvar is a Python library aimed to help design data-driven collective-variables (CVs) for enhanced sampling simulations. The key features are:

  1. A unified framework to help test and use (some) of the CVs proposed in the literature.
  2. A modular interface to simplify the development of new approaches and the contamination between them.
  3. A streamlined distribution of CVs in the context of advanced sampling.

The library is built upon the PyTorch ML library as well as the Lightning high-level framework.


Some of the CVs which are implemented, organized by learning setting:

  • Unsupervised: PCA, (Variational) AutoEncoders [1,2]
  • Supervised: LDA [3], DeepLDA [4], DeepTDA [5]
  • Time-informed: TICA [6], DeepTICA/SRVs [7,8], VDE [9]

And many others can be implemented based on the building blocks or with simple modifications. Check out the documentation and the examples section!


PLUMED interface: the resulting CVs can be deployed for enhancing sampling with the PLUMED package via the pytorch interface, available since version 2.9.


Notes: in early versions (v<=0.2.*) the library was called mlcvs. This is still accessible for compatibility with PLUMED masterclasses in the releases or by cloning the pre-lightning branch.


Copyright (c) 2023 Luigi Bonati, Enrico Trizio, Andrea Rizzi and Michele Parrinello. Structure of the project is based on Computational Molecular Science Python Cookiecutter.

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

mlcolvar-1.0.1.tar.gz (290.7 kB view details)

Uploaded Source

Built Distribution

mlcolvar-1.0.1-py3-none-any.whl (73.3 kB view details)

Uploaded Python 3

File details

Details for the file mlcolvar-1.0.1.tar.gz.

File metadata

  • Download URL: mlcolvar-1.0.1.tar.gz
  • Upload date:
  • Size: 290.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for mlcolvar-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1cf1ba279b4de4b27cef1f43767d60028603ea836532810b1f7408d5fc0ab8b4
MD5 376a07193c19a43b0d6599c8ad9b8143
BLAKE2b-256 9791f31ee33df9f4e950c529c3a2f67650d55fa60a73ca94b9da6f42bd7bc7f6

See more details on using hashes here.

File details

Details for the file mlcolvar-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: mlcolvar-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 73.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for mlcolvar-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8905cce6313609676f09d7e5f6fe92627b4bbd80ef6bd9b823bbc024d94a0266
MD5 7a33f4bdb68f509bd4845354a1b15026
BLAKE2b-256 05f409a0016ceb32927abd84646cbf5b167d8738919657004e844900e1f1fe81

See more details on using hashes here.

Supported by

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