Skip to main content
Sandbox Physics
Free energy and rare events

L3 · Chapter 6

How metadynamics gradually fills a visited valley

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.

Leave hills that push on the trajectory

Let ss be a collective variable and V(s,t)V(s,t) the accumulated bias. Every τ\tau units of time, add a Gaussian of width σ\sigma and height hjh_j at the current position sjs_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)=∑jτ<thjexp⁡ ⁣[−(s−sj)22σ2]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 ΔT>0\Delta T>0. Existing bias reduces each new hill. Write its bias factor as bWT=(T+ΔT)/Tb_{\mathrm{WT}}=(T+\Delta T)/T to distinguish it from friction. The original paper expresses temperature in energy units; we retain kBk_{\mathrm B} explicitly.

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

hj=h0exp⁡ ⁣[−V(sj,jτ)kBΔT]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→∞[V(s,t)−C(t)]=−ΔTT+ΔTF(s)=−bWT−1bWTF(s)\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 bWT=5b_{\mathrm{WT}}=5 and a limiting bias difference −3.2 kBT-3.2\,k_{\mathrm B}T. Multiplication by −5/4-5/4 gives free-energy difference 4.0 kBT4.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/(5kBT)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)≃−bWTbWT−1V(s,t)+C,PWT(s)∝e−F(s)/(bWTkBT)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 120120 at step 0.0020.002. Deposit every 0.30.3 time units, using initial height 0.120.12, width 0.250.25 and factor six. A committed crossing must reach the opposite set, defined by x≤−0.75x\leq-0.75 and x≥0.75x\geq0.75.

Unbiased trajectories average 7.387.38 committed crossings; biased trajectories average 29.129.1. These parameters improve horizontal exploration. The scaled finite-time bias has shape RMS error about 0.3770.377 energy units against quadrature on [−1.4,1.4][-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 xx need not remove a barrier in hidden yy. 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

  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 4kBT4k_{\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(2-1)/2=1/2, giving −2kBT-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.

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

  1. Alessandro Barducci, Giovanni Bussi and Michele Parrinello, Well-Tempered Metadynamics, Phys. Rev. Lett. 100, 020603 (2008)

    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)

    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.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy