Wrap-around errors: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(23 intermediate revisions by 5 users not shown)
Line 1: Line 1:
In this section we will discuss wrap around errors.
'''Wrap-around errors''' arise if the [[FFT meshes| Fast Fourier transformation (FFT) meshes]] are not
Wrap around errors arise if the FFT meshes are not
sufficiently large. It can be shown that no errors exist
sufficiently large. It can be shown that no errors exist
if the FFT meshes contain all $G$ vectors up to <math>2 G_{\rm cut}</math>.
if the [[FFT meshes]] contain all <math>\mathbf{G}</math> vectors up to <math>2 G_{\rm cut}</math>.
 
[[File:Wrap errors spheres.png|350px|thumb|Fig. 1: Sphere intersections for <math>G_{\mathrm{cut}}</math>]]


It can be shown that the charge density contains
It can be shown that the charge density contains
components up to <math>2 G_{\rm cut}</math>, where <math>2 G_{\rm cut}</math> is
components up to <math>2 G_{\mathrm{cut}}</math>, where <math>2 G_{\mathrm{cut}}</math> is
the "longest" plane wave in the basis set:
the "longest" plane wave in the basis set:


The wavefunction is defined as
The wavefunction is defined as


<math>
::<math>
  | \phi_{n\bold{k}} \rangle = \sum_G C_{Gn\bold{k}}  | \bold{k}+\bold{G}\rangle,
  | \phi_{n\mathbf{k}} \rangle = \sum_\mathbf{G} C_{\mathbf{G}n\mathbf{k}}  | \mathbf{k}+\mathbf{G}\rangle,
</math>
</math>


and in real space it is given by
and in real space it is given by


<math>
::<math>
  \langle \bold{r}| \phi_{n\bold{k}} \rangle = \sum_\bold{G}  \langle \bold{r}| \bold{k}+\bold{G}\rangle \langle \bold{k}+\bold{G}|\phi_{n\bold{k}} \rangle
  \langle \mathbf{r}| \phi_{n\mathbf{k}} \rangle = \sum_\mathbf{G}  \langle \mathbf{r}| \mathbf{k}+\mathbf{G}\rangle \langle \mathbf{k}+\mathbf{G}|\phi_{n\mathbf{k}} \rangle
     =  \frac{1}{\Omega^{1/2}} \sum_\bold{G} e^{i(\bold{k}+\bold{G})\bold{r}}  C_{\bold{G}n\bold{k}}.
     =  \frac{1}{\Omega^{1/2}} \sum_\mathbf{G} e^{i(\mathbf{k}+\mathbf{G})\mathbf{r}}  C_{\mathbf{G}n\mathbf{k}}.
</math>
</math>


Using Fast Fourier transformations one can define
Using FFTs one can define


<math>
::<math>
  C_\rnk= \sum_{\bG} C_\Gnk e^{i\bG \br} \hspace{2cm}
  C_{\mathbf{r}n\mathbf{k}}= \sum_{\mathbf{G}} C_{\mathbf{G}n\mathbf{k}} e^{i\mathbf{G} \mathbf{r}} \qquad \qquad \qquad
  C_\Gnk= \frac{1}{N_{\rm FFT}} \sum_{\br} C_\rnk e^{-i\bG \br}.
  C_{\mathbf{G}n\mathbf{k}}= \frac{1}{N_{\mathrm{FFT}}} \sum_{\mathbf{r}} C_{\mathbf{r}n\mathbf{k}} e^{-i\mathbf{G} \mathbf{r}}.
</math>
</math>


Therefore the wavefunction can be written in real space as
Therefore the wavefunction can be written in real space as


<math>
::<math>
  \langle\br| \phi_\nk \rangle = \phi_\nk(r) = \frac{1}{\Omega^{1/2}} C_\rnk e^{i\bk\br}.
  \langle\mathbf{r}| \phi_{n\mathbf{k}} \rangle = \phi_{n\mathbf{k}}(r) = \frac{1}{\Omega^{1/2}} C_{\mathbf{r}n\mathbf{k}} e^{i\mathbf{k}\mathbf{r}}.
</math>
</math>


The charge density is simply given by
The charge density is simply given by


<math>
::<math>
  \rhops_\br \equiv \langle\br | \rhops| \br\rangle =
  \rho^{\mathrm{ps}}_{\mathbf{r}} \equiv \langle \mathbf{r} |\rho^{\mathrm{ps}} | \mathbf{r} \rangle =
  \sum_\bk w_\bk \sum_n f_\nk \phi_\nk(r) \phi^*_\nk(r) ,
  \sum_\mathbf{k} w_{\mathbf{k}} \sum_n f_{n\mathbf{k}} \phi_{n\mathbf{k}}(r) \phi^{*}_{n\mathbf{k}}(r) ,
</math>
</math>


and in the reciprocal mesh it can be written as
and in the reciprocal mesh it can be written as


<math>
::<math>
  \rhops_\bG \equiv
  \rho^{\mathrm{ps}}_\mathbf{G} \equiv
     \frac{1}{\Omega} \int \langle\br | \rhops| \br\rangle e^{-i \bG\br}\, d \br \to \frac{1}{N_{\rm FFT}} \sum_{\br} \rhops_\br e^{-i \bG\br}.
     \frac{1}{\Omega} \int \langle\mathbf{r} | \rho^{\mathrm{ps}}| \mathbf{r}\rangle e^{-i \mathbf{G}\mathbf{r}}\, d \mathbf{r} \to \frac{1}{N_{\mathrm{FFT}}} \sum_{\mathbf{r}} \rho^{\mathrm{ps}}_{\mathbf{r}} e^{-i \mathbf{G}\mathbf{r}}.
</math>
</math>


{{template:NumBlk}}
Using the above equations for <math>\rho^{\mathrm{ps}}_{\mathbf{r}}</math> and <math>C_{\mathbf{r}n\mathbf{k}}</math> it
 
is very  easy to show that <math>\rho^{\mathrm{ps}}_{\mathbf{r}}</math> contains Fourier-components up
Inserting <math>\rhops</math> from equation (\ref{rps}) and $ C_\rnk$ from (\ref{pl2}) it
to <math>2 G_{\mathrm{cut}}</math>.
is very  easy to show that $\rhops_\br $ contains Fourier-components up
to $2 G_{\rm cut}$.


Generally it can be shown that
Generally it can be shown that
a the convolution $f_r=f^1_r f^2_r$
a the convolution <math>f_r=f^1_r f^2_r</math>
of two 'functions' $f^1_r$ with  Fourier-components
of two functions <math>f^1_r</math> with  Fourier-components
up to $G_1$ and $f^2_r$ with Fourier-components
up to <math>G_1</math> and <math>f^2_r</math> with Fourier-components
up to $G_2$ contains Fourier-components up to  $G_1+G_2$.
up to <math>G_2</math> contains Fourier-components up to  <math>G_1+G_2</math>.


The property of the convolution comes once again into play,
The property of the convolution comes once again into play,
when the action of the Hamiltonian onto a wavefunction is
when the action of the Hamiltonian onto a wavefunction is
calculated. The action of the local-potential is given by
calculated. The action of the local-potential is given by
\[
a_\br =  V_\br  C_\rnk
\]
Only the components $a_\bG$ with $|\bG| < G_{\rm cut}$ are taken into
account (see section \ref{algo}: $a_\bG$ is added to the wavefunction
during the iterative refinement of the wavefunctions $C_\Gnk$,
and  $C_\Gnk$ contains only components up to  $G_{\rm cut}$).
From the previous theorem we see that $a_\br$ contains
components up to $3 G_{\rm cut}$ ($V_\br$ contains components up to


$2 G_{\rm cut}$).
::<math>
\begin{figure} \unitlength1cm
a_{\mathbf{r}} =  V_{\mathbf{r}}  C_{\mathbf{r}n\mathbf{k}}.  
\epsffile{algo1.eps}
</math>
\caption{ \label{algo-fig1}
 
The small sphere contains all plane waves included in the basis set $G<G_{\rm cut}$.
Only the components <math>a_{\mathbf{G}}</math> with <math>|\mathbf{G}| < G_{\mathrm{cut}}</math> are taken into
The charge density contains components up to $2 G_{\rm cut}$ (second sphere), and
account (see section {{TAG|ALGO}}: <math>a_{\mathbf{G}}</math> is added to the wavefunction
the acceleration $a$ components up to $3 G_{\rm cut}$, which are reflected
during the iterative refinement of the wavefunctions <math>C_{\mathbf{G}n\mathbf{k}}</math>,
in (third sphere) because of the finite size of the FFT-mesh. Nevertheless
and <math>C_{\mathbf{G}n\mathbf{k}}</math> contains only components up to <math>G_{\mathrm{cut}}</math>).
the components $a_\bG$ with $| \bG| < G_{\rm cut}$ are correct i.e.
From the previous theorem we see that <math>a_{\mathbf{r}}</math> contains
the small sphere does not intersect with the third large sphere
components up to <math>3 G_{\mathrm{cut}}</math> (<math>V_{\mathbf{r}}</math> contains components up to
}
<math>2 G_{\mathrm{cut}}</math>).
\end{figure}
 
If the FFT-mesh contains all components up to  $2 G_{\rm cut}$
If the FFT mesh contains all components up to  <math>2 G_{\mathrm cut}</math>
the resulting wrap-around error is once again 0. This can
the resulting wrap-around error is once again 0. This can
be easily seen in Fig. \ref{algo-fig1}.
be easily seen in Fig. 1. Here we see that the small sphere contains all plane waves included in the basis set  <math>G<G_{\mathrm{cut}}</math>.
The charge density contains components up to  <math>2 G_{\mathrm{cut}}</math> (second sphere), and
the acceleration <math>a</math> components up to <math>3 G_{\mathrm{cut}}</math>, which are reflected
in (third sphere) because of the finite size of the FFT mesh. Nevertheless
the components <math>a_{\mathbf{G}}</math> with <math>| \mathbf{G}| < G_{\mathrm{cut}}</math> are correct i.e.
the small sphere does not intersect with the third large sphere}
 
== Related tags and articles ==
{{TAG|PREC}},
{{TAG|ENCUT}},
{{TAG|NGX}},
{{TAG|NGY}},
{{TAG|NGZ}}
 
[[Energy cutoff and FFT meshes]]
 


----
[[Category:Electronic minimization]][[Category:Charge density]][[Category:Theory]]
[[Category:Electronic Minimization]][[Category:Electronic Minimization Methods]][[Category:Charge Density]][[Category:Theory]]

Latest revision as of 09:00, 24 October 2025

Wrap-around errors arise if the Fast Fourier transformation (FFT) meshes are not sufficiently large. It can be shown that no errors exist if the FFT meshes contain all [math]\displaystyle{ \mathbf{G} }[/math] vectors up to [math]\displaystyle{ 2 G_{\rm cut} }[/math].

Fig. 1: Sphere intersections for [math]\displaystyle{ G_{\mathrm{cut}} }[/math]

It can be shown that the charge density contains components up to [math]\displaystyle{ 2 G_{\mathrm{cut}} }[/math], where [math]\displaystyle{ 2 G_{\mathrm{cut}} }[/math] is the "longest" plane wave in the basis set:

The wavefunction is defined as

[math]\displaystyle{ | \phi_{n\mathbf{k}} \rangle = \sum_\mathbf{G} C_{\mathbf{G}n\mathbf{k}} | \mathbf{k}+\mathbf{G}\rangle, }[/math]

and in real space it is given by

[math]\displaystyle{ \langle \mathbf{r}| \phi_{n\mathbf{k}} \rangle = \sum_\mathbf{G} \langle \mathbf{r}| \mathbf{k}+\mathbf{G}\rangle \langle \mathbf{k}+\mathbf{G}|\phi_{n\mathbf{k}} \rangle = \frac{1}{\Omega^{1/2}} \sum_\mathbf{G} e^{i(\mathbf{k}+\mathbf{G})\mathbf{r}} C_{\mathbf{G}n\mathbf{k}}. }[/math]

Using FFTs one can define

[math]\displaystyle{ C_{\mathbf{r}n\mathbf{k}}= \sum_{\mathbf{G}} C_{\mathbf{G}n\mathbf{k}} e^{i\mathbf{G} \mathbf{r}} \qquad \qquad \qquad C_{\mathbf{G}n\mathbf{k}}= \frac{1}{N_{\mathrm{FFT}}} \sum_{\mathbf{r}} C_{\mathbf{r}n\mathbf{k}} e^{-i\mathbf{G} \mathbf{r}}. }[/math]

Therefore the wavefunction can be written in real space as

[math]\displaystyle{ \langle\mathbf{r}| \phi_{n\mathbf{k}} \rangle = \phi_{n\mathbf{k}}(r) = \frac{1}{\Omega^{1/2}} C_{\mathbf{r}n\mathbf{k}} e^{i\mathbf{k}\mathbf{r}}. }[/math]

The charge density is simply given by

[math]\displaystyle{ \rho^{\mathrm{ps}}_{\mathbf{r}} \equiv \langle \mathbf{r} |\rho^{\mathrm{ps}} | \mathbf{r} \rangle = \sum_\mathbf{k} w_{\mathbf{k}} \sum_n f_{n\mathbf{k}} \phi_{n\mathbf{k}}(r) \phi^{*}_{n\mathbf{k}}(r) , }[/math]

and in the reciprocal mesh it can be written as

[math]\displaystyle{ \rho^{\mathrm{ps}}_\mathbf{G} \equiv \frac{1}{\Omega} \int \langle\mathbf{r} | \rho^{\mathrm{ps}}| \mathbf{r}\rangle e^{-i \mathbf{G}\mathbf{r}}\, d \mathbf{r} \to \frac{1}{N_{\mathrm{FFT}}} \sum_{\mathbf{r}} \rho^{\mathrm{ps}}_{\mathbf{r}} e^{-i \mathbf{G}\mathbf{r}}. }[/math]

Using the above equations for [math]\displaystyle{ \rho^{\mathrm{ps}}_{\mathbf{r}} }[/math] and [math]\displaystyle{ C_{\mathbf{r}n\mathbf{k}} }[/math] it is very easy to show that [math]\displaystyle{ \rho^{\mathrm{ps}}_{\mathbf{r}} }[/math] contains Fourier-components up to [math]\displaystyle{ 2 G_{\mathrm{cut}} }[/math].

Generally it can be shown that a the convolution [math]\displaystyle{ f_r=f^1_r f^2_r }[/math] of two functions [math]\displaystyle{ f^1_r }[/math] with Fourier-components up to [math]\displaystyle{ G_1 }[/math] and [math]\displaystyle{ f^2_r }[/math] with Fourier-components up to [math]\displaystyle{ G_2 }[/math] contains Fourier-components up to [math]\displaystyle{ G_1+G_2 }[/math].

The property of the convolution comes once again into play, when the action of the Hamiltonian onto a wavefunction is calculated. The action of the local-potential is given by

[math]\displaystyle{ a_{\mathbf{r}} = V_{\mathbf{r}} C_{\mathbf{r}n\mathbf{k}}. }[/math]

Only the components [math]\displaystyle{ a_{\mathbf{G}} }[/math] with [math]\displaystyle{ |\mathbf{G}| \lt G_{\mathrm{cut}} }[/math] are taken into account (see section ALGO: [math]\displaystyle{ a_{\mathbf{G}} }[/math] is added to the wavefunction during the iterative refinement of the wavefunctions [math]\displaystyle{ C_{\mathbf{G}n\mathbf{k}} }[/math], and [math]\displaystyle{ C_{\mathbf{G}n\mathbf{k}} }[/math] contains only components up to [math]\displaystyle{ G_{\mathrm{cut}} }[/math]). From the previous theorem we see that [math]\displaystyle{ a_{\mathbf{r}} }[/math] contains components up to [math]\displaystyle{ 3 G_{\mathrm{cut}} }[/math] ([math]\displaystyle{ V_{\mathbf{r}} }[/math] contains components up to [math]\displaystyle{ 2 G_{\mathrm{cut}} }[/math]).

If the FFT mesh contains all components up to [math]\displaystyle{ 2 G_{\mathrm cut} }[/math] the resulting wrap-around error is once again 0. This can be easily seen in Fig. 1. Here we see that the small sphere contains all plane waves included in the basis set [math]\displaystyle{ G\lt G_{\mathrm{cut}} }[/math]. The charge density contains components up to [math]\displaystyle{ 2 G_{\mathrm{cut}} }[/math] (second sphere), and the acceleration [math]\displaystyle{ a }[/math] components up to [math]\displaystyle{ 3 G_{\mathrm{cut}} }[/math], which are reflected in (third sphere) because of the finite size of the FFT mesh. Nevertheless the components [math]\displaystyle{ a_{\mathbf{G}} }[/math] with [math]\displaystyle{ | \mathbf{G}| \lt G_{\mathrm{cut}} }[/math] are correct i.e. the small sphere does not intersect with the third large sphere}

Related tags and articles

PREC, ENCUT, NGX, NGY, NGZ

Energy cutoff and FFT meshes