SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.19980 · 2023

A unified framework for machine learning collective variables for enhanced sampling simulations: $\texttt{mlcolvar}$

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2305.19980.json · badge: /api/ran/2305.19980.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
luigibonati/mlcolvar canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
jintuzhang/mlcolvar community (classifier label)
classifier basis not recorded on the link
1 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_covariance Ran
ran on a synthesized input
luigibonati/mlcolvar/mlcolvar/core/loss/generator_loss.py
code served (permissive licence) · get_code("fd7952da412b1f96")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# For 2D case: X is (n, d), weights is (n,)
# For 3D case: X is (n, d1, d2), weights is (n,)
# We'll test the 2D case

n = 2
d = 4

X = torch.randn(n, d)
weights = torch.randn(n)

ARGS = {
    "X": X,
    "weights": weights,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_activation Ran
ran on a synthesized input
luigibonati/mlcolvar/mlcolvar/core/nn/utils.py
code served (permissive licence) · get_code("c582c2d25ac35e3a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ReLU. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

class Shifted_Softplus(torch.nn.Softplus):
    """Element-wise softplus function shifted as to pass from the origin."""

    def __init__(self, beta=1, threshold=20):
        super(Shifted_Softplus, self).__init__(beta, threshold)
        sp0 = F.softplus(torch.zeros(1), beta, threshold)
        self.register_buffer('sp0', sp0)

    def forward(self, input):
        return F.softplus(input, self.beta, self.threshold) - self.sp0

class Custom_Sigmoid(torch.nn.Module):

    def __init__(self, p=3):
        super(Custom_Sigmoid, self).__init__()
        self.p = p

    def forward(self, input):
        return 1 / (1 + torch.exp(-self.p * input))

def get_activation(activation: str):
    """Return activation module given string."""
    activ = None
    if activation == 'relu':
        activ = torch.nn.ReLU(True)
    elif activation == 'elu':
        activ = torch.nn.ELU(True)
    elif activation == 'tanh':
        activ = torch.nn.Tanh()
    elif activation == 'softplus':
        activ = torch.nn.Softplus()
    elif activation == 'shifted_softplus':
        activ = Shifted_Softplus()
    elif activation == 'custom_sigmoid':
        activ = Custom_Sigmoid()
    elif activation == 'leaky_relu':
        activ = torch.nn.LeakyReLU(negative_slope=0.01, inplace=True)
    elif activation == 'linear':
        print('WARNING: no activation selected')
    elif activation is None:
        pass
    else:
        raise ValueError(f"Unknown activation: {activation}. options: 'relu','elu','tanh','softplus','shifted_softplus','linear','leaky_relu'. ")
    return activ

ARGS = {
    'activation': 'relu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mse_loss Ran
ran on a synthesized input
luigibonati/mlcolvar/mlcolvar/core/loss/mse.py
code served (permissive licence) · get_code("d3dc6cad300a0ac1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for input and target
# Using batch_size=2, feature_dim=4
input_tensor = torch.randn(2, 4)
target_tensor = torch.randn(2, 4)

# Create optional weights tensor with same batch size
weights_tensor = torch.ones(2)

ARGS = {
    "input": input_tensor,
    "target": target_tensor,
    "weights": weights_tensor,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_nn_options Ran
ran on a synthesized input
luigibonati/mlcolvar/mlcolvar/core/nn/utils.py
code served (permissive licence) · get_code("161e915168203193")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Test case 1: string option, n_layers > 1, last_layer_activation=False
# Expected: options repeated for n_layers-1, then None for last layer
ARGS = {
    "options": "relu",
    "n_layers": 3,
    "last_layer_activation": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reduce_eigenvalues_loss Ran
ran on a synthesized input
luigibonati/mlcolvar/mlcolvar/core/loss/eigvals.py
code served (permissive licence) · get_code("f7515ced1f62c0e1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create eigenvalues tensor with shape (n_batches, n_eigenvalues)
# Using shape (2, 4) for small size with distinct dimensions
evals = torch.tensor([
    [5.0, 3.0, 1.0, 0.5],
    [4.0, 2.5, 0.8, 0.3]
], dtype=torch.float32)

ARGS = {
    'evals': evals,
    'mode': 'sum',
    'n_eig': 0,
    'invert_sign': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reduce_eigenvalues_loss Ran
ran on a synthesized input
jintuzhang/mlcolvar/mlcolvar/core/loss/eigvals.py
code served (permissive licence) · get_code("dd4706e9d3e702d6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create eigenvalues tensor with shape (n_batches, n_eigenvalues)
# Using small positive values that are valid for log operations in 'its' mode
evals = torch.tensor([
    [2.5, 1.8, 1.2, 0.5],
    [3.0, 2.1, 1.5, 0.8]
], dtype=torch.float32)

ARGS = {
    'evals': evals,
    'mode': 'sum',
    'n_eig': 0,
    'invert_sign': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tda_loss Ran
ran on a synthesized input
luigibonati/mlcolvar/mlcolvar/core/loss/tda_loss.py
code served (permissive licence) · get_code("960137d6a2b39ed7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Set up tensors
# H: shape (n_batches, n_cvs) - output of NN
# We'll use batch_size=4, n_cvs=3
H = torch.randn(4, 3)

# labels: shape (n_batches,) - must have all states 0 to n_states-1
n_states = 2
labels = torch.tensor([0, 1, 0, 1])

# target_centers: shape (n_states, n_cvs)
target_centers = torch.tensor([
    [-1.0, 0.0, 1.0],
    [1.0, -1.0, 0.5]
])

# target_sigmas: shape (n_states, n_cvs)
target_sigmas = torch.tensor([
    [0.5, 0.5, 0.5],
    [0.7, 0.6, 0.8]
])

# alpha and beta are scalars
alpha = 1.0
beta = 100.0

# return_loss_terms boolean
return_loss_terms = False

ARGS = {
    "H": H,
    "labels": labels,
    "n_states": n_states,
    "target_centers": target_centers,
    "target_sigmas": target_sigmas,
    "alpha": alpha,
    "beta": beta,
    "return_loss_terms": return_loss_terms
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tda_loss Not yet run
unverified (harvested, no recorded run)
jintuzhang/mlcolvar/mlcolvar/core/loss/tda_loss.py
code served (permissive licence) · get_code("46005db8034f843f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Identifying a reduced set of collective variables is critical for understanding atomistic simulations and accelerating them through enhanced sampling techniques. Recently, several methods have been proposed to learn these variables directly from atomistic data. Depending on the type of data available, the learning process can be framed as dimensionality reduction, classification of metastable states or identification of slow modes. Here we present $\texttt{mlcolvar}$, a Python library that simplifies the construction of these variables and their use in the context of enhanced sampling through a contributed interface to the PLUMED software. The library is organized modularly to facilitate the extension and cross-contamination of these methodologies. In this spirit, we developed a general multi-task learning framework in which multiple objective functions and data from different simulations can be combined to improve the collective variables. The library's versatility is demonstrated through simple examples that are prototypical of realistic scenarios.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2305.19980")
get_code_for_paper("2305.19980")
have("2305.19980")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2305.19980.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2305.19980.svg)](https://syntology.ai/paper/2305.19980)

Connect an agent — have() is free.