Skip to content

Commit 6b17716

Browse files
Merge pull request #1411 from plumed/fix-histogram-master
2 parents d404d26 + 516b7c2 commit 6b17716

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/gridtools/Histogram.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
/*
3131
Accumulate the average probability density along a few CVs from a trajectory.
3232
33+
!!! caution ""
34+
35+
We recommend not using this shortcut action and instead using a combination of [KDE](KDE.md) and
36+
[ACCUMULATE](ACCUMULATE.md) actions. This newer syntax will give you much more control over the
37+
calculation. HISTOGRAM works by calling these two underlying actions as you can see if you expand the shortcuts
38+
in the documentation that follows.
39+
3340
When using this shortcut it is supposed that you have some collective variable $\zeta$ that
3441
gives a reasonable description of some physical or chemical phenomenon. As an example of what we
3542
mean by this suppose you wish to examine the following SN2 reaction:
@@ -54,6 +61,9 @@ of the histogram to the free energy can be achieved by using the method [CONVERT
5461
5562
We calculate histograms within PLUMED using a method known as [kernel density estimation](https://en.wikipedia.org/wiki/Kernel_density_estimation).
5663
This shortcut action thus uses the [KDE](KDE.md) and [ACCUMULATE](ACCUMULATE.md) actions to build up the time average of the histogram.
64+
__You will have much more control over what PLUMED is computing if you take some time to learn to use the new syntax with [KDE](KDE.md) and
65+
[ACCUMULATE](ACCUMULATE.md) and if you stop using the HISTOGRAM shortcut action.__
66+
5767
5868
In PLUMED the value of $\zeta$ at each discrete instant in time in the trajectory is accumulated. A kernel, $K(\zeta-\zeta(t'),\sigma)$,
5969
centered at the current value, $\zeta(t)$, of this quantity is generated with a bandwidth $\sigma$, which
@@ -258,6 +268,9 @@ Histogram::Histogram( const ActionOptions& ao ):
258268
readInputLine( getShortcutLabel() + "_wsum: COMBINE ARG=" + lw + " PERIODIC=NO");
259269
readInputLine( getShortcutLabel() + "_weight: CUSTOM ARG=" + getShortcutLabel() + "_wsum FUNC=exp(x) PERIODIC=NO");
260270
} else {
271+
if( lw.length()>0 ) {
272+
error("set NORMALIZATION=true/false when using LOGWEIGHTS as otherwise the weights are ignored. Alternatively, learn to use the new syntax for histograms with KDE/ACCUMULATE to have more control over what PLUMED is calculating");
273+
}
261274
readInputLine( getShortcutLabel() + "_weight: ONES SIZE=1" );
262275
}
263276

0 commit comments

Comments
 (0)