Some thoughts for blue moon method and slow growth in cp2k

46 views
Skip to first unread message

xuan Garrett

unread,
Jun 29, 2026, 9:53:39 AMJun 29
to cp2k
Dear cp2k community,

Based on some of the topics in this google group and the official pages in cp2k.org, I notice that the blue moon method and slow growth method are not clearly displayed . So, here, I want to start a topic about this. 

You can see that the page is not available on official page from cp2k.org. And after I check from Prof. Hutter that actually, cp2k only outputs the lamda value (the constraint force) rather the whole blue moon ensemble for thermodynamic integration (TI). 

And the official example that uses the PMF to calculate the free energy itself provides the one example, where one should note that the if the COLVAR (CV) only refers to the single distance, then the mean force can be treated by <lamda>. 

If the CV is defined as the gap between two distances, such as d(A---B) - d(B---C) as in substitution reaction: A + B---C → A---B + C. Then, the mean force does not always follow the simple lamda, but <Z^(-1/2)*lambda> / <Z^(-1/2)>. 

Comparatively, for VASP users, because the LBLUEOUT tag supports the whole blue moon ensemble correction, we just need to follow its official steps with TI. But for cp2k users, the strict blue moon ensemble correction should be done yourself as suggested by Prof. Hutter. 

I don't know if developers will attempt to add the corrections to some simple CV definitions for blue moon ensemble.

And for the slow growth, in terms of cAIMD (not the slow growth in metadynamics of cp2k), maybe the tag in &CONSTRAINT/&COLLECTIVE as of TARGET_GROWTH states for this function. 

So, here, I attach one article with the correction formula for these two conditions, single distance and gap of two distances.

1.jpg
2.jpg
3.jpg

Best regards,
Xuan

Thomas Kühne

unread,
Aug 6, 2026, 12:07:13 PM (7 days ago) Aug 6
to cp...@googlegroups.com
Dear Xuan,

your interpretation is essentially correct, with two important qualifications.

CP2K currently prints the raw constraint multipliers, not a complete general
blue-moon estimator.

In the Lagrange-multiplier output, the "Shake" values are the position-
constraint multipliers relevant to configurational thermodynamic integration.
The "Rattle" values enforce the velocity constraint and should not be treated
as a second configurational-force sample.

With the CP2K convention

  F_constraint = -lambda grad(xi),

the mass metric for one constrained coordinate is

  Z = sum_i [ 1/m_i |grad_i xi|^2 ].

The general free-energy gradient requires Z^(-1/2) reweighting and, depending
on the collective variable, an additional metric-derivative term.

For a simple distance

  xi = |r_i - r_j|,

the metric is

  Z = 1/m_i + 1/m_j.

It is constant and the metric-derivative term vanishes. Therefore,

  dA/dxi = -<lambda>.

The sign follows from CP2K's constraint-force convention.

For the specific three-atom coordinate

  xi = |r_i - r_j| - |r_k - r_j|,

define rho_ij and rho_kj as the corresponding unit vectors. The metric is

  Z = 1/m_i + 1/m_k
      + 2/m_j [1 - rho_ij dot rho_kj].

This value changes with the instantaneous angle. For this particular
coordinate the metric-derivative term still vanishes, and the corrected
estimator is

  dA/dxi =
    < Z^(-1/2) (-lambda) > / < Z^(-1/2) >.

This simplification must not be generalized to arbitrary COMBINE_COLVAR
expressions or to multiple simultaneous constraints.

TARGET_GROWTH implements a moving constraint. At every MD step CP2K updates
the target according to

  TARGET <- TARGET + TARGET_GROWTH * TIMESTEP

and optionally stops the growth at TARGET_LIMIT.

This can be used for a slow-growth or steered trajectory. CP2K does not,
however, integrate the work or automatically transform this trajectory into
an equilibrium free-energy profile.

For equilibrium blue-moon thermodynamic integration, use independently
equilibrated fixed-TARGET windows, calculate the corrected mean force in each
window, and integrate the mean force over xi.

The printed multipliers are in CP2K internal units. For a distance constraint,
lambda is printed in hartree/bohr even when TARGET was entered in angstrom.

I have opened a documentation pull request covering these points:

It adds a constrained-MD and blue-moon guide, explains SHAKE versus RATTLE
multipliers and their units, gives the distance and three-atom
distance-difference formulas, and documents the exact TARGET_GROWTH behavior
and its limitations.

Best regards,
Thomas


<1.jpg>
<2.jpg>
<3.jpg>

Best regards,
Xuan


--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/3c3a946a-e5f9-474e-a606-47d75dfbfdabn%40googlegroups.com.
<3.jpg><2.jpg><1.jpg>

Reply all
Reply to author
Forward
0 new messages