events:2016_summer_school:gpw
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
events:2016_summer_school:gpw [2016/08/23 20:29] – mwatkins | events:2016_summer_school:gpw [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
# heavily lifted from Marcella Iannuzzi' | # heavily lifted from Marcella Iannuzzi' | ||
# https:// | # https:// | ||
+ | # | ||
+ | # Matt Watkins | ||
+ | # School of Mathematics and Physics, University of Lincoln, UK | ||
+ | |||
</ | </ | ||
===== GPW (GAPW) electronic structure calculations ===== | ===== GPW (GAPW) electronic structure calculations ===== | ||
- | Matt Watkins | ||
- | School of Mathematics and Physics, University of Lincoln, UK | ||
http:// | http:// | ||
Line 21: | Line 23: | ||
* many observables available (spectroscopy) | * many observables available (spectroscopy) | ||
* cheaper (better scaling) than many wavefunction based approaches | * cheaper (better scaling) than many wavefunction based approaches | ||
- | * *ab initio* molecular dynamics / Monte Carlo | + | * //ab initio// molecular dynamics / Monte Carlo |
- | === Hohenberg-Kohn Theorems === | + | ==== Hohenberg-Kohn Theorems |
**Theorem 1** | **Theorem 1** | ||
Line 45: | Line 47: | ||
* $E_{xc}$ - non-classical Coulomb energy: electron correlation | * $E_{xc}$ - non-classical Coulomb energy: electron correlation | ||
- | {{https:// | + | ==== Kohn-Sham: non-interacting electrons |
- | [[https:// | + | |
- | {{http:// | + | |
- | Pierre Hohenberg | + | |
- | + | ||
- | === Kohn-Sham: non-interacting electrons === | + | |
We map the problem of interacting electrons onto an equivalent one with non-interacting electrons with an altered external potential (xc). | We map the problem of interacting electrons onto an equivalent one with non-interacting electrons with an altered external potential (xc). | ||
- | We expand the *density* as a sum of one electron orbital contributions | + | We expand the //density// as a sum of one electron orbital contributions |
=== Electronic density === | === Electronic density === | ||
Line 82: | Line 79: | ||
\Psi = \frac{1}{\sqrt{N!}} \text{det} [\psi_1 \psi_2 \psi_3 \cdots \psi_N] | \Psi = \frac{1}{\sqrt{N!}} \text{det} [\psi_1 \psi_2 \psi_3 \cdots \psi_N] | ||
$$ | $$ | ||
- | {{https:// | + | ==== KS equations ==== |
- | [[https:// | + | Using the 2nd Hohenberg-Kohn theorem, we find the electron density that minimises the energy of the system. |
- | === KS equations === | + | But, like in Hartree-Fock theory, we have to ensure that the electron orbitals are orthonormal to prevent the system imploding. |
- | Using the 2nd Hohenberg-Kohn theorem, we find the electron density that minimises the energy of the system. But, like in Hartree-Fock theory, we have to ensure that the electron orbitals are orthonormal to prevent the system imploding. | + | === Orthogonality constraint |
- | + | ||
- | **Orthogonality constraint** | + | |
$$ | $$ | ||
Line 96: | Line 91: | ||
$$ | $$ | ||
- | **Variational search in the space of the orbitals** | + | === Variational search in the space of the orbitals |
- | | + | |
- | We correct the non-interacting electron model by adding in an (in principle unknown) XC potential that accounts for *all* quantum mechanical many-body interactions (electron-electron repulsion) | + | We correct the non-interacting electron model by adding in an (in principle unknown) XC potential that accounts for **all** quantum mechanical many-body interactions (electron-electron repulsion) |
- | **Classical election-electron repulsion** | + | === Classical election-electron repulsion |
$$ | $$ | ||
Line 108: | Line 102: | ||
$$ | $$ | ||
- | **Kohn-Sham functional** | + | === Kohn-Sham functional |
$$ | $$ | ||
Line 118: | Line 112: | ||
$$ | $$ | ||
- | The exact functional form for the electron-electron repulsion is not known, but various levels of approximation are available (Jacob' | + | The exact functional form for the electron-electron repulsion is not known, but various levels of approximation are available (Jacob' |
- | dder). The existence of this functional is guarenteed | + | |
+ | The existence of this functional is guaranteed | ||
This maps mathematically onto the familiar Hartree-Fock model of electronic structure. | This maps mathematically onto the familiar Hartree-Fock model of electronic structure. | ||
- | === KS equations === | + | ==== KS equations |
$$ | $$ | ||
Line 139: | Line 134: | ||
- KS scheme is, in principle, exact (if we knew the exact $E_{XC}$) | - KS scheme is, in principle, exact (if we knew the exact $E_{XC}$) | ||
- | === Self-consistency === | + | ==== Self-consistency |
- | '' | + | //generate an initial guess, from a superposition of atomic densities (typical PW code) or atomic block diagonal density matrix (CP2K)// |
- | - generate a starting density $\Rightarrow n^{init}$ | + | - generate a starting density $\Rightarrow n^{0}$ |
- | - generate the KS potential | + | - generate the KS potential |
- solve the KS equations | - solve the KS equations | ||
- | + | //then repeat until convergence// | |
- | '' | + | |
- calculate the new density $\Rightarrow n^{1}$ | - calculate the new density $\Rightarrow n^{1}$ | ||
Line 155: | Line 149: | ||
- | '' | + | //calculate properties from final density and orbitals// |
Stopping criteria in CP2K are: | Stopping criteria in CP2K are: | ||
+ | |||
* the largest MO derivative ($\frac{\partial E}{\partial C_{ \alpha i}} $) is smaller than `EPS_SCF` (OT) | * the largest MO derivative ($\frac{\partial E}{\partial C_{ \alpha i}} $) is smaller than `EPS_SCF` (OT) | ||
* the largest change in the density matrix ($P$) is smaller than `EPS_SCF` (traditional diagonalization). | * the largest change in the density matrix ($P$) is smaller than `EPS_SCF` (traditional diagonalization). | ||
- | === Basis Set Representation(s) === | + | ==== Basis Set Representation(s) |
- | to actually do calculations we need to expand the KS equations into a basis. In CP2K we use Gaussian functions, as the primary basis set: | + | to actually do calculations we need to expand the KS equations into a basis. In CP2K we use Gaussian functions as the primary basis set: |
the KS orbitals are then represented as | the KS orbitals are then represented as | ||
Line 202: | Line 197: | ||
Where $E[\{\psi_i\}; | Where $E[\{\psi_i\}; | ||
- | **Matrix formulation of the KS equations** | + | ==== Matrix formulation of the KS equations |
using the variational principle we get | using the variational principle we get | ||
Line 210: | Line 205: | ||
$$ | $$ | ||
- | === Algorithmic challenges === | + | ==== Algorithmic challenges |
* construct the Kohn-Sham matrix | * construct the Kohn-Sham matrix | ||
Line 245: | Line 240: | ||
This leads to linear scaling KS construction for Gaussian Type Orbitals (GTO) | This leads to linear scaling KS construction for Gaussian Type Orbitals (GTO) | ||
- | * Guassian basis sets (many matrix elements can be done analytically) | + | ==== Guassian basis sets (many matrix elements can be done analytically) |
we go a bit further than implied above - to be more accurate, we *contract* several Gaussians to form approximate atomic orbitals | we go a bit further than implied above - to be more accurate, we *contract* several Gaussians to form approximate atomic orbitals | ||
$$ | $$ | ||
Line 255: | Line 251: | ||
$$ | $$ | ||
and $m_x + m_y + m_z = l$, the angular momentum quantum number of the functions. | and $m_x + m_y + m_z = l$, the angular momentum quantum number of the functions. | ||
+ | |||
* Pseudo potentials | * Pseudo potentials | ||
* Plane waves auxiliary basis for Coulomb integrals | * Plane waves auxiliary basis for Coulomb integrals | ||
Line 280: | Line 277: | ||
$$ | $$ | ||
- | === Data files === | + | ==== Data files ==== |
Parameter files distributed with CP2K in $CP2K_ROOT/ | Parameter files distributed with CP2K in $CP2K_ROOT/ | ||
Line 299: | Line 296: | ||
* non-local dispersion functionals `vdW_kernel_table.dat, | * non-local dispersion functionals `vdW_kernel_table.dat, | ||
- | === Basis set libraries === | + | ==== Basis set libraries |
There are two main types of basis sets supplied with CP2K | There are two main types of basis sets supplied with CP2K | ||
Line 328: | Line 325: | ||
</ | </ | ||
- | Here there are gaussians | + | Here there are Gaussians |
Note that the contraction coefficients are not varied during calculation. For the nitrogen basis above we have $2 + 2 \times 3 + 1 \times 5 = 13$ variables to optimize for each nitrogen atom in the system. | Note that the contraction coefficients are not varied during calculation. For the nitrogen basis above we have $2 + 2 \times 3 + 1 \times 5 = 13$ variables to optimize for each nitrogen atom in the system. | ||
Line 335: | Line 332: | ||
- | === GTH pseudopotentials === | + | ==== GTH pseudopotentials |
Accurate and transferable with few parameters. | Accurate and transferable with few parameters. | ||
Line 343: | Line 340: | ||
* Norm-conserving, | * Norm-conserving, | ||
* Local PP : short-range and long-range terms | * Local PP : short-range and long-range terms | ||
+ | |||
$$ | $$ | ||
V_{loc}^{PP}(r) = \sum_{i=1}^4 C_i^{PP} (\sqrt{2} \alpha^{PP} r)^{2i-2}e^{-(\alpha^{PP}r)^2} - \frac{Z_{ion}}{r}erf(\alpha^{PP}r) | V_{loc}^{PP}(r) = \sum_{i=1}^4 C_i^{PP} (\sqrt{2} \alpha^{PP} r)^{2i-2}e^{-(\alpha^{PP}r)^2} - \frac{Z_{ion}}{r}erf(\alpha^{PP}r) | ||
$$ | $$ | ||
+ | |||
first term in sum is short ranged, and analytically calculated in Gaussian basis. Second term is long ranged, and merged into the electrostatic calculation (see later) | first term in sum is short ranged, and analytically calculated in Gaussian basis. Second term is long ranged, and merged into the electrostatic calculation (see later) | ||
* non-local PP with Gaussian type operators | * non-local PP with Gaussian type operators | ||
+ | |||
$$ | $$ | ||
V_{nl}^{PP}(\mathbf{r}, | V_{nl}^{PP}(\mathbf{r}, | ||
\big{<} p_j^{lm} \mid \mathbf{r' | \big{<} p_j^{lm} \mid \mathbf{r' | ||
$$ | $$ | ||
+ | |||
$$ | $$ | ||
\big{<} \mathbf{r} \mid p_i^{lm} \big{>} = N_i^l Y^{lm}(\hat{r})r^{l+2i-2}e^{-\frac{1}{2}(\frac{r}{r_l})^2} | \big{<} \mathbf{r} \mid p_i^{lm} \big{>} = N_i^l Y^{lm}(\hat{r})r^{l+2i-2}e^{-\frac{1}{2}(\frac{r}{r_l})^2} | ||
$$ | $$ | ||
- | You can scan through potentials available at [[http://cp2k.web.psi.ch/ | + | You can scan through potentials available at [[https://www.cp2k.org/static/ |
Original papers: | Original papers: | ||
- | [[Goedeker, Teter, Hutter, PRB 54 (1996), 1703]http:// | + | [[https:// |
- | [[Hartwigsen, Goedeker, Hutter, PRB 58 (1998) 3641]http:// | + | [[https:// |
- | === Electrostatics === | + | ==== Electrostatics |
* long-range term: Non-local Hartree Potential | * long-range term: Non-local Hartree Potential | ||
+ | |||
Poisson equation solved using the auxiliary plane-wave basis | Poisson equation solved using the auxiliary plane-wave basis | ||
$$ | $$ | ||
E_H[n_{tot}] = \frac{1}{2} \int_r \text{d}\mathbf{r} \int_{r' | E_H[n_{tot}] = \frac{1}{2} \int_r \text{d}\mathbf{r} \int_{r' | ||
$$ | $$ | ||
+ | |||
where $n_{tot}$ includes the nuclear charge as well as the electronic. | where $n_{tot}$ includes the nuclear charge as well as the electronic. | ||
(The nuclear charge density is (of course) represented as a Gaussian distribution with parameter $R_I^c$ chosen to cancel a similar term from the local part of the pseudopotential) | (The nuclear charge density is (of course) represented as a Gaussian distribution with parameter $R_I^c$ chosen to cancel a similar term from the local part of the pseudopotential) | ||
Line 375: | Line 378: | ||
* FFT (scaling as $N\text{log}N$) gives | * FFT (scaling as $N\text{log}N$) gives | ||
$$\tilde{n}(\mathbf{r}) = \frac{1}{\Omega} \sum_G \tilde{n}(\mathbf{G})e^{i\mathbf{G \cdot r}})$$ | $$\tilde{n}(\mathbf{r}) = \frac{1}{\Omega} \sum_G \tilde{n}(\mathbf{G})e^{i\mathbf{G \cdot r}})$$ | ||
+ | |||
In the $G$ space representation the Poisson equation is diagonal and the Hartree energy is easily evaluated | In the $G$ space representation the Poisson equation is diagonal and the Hartree energy is easily evaluated | ||
+ | |||
$$ | $$ | ||
E_H[n_{tot}] = 2 \pi \Omega \sum_G | E_H[n_{tot}] = 2 \pi \Omega \sum_G | ||
Line 383: | Line 388: | ||
{{http:// | {{http:// | ||
- | === Real space integration === | + | ==== Real space integration |
Finite cutoff and simulation box define a realspace grid | Finite cutoff and simulation box define a realspace grid | ||
Line 393: | Line 398: | ||
\sum_{\alpha \beta} P_{\alpha \beta} \bar{\phi}_{\alpha \beta} (\mathbf{r}) = n(\mathbf{R}) | \sum_{\alpha \beta} P_{\alpha \beta} \bar{\phi}_{\alpha \beta} (\mathbf{r}) = n(\mathbf{R}) | ||
$$ | $$ | ||
- | where $n(\mathbf{R})$ is the density at grid points in the cell, and $\bar{\phi}_{\alpha \beta}$ are the products of two basis functions | + | where $n(\mathbf{R})$ is the density at grid points in the cell, and $\bar{\phi}_{\alpha \beta}$ are the products of two basis functions. |
- | {{materials/ | + | |
* numerical approximation of the gradient $n(\mathbf{R}) \rightarrow \nabla n(\mathbf{R})$ | * numerical approximation of the gradient $n(\mathbf{R}) \rightarrow \nabla n(\mathbf{R})$ | ||
Line 421: | Line 425: | ||
We see that 11.9999999997 electrons are mapped onto the grids, along with 11.9999999994 nuclear charge. You should aim for at a very minimum accuracy of 10−8. If not, increase the cutoff. | We see that 11.9999999997 electrons are mapped onto the grids, along with 11.9999999994 nuclear charge. You should aim for at a very minimum accuracy of 10−8. If not, increase the cutoff. | ||
- | === Energy ripples === | + | ==== Energy ripples |
Low density regions can cause unphysical behaviour of $XC$ terms (such as $\frac{\mid \nabla n \mid ^2}{n^{\alpha}}$) | Low density regions can cause unphysical behaviour of $XC$ terms (such as $\frac{\mid \nabla n \mid ^2}{n^{\alpha}}$) | ||
Line 427: | Line 431: | ||
{{http:// | {{http:// | ||
- | GTH pseudos have small density at the core - graph of density and $v_{XC}$ through a water molecule. These spikes can cause ripples in the energy as atoms move relative to the grid. | + | GTH pseudos have small density at the core - graph of density and $v_{XC}$ through a water molecule. These spikes can cause ripples in the energy as atoms move relative to the grid. These can be very problematic when trying to calculate vibrational frequencies. |
- | There are smoothing routines `& | + | |
+ | There are smoothing routines `& | ||
{{http:// | {{http:// | ||
- | avoid with higher cutoff, or GAPW methodology. | + | Avoid ripples |
- | These can be very problematic when trying | + | Whatever you do don't change settings between simulations you want to compare. |
- | === Multigrids === | + | |
+ | ==== Multigrids | ||
When we want to put (collocate) a Gaussian type function onto the realspace grid, we can gain efficiency by using multiple grids with differing cutoff / spacing. | When we want to put (collocate) a Gaussian type function onto the realspace grid, we can gain efficiency by using multiple grids with differing cutoff / spacing. | ||
Line 447: | Line 453: | ||
specified in input as: | specified in input as: | ||
+ | < | ||
&MGRID | &MGRID | ||
CUTOFF 400 | CUTOFF 400 | ||
Line 453: | Line 459: | ||
NGRIDS 5 | NGRIDS 5 | ||
&END MGRID | &END MGRID | ||
+ | </ | ||
you can see in the output | you can see in the output | ||
Line 470: | Line 477: | ||
For this system (formaldeyhde with an aug-TZV2P-GTH basis) that 45436 density matrix elements ($\bar{\phi}_{\alpha \beta}$) were mapped onto the grids. To be efficient, all grids should be used. | For this system (formaldeyhde with an aug-TZV2P-GTH basis) that 45436 density matrix elements ($\bar{\phi}_{\alpha \beta}$) were mapped onto the grids. To be efficient, all grids should be used. | ||
- | To fully converge calculations both '' | + | To fully converge calculations both '' |
+ | |||
+ | ==== Timings ==== | ||
At the end of the run you'll see timings - these can be very useful for understanding performance. | At the end of the run you'll see timings - these can be very useful for understanding performance. | ||
Line 522: | Line 531: | ||
| | ||
</ | </ | ||
+ | |||
+ | ==== Warnings ==== | ||
Also check if you get an output like | Also check if you get an output like |
events/2016_summer_school/gpw.1471984188.txt.gz · Last modified: 2020/08/21 10:14 (external edit)