Blue moon ensemble calculations: Difference between revisions

From VASP Wiki
(Created page with "The information needed to determine the blue moon ensemble averages within a Constrained molecular dynamics can be obtained by setting {{TAG|LBLUEOUT}}=.TRUE. The following output is written for each MD step in the file {{FILE|REPORT}}: >Blue_moon lambda |z|^(-1/2) GkT |z|^(-1/2)*(lambda+GkT) b_m> 0.585916E+01 0.215200E+02 -0.117679E+00 0.123556E+03 with the four numerical terms indicatin...")
 
Line 21: Line 21:
  paste energy.dat zet.dat |awk 'BEGIN {a=0.;b=0.} {a+=$1*$2;b+=$2} END {print a/b}'
  paste energy.dat zet.dat |awk 'BEGIN {a=0.;b=0.} {a+=$1*$2;b+=$2} END {print a/b}'


==References==
<references>
<ref name="Ryckaert77">[http://dx.doi.org/10.1016/0021-9991(77)90098-5 J. P. Ryckaert, G. Ciccotti, and H. J. C. Berendsen, J. Comp. Phys. 23, 327 (1977).]</ref>
<ref name="Carter89">[http://dx.doi.org/10.1016/S0009-2614(89)87314-2 E. A. Carter, G. Ciccotti, J. T. Hynes, and R. Kapral, Chem. Phys. Lett. 156, 472 (1989).]</ref>
<ref name="Otter00">[http://dx.doi.org/10.1080/00268970009483348 W. K. Den Otter and W. J. Briels, Mol. Phys. 98, 773 (2000).]</ref>
<ref name="Darve02">[http://dx.doi.org/10.1080/08927020211975 E. Darve, M. A. Wilson, and A. Pohorille, Mol. Simul. 28, 113 (2002).]</ref>
<ref name="Fleurat05">[http://dx.doi.org/10.1063/1.1948367 P. Fleurat-Lessard and T. Ziegler, J. Chem. Phys. 123, 084101 (2005).]</ref>
<ref name="Ryckaert77">[http://dx.doi.org/10.1016/0021-9991(77)90098-5 J. P. Ryckaert, G. Ciccotti, and H. J. C. Berendsen, J. Comp. Phys. 23, 327 (1977).]</ref>
</references>
----
----


[[Category:Howto]]
[[Category:Howto]]

Revision as of 13:10, 16 October 2024

The information needed to determine the blue moon ensemble averages within a Constrained molecular dynamics can be obtained by setting LBLUEOUT=.TRUE. The following output is written for each MD step in the file REPORT:

>Blue_moon
       lambda        |z|^(-1/2)    GkT           |z|^(-1/2)*(lambda+GkT)
  b_m>  0.585916E+01  0.215200E+02 -0.117679E+00  0.123556E+03


with the four numerical terms indicating [math]\displaystyle{ \lambda_{\xi_k} }[/math], [math]\displaystyle{ |Z|^{-1/2} }[/math], [math]\displaystyle{ \left ( \frac{k_B T}{2 |Z|} \sum_{j=1}^{r}(Z^{-1})_{kj} \sum_{i=1}^{3N} m_i^{-1}\nabla_i \xi_j \cdot \nabla_i |Z| \right ) }[/math], and [math]\displaystyle{ \left ( |Z|^{-1/2} [\lambda_k +\frac{k_B T}{2 |Z|} \sum_{j=1}^{r}(Z^{-1})_{kj} \sum_{i=1}^{3N} m_i^{-1}\nabla_i \xi_j \cdot \nabla_i |Z|] \right ) }[/math], respectively.


Mind: [math]\displaystyle{ \left ( \frac{1}{2 |Z|} \sum_{j=1}^{r}(Z^{-1})_{kj} \sum_{i=1}^{3N} m_i^{-1}\nabla_i \xi_j \cdot \nabla_i |Z| \right ) }[/math] is defined as [math]\displaystyle{ G }[/math] in the REPORT file. This is an arbitrary character and has no relation to Green's functions, reciprocal lattice vectors, etc.

Note that one line introduced by the string 'b_m>' is written for each constrained coordinate. With this output, the free energy gradient with respect to the fixed coordinate [math]\displaystyle{ {\xi_k} }[/math] can conveniently be determined (by the equation given above) as a ratio between averages of the last and the second numerical terms. In the simplest case when only one constraint is used, the free energy gradient can be obtained as follows:

grep b_m REPORT |awk 'BEGIN {a=0.;b=0.} {a+=$5;b+=$3} END {print a/b}'

As an example of a blue moon ensemble average, let us consider the calculation of an unbiased potential energy average from constrained MD. For simplicity, only a single constraint is assumed. Here we extract [math]\displaystyle{ |Z|^{-1/2} }[/math] for each step and store the data in an auxiliary file zet.dat:

grep b_m REPORT |awk '{print $3}' > zet.dat

Here we extract potential energy for each step and store the data in an auxiliary file energy.dat:

grep e_b REPORT |awk '{print $3}' > energy.dat

Finally, the weighted average is determined according to the first formula shown above:

paste energy.dat zet.dat |awk 'BEGIN {a=0.;b=0.} {a+=$1*$2;b+=$2} END {print a/b}'