FOURIER_TRANSFORM
This is part of the fourier module
It is only available if you configure PLUMED with ./configure –enable-modules=fourier . Furthermore, this feature is still being developed so take care when using it and report any problems on the mailing list.

Compute the Discrete Fourier Transform (DFT) by means of FFTW of data stored on a 2D grid.

This action can operate on any other action that outputs scalar data on a two-dimensional grid.

Up to now, even if the input data are purely real the action uses a complex DFT.

Just as a quick reference, given a 1D array \(\mathbf{X}\) of size \(n\), this action computes the vector \(\mathbf{Y}\) given by

\[ Y_k = \sum_{j=0}^{n-1} X_j e^{2\pi\, j k \sqrt{-1}/n}. \]

This can be easily extended to more than one dimension. All the other details can be found at http://www.fftw.org/doc/What-FFTW-Really-Computes.html#What-FFTW-Really-Computes.

The keyword "FOURIER_PARAMETERS" deserves just a note on the usage. This keyword specifies how the Fourier transform will be normalized. The keyword takes two numerical parameters ( \(a,\,b\)) that define the normalization according to the following expression

\[ \frac{1}{n^{(1-a)/2}} \sum_{j=0}^{n-1} X_j e^{2\pi b\, j k \sqrt{-1}/n} \]

The default values of these parameters are: \(a=1\) and \(b=1\).

Examples

The following example tells Plumed to compute the complex 2D 'backward' Discrete Fourier Transform by taking the data saved on a grid called 'density', and normalizing the output by \( \frac{1}{\sqrt{N_x\, N_y}}\), where \(N_x\) and \(N_y\) are the number of data on the grid (it can be the case that \(N_x\neq N_y\)):

Click on the labels of the actions for more information on what each action computes
tested on master
FOURIER_TRANSFORM 
STRIDE
could not find this keyword
=1
GRID
could not find this keyword
=density
FT_TYPE
choose what kind of data you want as output on the grid.
=complex
FOURIER_PARAMETERS
compulsory keyword ( default=default ) what kind of normalization is applied to the output and if the Fourier transform in FORWARD or BACKWARD.
=0,-1
Glossary of keywords and components
Description of components

By default the value of the calculated quantity can be referenced elsewhere in the input file by using the label of the action. Alternatively this Action can be used to calculate the following quantities by employing the keywords listed below. These quantities can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the quantity required from the list below.

Quantity Keyword Description
real FT_TYPE the real part of the function
imag FT_TYPE the imaginary part of the function
Compulsory keywords
FOURIER_PARAMETERS ( default=default ) what kind of normalization is applied to the output and if the Fourier transform in FORWARD or BACKWARD. This keyword takes the form FOURIER_PARAMETERS=A,B, where A and B can be 0, 1 or -1. The default values are A=1 (no normalization at all) and B=1 (forward FFT). Other possible choices for A are: A=-1: normalize by the number of data, A=0: normalize by the square root of the number of data (one forward and followed by backward FFT recover the original data).
Options
SERIAL

( default=off ) do the calculation in serial. Do not parallelize

ARG the input for this action is the scalar output from one or more other actions. The particular scalars that you will use are referenced using the label of the action. If the label appears on its own then it is assumed that the Action calculates a single scalar value. The value of this scalar is thus used as the input to this new action. If * or *.* appears the scalars calculated by all the proceeding actions in the input file are taken. Some actions have multi-component outputs and each component of the output has a specific label. For example a DISTANCE action labelled dist may have three components x, y and z. To take just the x component you should use dist.x, if you wish to take all three components then use dist.*.More information on the referencing of Actions can be found in the section of the manual on the PLUMED Getting Started. Scalar values can also be referenced using POSIX regular expressions as detailed in the section on Regular Expressions. To use this feature you you must compile PLUMED with the appropriate flag.. You can use multiple instances of this keyword i.e. ARG1, ARG2, ARG3...
FT_TYPE choose what kind of data you want as output on the grid. Possible values are: ABS = compute the complex modulus of Fourier coefficients (DEFAULT); NORM = compute the norm (i.e. ABS^2) of Fourier coefficients; COMPLEX = store the FFTW complex output on the grid (as a vector).