This is part of the ves module | |
It is only available if you configure PLUMED with ./configure –enable-modules=ves . Furthermore, this feature is still being developed so take care when using it and report any problems on the mailing list. |
Daubechies Wavelets basis functions.
Note: at the moment only bases with a single level of scaling functions are usable, as multiscale optimization is not yet implemented.
This basis set uses Daubechies Wavelets [48] to construct a complete and orthogonal basis. See [102] for full details.
The basis set is based on using a pair of functions, the scaling function (or father wavelet) \(\phi\) and the wavelet function (or mother wavelet) \(\psi\). They are defined via the two-scale relations for scale \(j\) and shift \(k\):
\begin{align*} \phi_k^j \left(x\right) = 2^{-j/2} \phi \left( 2^{-j} x - k\right)\\ \psi_k^j \left(x\right) = 2^{-j/2} \psi \left( 2^{-j} x - k\right) \end{align*}
The exact properties are set by choosing filter coefficients, e.g. choosing \(h_k\) for the father wavelet:
\[ \phi\left(x\right) = \sqrt{2} \sum_k h_k\, \phi \left( 2 x - k\right) \]
The filter coefficients by Daubechies result in an orthonormal basis of all integer shifted functions:
\[ \int \phi(x+i) \phi(x+j) \mathop{}\!\mathrm{d}x = \delta_{ij} \quad \text{for} \quad i,j \in \mathbb{Z} \]
Because no analytic formula for these wavelets exist, they are instead constructed iteratively on a grid. The method of construction is close to the "Vector cascade algorithm" described in [125] . The needed filter coefficients of the scaling function are hardcoded, and were previously generated via a python script. Currently the "maximum phase" type (Db) and the "least asymmetric" (Sym) type are implemented. We recommend to use Symlets.
As an example two adjacent basis functions of both Sym8 (ORDER=8, TYPE=SYMLET) and Db8 (ORDER=8, TYPE=DAUBECHIES) is shown in the figure. The full basis consists of shifted wavelets in the full specified interval.
The TYPE keyword sets the type of Wavelet, at the moment "DAUBECHIES" and "SYMLETS" are available. The specified ORDER of the basis corresponds to the number of vanishing moments of the wavelet, i.e. if TYPE was specified as "DAUBECHIES" an order of 8 results in Db8 wavelets.
The resulting basis set consists of integer shifts of the wavelet with some scaling \(j\),
\[ V(x) = \sum_i \alpha_i * \phi_i (x) = \sum_i \alpha_i * \phi(\frac{x+i}{j}) \]
with the variational parameters \( \alpha \). Additionally a constant basis function is included.
There are two different ways to specify the number of used basis functions implemented. You can either specify the scale or alternatively a fixed number of basis function.
Coming from the multiresolution aspect of wavelets, you can set the scale of the father wavelets, i.e. the largest scale used for approximation. This can be done with the FUNCTION_LENGTH keyword. It should be given in the same units as the used CV and specifies the length (of the domain interval) of the individual father wavelet functions.
Alternatively a fixed number of basis functions for the bias expansion can be specified with the NUM_BF keyword, which will set the scale automatically to match the desired number of functions. Note that this also includes the constant function.
If you do not specify anything, it is assumed that the range of the bias should match the scale of the wavelet functions. More precise, the basis functions are scaled to match the specified size of the CV space (MINIMUM and MAXIMUM keywords). This has so far been a good initial choice.
If the wavelets are scaled to match the CV range exactly there would be \(4*\text{ORDER} -3\) basis functions whose domain is at least partially in this region. This number is adjusted if FUNCTION_LENGTH or NUM_BF is specified. Additionally, some of the shifted basis functions will not have significant contributions because of their function values being close to zero over the full range of the bias. These 'tail wavelets' can be omitted by using the TAILS_THRESHOLD keyword. This omits all shifted functions that have only function values smaller than a fraction of their maximum value inside the bias range. Using a value of e.g. 0.01 will already reduce the number of basis functions significantly. The default setting will not omit any tail wavelets (i.e. TAILS_THRESHOLD=0).
The number of basis functions is then not easily determinable a priori but will be given in the logfile. Additionally the starting point (leftmost defined point) of the individual basis functions is printed.
With the PERIODIC keyword the basis set can also be used to bias periodic CVs. Then the shift between the functions will be chosen such that the function at the left border and right border coincide. If the FUNCTION_LENGTH keyword is used together with PERIODIC, a smaller length might be chosen to satisfy this requirement.
The values of the wavelet function are generated on a grid. Using the cascade algorithm results in doubling the grid values for each iteration. This means that the grid size will always be a power of two multiplied by the number of coefficients ( \( 2*\text{ORDER} -1\)) for the specified wavelet. Using the MIN_GRID_SIZE keyword a lower bound for the number of grid points can be specified. By default at least 1,000 grid points are used. Function values in between grid points are calculated by linear interpolation.
To avoid 'blind' optimization of the basis functions outside the currently sampled area, it is often beneficial to use the OPTIMIZATION_THRESHOLD keyword of the VES_LINEAR_EXPANSION (set it to a small value, e.g. 1e-6)
First a very simple example that relies on the default values. We want to bias some CV in the range of 0 to 4. The wavelets will therefore be scaled to match that range. Using Db8 wavelets this results in 30 basis functions (including the constant one), with their starting points given by \( -14*\frac{4}{15}, -13*\frac{4}{15}, \cdots , 0 , \cdots, 13*\frac{4}{15}, 14*\frac{4}{15} \).
bf: BF_WAVELETS ...ORDER=8compulsory keyword The order of the basis function expansion.TYPE=DAUBECHIEScompulsory keyword Specify the wavelet type.MINIMUM=0.0compulsory keyword The minimum of the interval on which the basis functions are defined.MAXIMUM=4.0 ...compulsory keyword The maximum of the interval on which the basis functions are defined.
By omitting wavelets with only insignificant parts, we can reduce the number of basis functions. Using a threshold of 0.01 will in this example remove the 8 leftmost shifts, which we can check in the logfile.
bf: BF_WAVELETS ...ORDER=8compulsory keyword The order of the basis function expansion.TYPE=DAUBECHIEScompulsory keyword Specify the wavelet type.MINIMUM=0.0compulsory keyword The minimum of the interval on which the basis functions are defined.MAXIMUM=4.0compulsory keyword The maximum of the interval on which the basis functions are defined.TAILS_THRESHOLD=0.01 ...The threshold for cutting off tail wavelets as a fraction of the maximum value.
The length of the individual basis functions can also be adjusted to fit the specific problem. If for example the wavelets are instead scaled to length 3, there will be 35 basis functions, with leftmost points at \( -14*\frac{3}{15}, -13*\frac{3}{15}, \cdots, 0, \cdots, 18*\frac{3}{15}, 19*\frac{3}{15} \).
bf: BF_WAVELETS ...ORDER=8compulsory keyword The order of the basis function expansion.TYPE=DAUBECHIEScompulsory keyword Specify the wavelet type.MINIMUM=0.0compulsory keyword The minimum of the interval on which the basis functions are defined.MAXIMUM=4.0compulsory keyword The maximum of the interval on which the basis functions are defined.FUNCTION_LENGTH=3 ...The domain size of the individual basis functions.
Alternatively you can also specify the number of basis functions. Here we specify the usage of 40 Sym10 wavelet functions. We also used a custom minimum size for the grid and want it to be printed to a file with a specific numerical format.
bf: BF_WAVELETS ...ORDER=10compulsory keyword The order of the basis function expansion.TYPE=SYMLETScompulsory keyword Specify the wavelet type.MINIMUM=0.0compulsory keyword The minimum of the interval on which the basis functions are defined.MAXIMUM=4.0compulsory keyword The maximum of the interval on which the basis functions are defined.NUM_BF=40The number of basis functions that should be used.MIN_GRID_SIZE=500The minimal number of grid bins of the Wavelet function.DUMP_WAVELET_GRID( default=off ) If this flag is set the grid with the wavelet values will be written to a file.WAVELET_FILE_FMT=%11.4f ...The number format of the wavelet grid values and derivatives written to file.
ORDER | The order of the basis function expansion. |
MINIMUM | The minimum of the interval on which the basis functions are defined. |
MAXIMUM | The maximum of the interval on which the basis functions are defined. |
TYPE | Specify the wavelet type. Currently available are DAUBECHIES Wavelets with minimum phase and the more symmetric SYMLETS |
DEBUG_INFO | ( default=off ) Print out more detailed information about the basis set. Useful for debugging. |
MOTHER_WAVELET | ( default=off ) If this flag is set mother wavelets will be used instead of the scaling function (father wavelet). Makes only sense for multiresolution, which is at the moment not usable. |
DUMP_WAVELET_GRID | ( default=off ) If this flag is set the grid with the wavelet values will be written to a file. This file is called wavelet_grid.data. |
PERIODIC | ( default=off ) Use periodic version of basis set. |
FUNCTION_LENGTH | The domain size of the individual basis functions. (length) This is used to alter the scaling of the basis functions. By default it is set to the total size of the interval. This also influences the number of actually used basis functions, as all shifted functions that are partially supported in the CV space are used. |
NUM_BF | The number of basis functions that should be used. Includes the constant one and N-1 shifted wavelets within the specified range. Cannot be used together with FUNCTION_LENGTH. |
TAILS_THRESHOLD | The threshold for cutting off tail wavelets as a fraction of the maximum value. All shifted wavelet functions that only have values smaller than the threshold in the bias range will be excluded from the basis set. Defaults to 0 (include all). |
MIN_GRID_SIZE | The minimal number of grid bins of the Wavelet function. The true number depends also on the used wavelet type and will probably be larger. Defaults to 1000. |
WAVELET_FILE_FMT | The number format of the wavelet grid values and derivatives written to file. By default it is %15.8f. |