← Go back to the interactive notebook
Background Theory: Fourier Transforms and Plane-Wave Expansions
Original notebook: theory_fft.ipynb
Introduction
Density functional theory (DFT) calculations rely on solving the Kohn-Sham equations self-consistently. The wavefunction of the system can be represented in multiple basis sets. For material systems with periodic boundary conditions, a plane-wave basis set is frequently chosen, due to its periodic nature and numerical efficiency as discussed below. This strategy is adopted by many popular DFT packages in solid-state physics, including e.g. ABINIT, CASTEP, Quantum ESPRESSO, and VASP.
Plane-wave expansion
The general form of a plane wave is:
The name “plane wave” originates from the fact that the wavefront (where the wave assumes the same value) is a plane perpendicular to the propagation direction .
In solid-state physics, where one typically studies periodic crystalline solids, Bloch’s theorem tells us that any wavefunction can be written as , where is a function with the same periodicity of the system.
Since this function is periodic, we can then use a plane-wave basis set to represent :
where the sum is over all reciprocal lattice vectors . Similarly, the charge density (that also has the periodicity of the system) is represented in a plane-wave basis set.
The main advantage of this basis set is the possibility to use fast Fourier transform (FFT) algorithms to convert between the reciprocal-space representation (the coefficient of the plane waves) and the real-space representation of the wavefunctions on a grid. This is appealing because the operation of the potential on is very simple in real space (since for local potentials it is simply an element-wise multiplication), while it is very efficient to compute the operation of the kinetic operator in reciprocal space, where the second derivative also becomes simply an element-wise multiplication. One can then pass between the two representations using FFTs, when needed.
Since the number of plane waves (or, equivalently, of vectors) determines the size of the numerical problem to solve, it is important to find a balance between using enough plane waves to accurately represent the plane waves, but at the same time not too many, to avoid to make an overly expensive calculation. This notebook helps in visualizing the effect of the basis set size on the functions that we want to represent.
Fourier series and Fast fourier transform
In real space, a Fourier series is a linear combination of cosine and sine functions used to represent a smooth periodic function defined in a certain range. For a one dimensional function defined on , the Fourier series is given by:
where one can prove that the coefficients are given by:
and
Note that you can interpret the Fourier coefficients as the inner product of and a (normalized) cosine or sine function. Geometrically, this can be interpreted as the projection of the function onto a unit basis vector of the Hilbert space spanned by the cosine and sine functions. Thus, the Fourier series is essentially the representation of a function using an infinite basis set composed of trigonometric functions.
In complex space, a Fourier series shares the same form as a plane-wave expansion:
Note that, for both the real and complex case, the basis set is composed of trigonometric functions with increasing frequencies, all multiples of the base frequency, determined by the periodicity in real space.
If all frequencies are considered, under appropriate conditions the representation is exact. However, in practical simulations one always considers a finite number of basis vectors:
where is the th sampling of the objective function and is the set of Fourier coefficients, with which the original function can be constructed by inverse Fourier transform
A naive implementation of a Discrete Fourier Transform would require operations to compute. This becomes clear if we express equation (1) in matrix form:
where as the unit frequency component. The Fast Fourier transform (FFT) algorithm, instead, allows us to find with only complexity, making it applicable to large systems. One of the most common FFT is Cooley-Tukey method [Math. Comp. 19, 297–301 (1965)], which uses a divide-and-conquer approach by recursively breaking down the matrix multiplication into two smaller parts. This method is used in many computational tools including the ones that support this notebook.