---
title: "How metadynamics gradually fills a visited valley"
description: "Derive the well-tempered bias limit, calculate its free-energy scaling and diagnose a collective variable that misses slow motion."
canonical_url: "https://sandboxphysics.com/stories/free-energy/well-tempered-metadynamics/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/free-energy/well-tempered-metadynamics/"
last_modified: "2026-10-28"
---

[Free energy and rare events](https://sandboxphysics.com/stories/free-energy/)

L3 · Chapter 6

# How metadynamics gradually fills a visited valley

Sandbox Physics · 2026-10-28

Metadynamics adds small hills where a trajectory has just visited, gradually discouraging repeated residence in one valley. Well-tempered deposition reduces later hill heights and controls how far exploration extends. Faster exploration changes the forces, so its elapsed time belongs to the biased dynamics.

## Before you begin

Static-bias distributions from Chapter 3 and uncertainty from Chapter 5. A Gaussian is a smooth hill. History dependence and long-time limits are introduced here.

[Review the preceding chapter](https://sandboxphysics.com/stories/free-energy/uncertainty-and-validation/)

- Explain the limiting free-energy scaling through the mean deposition rate.
- Diagnose a missed slow coordinate and distinguish accelerated sampling from a physical reaction rate.

## Leave hills that push on the trajectory

Let $s$ be a collective variable and $V(s,t)$ the accumulated bias. Every $\tau$ units of time, add a Gaussian of width $\sigma$ and height $h_j$ at the current position $s_j$. The bias gradient changes the force and discourages residence in already raised regions.

An umbrella spring stays fixed during a window run. This bias depends on the whole history. Finite-time frames therefore come from changing distributions and cannot be treated as equilibrium samples of one fixed bias in MBAR.

$$
V(s,t)=\sum_{j\tau<t}h_j\exp\!\left[-\frac{(s-s_j)^2}{2\sigma^2}\right]
$$

The hills change energy and motion. Width, deposition interval and initial height define a particular calculation.

Source: Max Bonomi

## Deposit smaller hills where the bias is high

Well-tempered deposition introduces $\Delta T>0$. Existing bias reduces each new hill. Write its bias factor as $b_{\mathrm{WT}}=(T+\Delta T)/T$ to distinguish it from friction. The original paper expresses temperature in energy units; we retain $k_{\mathrm B}$ explicitly.

If the bias changes slowly and hidden degrees of freedom equilibrate at fixed $s$, occupancy is proportional to $e^{-[F(s)+V(s)]/(k_{\mathrm B}T)}$. Multiply it by deposition factor $e^{-V/(k_{\mathrm B}\Delta T)}$. In the long-time shape, all positions gain the same mean increment. Making this product independent of $s$ gives the limiting bias.

$$
h_j=h_0\exp\!\left[-\frac{V(s_j,j\tau)}{k_{\mathrm B}\Delta T}\right]
$$

A location with more accumulated bias receives a smaller new hill.

$$
\lim_{t\to\infty}[V(s,t)-C(t)]=-\frac{\Delta T}{T+\Delta T}F(s)=-\frac{b_{\mathrm{WT}}-1}{b_{\mathrm{WT}}}F(s)
$$

Subtract the spatially uniform offset, which can keep growing with time. The remaining shape has this limit; finite-time errors and hidden-coordinate equilibration require separate checks.

Source: Alessandro Barducci · Max Bonomi

## Recover a free-energy difference from the bias

Worked example: take $b_{\mathrm{WT}}=5$ and a limiting bias difference $-3.2\,k_{\mathrm B}T$. Multiplication by $-5/4$ gives free-energy difference $4.0\,k_{\mathrm B}T$. Using the negative bias directly would underestimate it by one fifth.

The corresponding projected distribution is proportional to $e^{-F/(5k_{\mathrm B}T)}$. This broadens the selected coordinate’s distribution; it does not heat every molecular degree of freedom to five times the bath temperature. An excessively large factor spends effort in irrelevant high-free-energy regions.

$$
F(s)\simeq-\frac{b_{\mathrm{WT}}}{b_{\mathrm{WT}}-1}V(s,t)+C,\qquad P_{\mathrm{WT}}(s)\propto e^{-F(s)/(b_{\mathrm{WT}}k_{\mathrm B}T)}
$$

The finite-time estimate requires convergence checks. The second expression describes the ideal limiting projected distribution.

## An offline comparison measures faster exploration

Use eight paired seeds on the same two-coordinate potential, with and without well-tempered bias. Each trajectory lasts $120$ at step $0.002$. Deposit every $0.3$ time units, using initial height $0.12$, width $0.25$ and factor six. A committed crossing must reach the opposite set, defined by $x\leq-0.75$ and $x\geq0.75$.

Unbiased trajectories average $7.38$ committed crossings; biased trajectories average $29.1$. These parameters improve horizontal exploration. The scaled finite-time bias has shape RMS error about $0.377$ energy units against quadrature on $[-1.4,1.4]$. Raw paths, all four hundred hill deposits and every seed are retained in the offline records.

These counts describe motion under changed forces, not the original rate. Hidden-direction crossings rise only from about six to nine per trajectory here, much less than the horizontal increase.

## Flattening one direction can leave another trapped

Hills deposited only along $x$ need not remove a barrier in hidden $y$. A lively horizontal trajectory may remain inside one channel. Its learned bias can reflect that channel’s conditional landscape.

Compare conditional distributions and starts in different hidden valleys before choosing another direction or adding a variable. A useful coordinate describes the motions controlling slow exchange. A flat histogram alone does not establish this.

Time-dependent-bias reweighting requires an appropriate method. Another option freezes the learned bias and collects a separate equilibrium record after relaxation. That record becomes a static-bias problem. Keep adaptive and frozen-bias frames distinct.

## Try the reasoning in an experiment

### [Choose a collective variable likely to fail](https://sandboxphysics.com/labs/projected-free-energy/)

1. Predict a projection that stacks hidden valleys, then inspect its conditional distribution.
2. Imagine depositing hills along that coordinate. Identify the direction they push and the barrier they may leave untouched.
3. Choose another projection. Turn “flatter projected occupancy” and “equilibrated slow processes” into two separate tests.

## Exercises and explanations

1. For free-energy difference $4k_{\mathrm B}T$, what limiting bias difference results when the factor changes from five to two?

   Read the explanation

   The coefficient becomes $(2-1)/2=1/2$, giving $-2k_{\mathrm B}T$. A smaller factor retains more of the original free-energy variation and concentrates exploration.

2. A metadynamics trajectory crosses ten times per second. Is the original reaction rate ten per second?

   Read the explanation

   The bias changes forces and residence probabilities near the barrier. Inferring the original rate requires a separately justified and validated kinetic method. Ordinary metadynamics counts first describe the biased process.

[Previous: Why error bars can miss the largest error](https://sandboxphysics.com/stories/free-energy/uncertainty-and-validation/) [Next: Why equal free energies can give different reaction speeds](https://sandboxphysics.com/stories/free-energy/committor-and-rates/)

## Sources and reproduced scope

Worked examples and schematic figures are original teaching material. The numerical research slice compares specified estimator equations on our seeded two-coordinate records with independent quadrature and PyMBAR. The final chapter reads Figure 1 of the MBAR paper and states which experimental data remain outside that calculation.

[Model definitions, scripts and numerical records](https://github.com/yangzichao/sandboxphysics/tree/main/docs/frontier/fr15)

1. [Alessandro Barducci, Giovanni Bussi and Michele Parrinello, Well-Tempered Metadynamics, Phys. Rev. Lett. 100, 020603 (2008)](https://arxiv.org/abs/0803.3861v1)

   Frozen arXiv v1: adaptive deposition law and limiting bias, Eqs. (2)–(6). The derivation assumes that microscopic degrees of freedom equilibrate sufficiently fast at a given collective variable. Its alanine-dipeptide numerical experiment is outside our reproduction.

2. [Max Bonomi, PLUMED Masterclass 21.4, Metadynamics (2021; documentation v2.9)](https://www.plumed.org/doc-v2.9/user-doc/html/masterclass-21-4.html)

   Theory summary and exercises on reconstruction, block analysis and good or bad collective variables. The long-time bias relation is used with its sampling assumptions; a finite-time bias is not labelled exact free energy.
