Module |
landmarks |
Description |
Usage |
This action takes the exponential of a vector of logarithms and divides each element of the vector by the sum of the exponentials. |
  |
output value |
type |
the logarithms of the input weights logweights that are computed with the log-sum weights formula |
vector |
Further details and examples
This action takes the exponential of a vector of logarithms and divides each element of the vector by the sum of the exponentials.
If you has performed a simulation with a time-independent bias, V(x), you can recover the unbiased distribution from the trajectory
by constructing a histogram in which the ith frame of the trajectory is given weight of:
wi=eβV(xi)∑jeβV(xj)
where xi is used to indicate the coordinates for frame i and β is the inverse temperature in units of energy. If the bias
is large then it is easy for eβV(xi) to overflow. This action thus allows you to use the following trick is to compute the wi
values in the above expression:
wi=eβ(V(xi)−cwherec=βVmax+log[∑jeβV(xj)−βVmax]
In this expression Vmax is the maximum value the bias took during the simulation.
The following example shows how you can write a PLUMED input that exploits this trick.
Click on the labels of the actions for more information on what each action computes
t1The TORSION action with label t1 calculates the following quantities: Quantity | Type | Description |
t1 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
t2The TORSION action with label t2 calculates the following quantities: Quantity | Type | Description |
t2 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=5,6,7,8
t3The TORSION action with label t3 calculates the following quantities: Quantity | Type | Description |
t3 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=9,10,11,12
rThe RESTRAINT action with label r calculates the following quantities: Quantity | Type | Description |
r.bias | scalar | the instantaneous value of the bias potential |
r.force2 | scalar | the instantaneous value of the squared force due to this bias potential |
: RESTRAINTAdds harmonic and/or linear restraints on one or more variables. This action has hidden defaults. More details ARGthe values the harmonic restraint acts upon=t1 ATthe position of the restraint=pi/2 KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=10
r: RESTRAINTAdds harmonic and/or linear restraints on one or more variables. This action uses the defaults shown here. More details ARGthe values the harmonic restraint acts upon=t1 ATthe position of the restraint=pi/2 KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=10 SLOPE specifies that the restraint is linear and what the values of the force constants on each of the variables are=0.0
bwThe REWEIGHT_BIAS action with label bw calculates the following quantities: Quantity | Type | Description |
bw | scalar | the weight to use for this frame to negate the effect the bias |
: REWEIGHT_BIASCalculate weights for ensemble averages that negate the effect the bias has on the region of phase space explored This action has hidden defaults. More details TEMPthe system temperature=300
bw: REWEIGHT_BIASCalculate weights for ensemble averages that negate the effect the bias has on the region of phase space explored This action uses the defaults shown here. More details TEMPthe system temperature=300 ARG the biases that must be taken into account when reweighting=*.bias
ccThe COLLECT_FRAMES action with label cc calculates the following quantities: Quantity | Type | Description |
cc_data | matrix | the data that is being collected by this action |
cc_logweights | vector | the logarithms of the weights of the data points |
: COLLECT_FRAMESCollect atomic positions or argument values from the trajectory for later analysis This action is a shortcut and it has hidden defaults. More details ARGthe labels of the values whose time series you would like to collect for later analysis=t1,t2,t3 LOGWEIGHTSlist of actions that calculates log weights that should be used to weight configurations when calculating averages=bw
The COLLECT_FRAMES action with label cc calculates the following quantities: Quantity | Description |
cc.data | the data that is being collected by this action |
cc.logweights | the logarithms of the weights of the data points |
cc: COLLECT_FRAMESCollect atomic positions or argument values from the trajectory for later analysis This action is a shortcut and uses the defaults shown here. More details ARGthe labels of the values whose time series you would like to collect for later analysis=t1,t2,t3 LOGWEIGHTSlist of actions that calculates log weights that should be used to weight configurations when calculating averages=bw STRIDE the frequency with which data should be stored for analysis=1 CLEAR the frequency with which data should all be deleted and restarted=0
# cc: COLLECT_FRAMES ARG=t1,t2,t3 LOGWEIGHTS=bw
cc_t1The COLLECT action with label cc_t1 calculates the following quantities: Quantity | Type | Description |
cc_t1 | vector | the time series for the input quantity |
: COLLECTCollect data from the trajectory for later analysis More details ARGthe label of the value whose time series is being stored for later analysis=t1 STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
cc_t2The COLLECT action with label cc_t2 calculates the following quantities: Quantity | Type | Description |
cc_t2 | vector | the time series for the input quantity |
: COLLECTCollect data from the trajectory for later analysis More details ARGthe label of the value whose time series is being stored for later analysis=t2 STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
cc_t3The COLLECT action with label cc_t3 calculates the following quantities: Quantity | Type | Description |
cc_t3 | vector | the time series for the input quantity |
: COLLECTCollect data from the trajectory for later analysis More details ARGthe label of the value whose time series is being stored for later analysis=t3 STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
cc_dataThe VSTACK action with label cc_data calculates the following quantities: Quantity | Type | Description |
cc_data | matrix | a matrix that contains the input vectors in its columns |
: VSTACKCreate a matrix by stacking vectors together More details ARGthe values that you would like to stack together to construct the output matrix=cc_t1,cc_t2,cc_t3
cc_logweightsThe COLLECT action with label cc_logweights calculates the following quantities: Quantity | Type | Description |
cc_logweights | vector | the time series for the input quantity |
: COLLECTCollect data from the trajectory for later analysis More details ARGthe label of the value whose time series is being stored for later analysis=bw STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
cc_oneThe CONSTANT action with label cc_one calculates the following quantities: Quantity | Type | Description |
cc_one | scalar | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details VALUEthe single number that you would like to store=1
cc_onesThe COLLECT action with label cc_ones calculates the following quantities: Quantity | Type | Description |
cc_ones | vector | the time series for the input quantity |
: COLLECTCollect data from the trajectory for later analysis More details ARGthe label of the value whose time series is being stored for later analysis=cc_one STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 CLEAR the frequency with which to clear all the accumulated data=0
# --- End of included input ---
weightsThe LOGSUMEXP action with label weights calculates the following quantities: Quantity | Type | Description |
weights | vector | the logarithms of the input weights logweights that are computed with the log-sum weights formula |
: LOGSUMEXPThis action takes the exponential of a vector of logarithms and divides each element of the vector by the sum of the exponentials. This action is a shortcut. More details ARGthe vector of logweights that you would like to normalise using the logsumexp trick=cc_logweights
# weights: LOGSUMEXP ARG=cc_logweights
weights_maxlogweightThe HIGHEST action with label weights_maxlogweight calculates the following quantities: Quantity | Type | Description |
weights_maxlogweight | scalar | the largest element of the input vector if one vector specified. If multiple vectors of the same size specified the largest elements of these vector computed elementwise. |
: HIGHESTThis function can be used to find the highest colvar by magnitude in a set. More details ARGthe values input to this function=cc_logweights
weights_shiftwThe CUSTOM action with label weights_shiftw calculates the following quantities: Quantity | Type | Description |
weights_shiftw | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=cc_logweights,weights_maxlogweight FUNCthe function you wish to evaluate=exp(x-y) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
weights_sumwThe SUM action with label weights_sumw calculates the following quantities: Quantity | Type | Description |
weights_sumw | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=weights_shiftw PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
weights_logsumThe CUSTOM action with label weights_logsum calculates the following quantities: Quantity | Type | Description |
weights_logsum | scalar | an arbitrary function |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=weights_sumw,weights_maxlogweight FUNCthe function you wish to evaluate=y+log(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
weightsThe CUSTOM action with label weights calculates the following quantities: Quantity | Type | Description |
weights | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=cc_logweights,weights_logsum FUNCthe function you wish to evaluate=exp(x-y) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input ---
DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=weights FILE the file on which to write the vetors=weights
Syntax
The following table describes the keywords and options that can be used with this action
Keyword |
Type |
Default |
Description |
ARG |
compulsory |
none |
the vector of logweights that you would like to normalise using the logsumexp trick |