howto:static_calculation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
static_calculation [2014/01/27 10:41] – [Introduction] 92.30.13.71 | howto:static_calculation [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | ===== Introduction ===== | ||
In this tutorial, we are going to show the reader how to perform a | In this tutorial, we are going to show the reader how to perform a | ||
simple static self-consistent Kohn-Sham Density Functional Theory | simple static self-consistent Kohn-Sham Density Functional Theory | ||
- | energy and force calculation on a system using '' | + | energy and force calculation on a system using '' |
We will use face centred cubic bulk Si, with 8 atoms in a cubic unit | We will use face centred cubic bulk Si, with 8 atoms in a cubic unit | ||
- | cell as an example. The example files are contained in | + | cell as an example. The example files are contained in {{:static_calculation.tgz|static_calculation.tgz}}. The calculations were carried out with |
- | '' | + | '' |
- | '' | + | |
The reader should note that the integration grid settings used in | The reader should note that the integration grid settings used in | ||
Line 15: | Line 15: | ||
achieve this. | achieve this. | ||
- | ====== Input Files ====== | ||
+ | ===== Input Files ===== | ||
We first look at the input files required for this calculation. The | We first look at the input files required for this calculation. The | ||
necessary input files are: | necessary input files are: | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
A list of basis set and pseudopotential files may be found in | A list of basis set and pseudopotential files may be found in | ||
- | '' | + | '' |
should cover most of the commonly used elements. The user will, | should cover most of the commonly used elements. The user will, | ||
however, need to produce their own main input file for a given | however, need to produce their own main input file for a given | ||
calculation. | calculation. | ||
- | Let us look at the main input: '' | + | Let us look at the main input: '' |
this file can be arbitrary, so is the file extension. The input file | this file can be arbitrary, so is the file extension. The input file | ||
is structured into ordered blocks and keywords, the order of which | is structured into ordered blocks and keywords, the order of which | ||
Line 36: | Line 36: | ||
this tutorial, and some sections are " | this tutorial, and some sections are " | ||
sections. Full definitions of the input file format and keywords is | sections. Full definitions of the input file format and keywords is | ||
- | available via the [[http:// | + | available via the [[http:// |
The input file is shown below: | The input file is shown below: | ||
Line 104: | Line 104: | ||
&END PRINT | &END PRINT | ||
&END FORCE_EVAL | &END FORCE_EVAL | ||
- | </ | + | </ |
The main sections in the input file are: | The main sections in the input file are: | ||
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | We look at each section in detail. The '' | + | We look at each section in detail. The '' |
- | '' | + | '' |
<code cp2k> | <code cp2k> | ||
Line 120: | Line 120: | ||
PRINT_LEVEL LOW | PRINT_LEVEL LOW | ||
&END GLOBAL | &END GLOBAL | ||
- | </ | + | </ |
We will be doing a static energy and force calculation, | We will be doing a static energy and force calculation, | ||
- | case, we must set [[http:// | + | case, we must set [[http:// |
- | alias for '' | + | alias for '' |
- | calculation, | + | calculation, |
- | generated by '' | + | generated by '' |
- | '' | + | '' |
- | output of '' | + | output of '' |
verbosity of the output can be fine-tuned by overriding this setting | verbosity of the output can be fine-tuned by overriding this setting | ||
in each individual subsection of the input. | in each individual subsection of the input. | ||
- | We now explain the section '' | + | We now explain the section '' |
<code cp2k> | <code cp2k> | ||
METHOD Quickstep | METHOD Quickstep | ||
- | </ | + | </ |
- | The keyword [[http:// | + | The keyword [[http:// |
- | atoms to '' | + | atoms to '' |
Gaussian and Planewaves (GPW) method. | Gaussian and Planewaves (GPW) method. | ||
Line 165: | Line 165: | ||
&END COORD | &END COORD | ||
&END SUBSYS | &END SUBSYS | ||
- | </ | + | </ |
- | The subsection [[http:// | + | The subsection [[http:// |
initial coordinates of atoms in the calculation. | initial coordinates of atoms in the calculation. | ||
- | The subsection [[http:// | + | The subsection [[http:// |
- | calculation. There must be one '' | + | calculation. There must be one '' |
this example, for Si, we have defined the basis set to be used: | this example, for Si, we have defined the basis set to be used: | ||
- | '' | + | '' |
for Geodecker-Teter-Hutter PADE LDA pseudopotential); | for Geodecker-Teter-Hutter PADE LDA pseudopotential); | ||
- | pseudopotential: | + | pseudopotential: |
pseudopotential with 4 valence electrons). | pseudopotential with 4 valence electrons). | ||
The basis set and pseudopotential names //must// correspond to an | The basis set and pseudopotential names //must// correspond to an | ||
existing entry in the corresponding basis set and pseudopotential | existing entry in the corresponding basis set and pseudopotential | ||
- | files defined by [[http:// | + | files defined by [[http:// |
- | keywords in [[http:// | + | keywords in [[http:// |
basis for Si corresponds to parameters: | basis for Si corresponds to parameters: | ||
Line 194: | Line 194: | ||
3 2 2 1 1 | 3 2 2 1 1 | ||
0.4500000000 | 0.4500000000 | ||
- | </ | + | </ |
- | in file '' | + | in file '' |
parameters: | parameters: | ||
Line 207: | Line 207: | ||
3.25819622 | 3.25819622 | ||
| | ||
- | </ | + | </ |
- | in file '' | + | in file '' |
- | The subsection [[http:// | + | The subsection [[http:// |
calculation. | calculation. | ||
with lattice constant equal to 5.4306975 Angstroms. " | with lattice constant equal to 5.4306975 Angstroms. " | ||
- | the default unit for cell vectors. [[http:// | + | the default unit for cell vectors. [[http:// |
second and third lattice (cell) vectors. There are many ways to | second and third lattice (cell) vectors. There are many ways to | ||
- | define the cell, see [[http:// | + | define the cell, see [[http:// |
- | The initial atomic coordinates are specified in the [[http:// | + | The initial atomic coordinates are specified in the [[http:// |
subsection. The default input format for atomic coordinates in | subsection. The default input format for atomic coordinates in | ||
- | '' | + | '' |
< | < | ||
< | < | ||
- | </ | + | </ |
- | where '' | + | where '' |
- | can be changed by configuring keyword [[http:// | + | can be changed by configuring keyword [[http:// |
- | '' | + | '' |
be fractional with respect to the lattice vectors. One can also | be fractional with respect to the lattice vectors. One can also | ||
change the unit for the Cartesian coordinates by setting the keyword | change the unit for the Cartesian coordinates by setting the keyword | ||
- | [[http:// | + | [[http:// |
- | corresponds to the definition of the elements in the [[http:// | + | corresponds to the definition of the elements in the [[http:// |
subsections. | subsections. | ||
- | After the '' | + | After the '' |
- | the [[http:// | + | the [[http:// |
self-consistent Kohn-Sham Density Functional Theory | self-consistent Kohn-Sham Density Functional Theory | ||
calculation. This subsection is only relevant if and only if the | calculation. This subsection is only relevant if and only if the | ||
- | '' | + | '' |
<code cp2k> | <code cp2k> | ||
BASIS_SET_FILE_NAME | BASIS_SET_FILE_NAME | ||
POTENTIAL_FILE_NAME | POTENTIAL_FILE_NAME | ||
- | </ | + | </ |
- | As already mentioned above, the keywords [[http:// | + | As already mentioned above, the keywords [[http:// |
- | [[http:// | + | [[http:// |
pseudopotential parameters. | pseudopotential parameters. | ||
Line 252: | Line 252: | ||
EPS_DEFAULT 1.0E-10 | EPS_DEFAULT 1.0E-10 | ||
&END QS | &END QS | ||
- | </ | + | </ |
- | The [[http:// | + | The [[http:// |
- | '' | + | '' |
- | used within '' | + | used within '' |
- | set, and they will override the '' | + | set, and they will override the '' |
<code cp2k> | <code cp2k> | ||
Line 265: | Line 265: | ||
REL_CUTOFF 60 | REL_CUTOFF 60 | ||
&END MGRID | &END MGRID | ||
- | </ | + | </ |
- | The [[http:// | + | The [[http:// |
- | '' | + | '' |
multi-grid method for representing Gaussian functions numerically on | multi-grid method for representing Gaussian functions numerically on | ||
the grid. Narrow and sharp Gaussians are mapped onto a finer grid | the grid. Narrow and sharp Gaussians are mapped onto a finer grid | ||
Line 282: | Line 282: | ||
force calculation. | force calculation. | ||
- | The [[http:// | + | The [[http:// |
<code cp2k> | <code cp2k> | ||
Line 289: | Line 289: | ||
&END XC_FUNCTIONAL | &END XC_FUNCTIONAL | ||
&END XC | &END XC | ||
- | </ | + | </ |
This defines which exchange-correlation density functional we want | This defines which exchange-correlation density functional we want | ||
Line 309: | Line 309: | ||
&END MIXING | &END MIXING | ||
&END SCF | &END SCF | ||
- | </ | + | </ |
- | The [[http:// | + | The [[http:// |
used to find a self-consistent solution of the Kohn-Sham DFT | used to find a self-consistent solution of the Kohn-Sham DFT | ||
formalism. | formalism. | ||
- | [[http:// | + | [[http:// |
- | \(\rho(\vec{r})\) is to be generated. In this example ('' | + | \(\rho(\vec{r})\) is to be generated. In this example ('' |
initial density is to be generated using overlapping of atomic | initial density is to be generated using overlapping of atomic | ||
charge densities. A good starting point for the electron density in | charge densities. A good starting point for the electron density in | ||
the self-consistency loop is important in obtaining a convergent | the self-consistency loop is important in obtaining a convergent | ||
- | result quickly. | + | result quickly. |
- | residual. This overrides the '' | + | residual. This overrides the '' |
- | subsection. [[http:// | + | subsection. [[http:// |
- | loops '' | + | loops '' |
calculation. | calculation. | ||
Line 330: | Line 330: | ||
ALGORITHM STANDARD | ALGORITHM STANDARD | ||
&END DIAGONALIZATION | &END DIAGONALIZATION | ||
- | </ | + | </ |
- | The [[http:// | + | The [[http:// |
traditional diagonalisation method for finding the ground state | traditional diagonalisation method for finding the ground state | ||
Kohn-Sham energy and electron density. The subsection heading also | Kohn-Sham energy and electron density. The subsection heading also | ||
- | takes an argument, and in this case is set to "'' | + | takes an argument, and in this case is set to "'' |
- | equivalent to "'' | + | equivalent to "'' |
diagonalisation method is turned on. One can also omit the value of | diagonalisation method is turned on. One can also omit the value of | ||
- | the subsection heading, which defaults to "'' | + | the subsection heading, which defaults to "'' |
alternative to diagonalisation is to use the Orbital Transform (OT) | alternative to diagonalisation is to use the Orbital Transform (OT) | ||
method, in which case, the user should either delete the | method, in which case, the user should either delete the | ||
- | '' | + | '' |
- | "'' | + | "'' |
keyword sets the algorithm to use for diagonalisation of the | keyword sets the algorithm to use for diagonalisation of the | ||
- | Kohn-Sham Hamiltonian. "'' | + | Kohn-Sham Hamiltonian. "'' |
LAPACK/ | LAPACK/ | ||
Line 353: | Line 353: | ||
NBROYDEN 8 | NBROYDEN 8 | ||
&END MIXING | &END MIXING | ||
- | </ | + | </ |
- | The [[http:// | + | The [[http:// |
charge mixing in a self-consistency calculation. The subsection also | charge mixing in a self-consistency calculation. The subsection also | ||
- | admits a value, which can be either '' | + | admits a value, which can be either '' |
- | ('' | + | ('' |
- | '' | + | '' |
diagonalisation method//. The OT method uses a different approach for | diagonalisation method//. The OT method uses a different approach for | ||
charge mixing, and is explained in other tutorials. The keyword | charge mixing, and is explained in other tutorials. The keyword | ||
- | [[http:// | + | [[http:// |
density will be mixed with 0.6 of the input density to form the new | density will be mixed with 0.6 of the input density to form the new | ||
- | input density in the next SCF iteration. The keyword [[http:// | + | input density in the next SCF iteration. The keyword [[http:// |
the mixing method; in this case, we will use Broyden mixing. The | the mixing method; in this case, we will use Broyden mixing. The | ||
- | keyword [[http:// | + | keyword [[http:// |
sets the number of histories to be used in the Broyden mixing | sets the number of histories to be used in the Broyden mixing | ||
algorithm. | algorithm. | ||
- | The final [[http:// | + | The final [[http:// |
<code cp2k> | <code cp2k> | ||
Line 377: | Line 377: | ||
&END FORCES | &END FORCES | ||
&END PRINT | &END PRINT | ||
- | </ | + | </ |
- | tells '' | + | tells '' |
output of the calculation. | output of the calculation. | ||
- | ====== Running the Calculation ====== | ||
- | To run the calculation, | + | |
+ | ===== Running the Calculation ===== | ||
+ | To run the calculation, | ||
package compiled, and with the path to its binaries in the system | package compiled, and with the path to its binaries in the system | ||
- | '' | + | '' |
should be in the same working directory. In this example, we will | should be in the same working directory. In this example, we will | ||
- | use the MPI version of '' | + | use the MPI version of '' |
< | < | ||
- | mpirun -n 2 -o Si_bulk8.out Si_bulk8.inp & | + | mpirun -n 2 cp2k.popt |
- | </ | + | </ |
- | in the working directory to run '' | + | in the working directory to run '' |
- | processes in the background. The '' | + | processes in the background. The '' |
- | output to file '' | + | output to file '' |
- | output of successive runs to '' | + | output of successive runs to '' |
- | to start completely from afresh, they must delete '' | + | to start completely from afresh, they must delete '' |
before running a new calculation. | before running a new calculation. | ||
- | ====== Obtaining the Results ====== | ||
+ | ===== Obtaining the Results ===== | ||
After the job has finished, we should obtain the following files: | After the job has finished, we should obtain the following files: | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | The file '' | + | The file '' |
- | job. '' | + | job. '' |
- | from the calculation. '' | + | from the calculation. '' |
- | Kohn-Sham wavefunctions obtained from the '' | + | Kohn-Sham wavefunctions obtained from the ''< |
- | step; in this case, '' | + | step; in this case, '' |
wavefunctions obtained from the last SCF step. Should the reader | wavefunctions obtained from the last SCF step. Should the reader | ||
want to start a new calculation from the previous calculated | want to start a new calculation from the previous calculated | ||
- | wavefunctions, | + | wavefunctions, |
- | subsection of '' | + | subsection of '' |
<code cp2k> | <code cp2k> | ||
SCF_GUESS RESTART | SCF_GUESS RESTART | ||
- | </ | + | </ |
- | provided that the new calculation shares the same '' | + | provided that the new calculation shares the same '' |
the one that generated the wavefunctions. Otherwise, we would need | the one that generated the wavefunctions. Otherwise, we would need | ||
to rename the restart wavefunction files to correspond to the | to rename the restart wavefunction files to correspond to the | ||
project name of the new calculation. | project name of the new calculation. | ||
- | We now look at the main '' | + | We now look at the main '' |
< | < | ||
Line 451: | Line 452: | ||
*** SCF run converged in 10 steps *** | *** SCF run converged in 10 steps *** | ||
- | </ | + | </ |
The above shows a typical output from a self-consistent Kohn-Sham | The above shows a typical output from a self-consistent Kohn-Sham | ||
Line 489: | Line 490: | ||
| | ||
SUM OF ATOMIC FORCES | SUM OF ATOMIC FORCES | ||
- | </ | + | </ |
The above shows the results on final energies and forces. | The above shows the results on final energies and forces. | ||
Line 498: | Line 499: | ||
means the system is more or less relaxed, and its geometry is close | means the system is more or less relaxed, and its geometry is close | ||
to its optimal at ground state. | to its optimal at ground state. | ||
- | ====== Adding Smearing ====== | ||
+ | |||
+ | ===== Adding Smearing ===== | ||
In the example so far, we have not used any smearing on electron | In the example so far, we have not used any smearing on electron | ||
occupation. This is fine for system with a large band gap. However, | occupation. This is fine for system with a large band gap. However, | ||
Line 507: | Line 509: | ||
function. | function. | ||
- | To add smearing, we need to add the subsection [[http:// | + | To add smearing, we need to add the subsection [[http:// |
- | subsection '' | + | subsection '' |
<code cp2k> | <code cp2k> | ||
Line 515: | Line 517: | ||
ELECTRONIC_TEMPERATURE [K] 300 | ELECTRONIC_TEMPERATURE [K] 300 | ||
&END SMEAR | &END SMEAR | ||
- | </ | + | </ |
- | This tells '' | + | This tells '' |
occupation. In this example, we use the Fermi-Dirac smearing | occupation. In this example, we use the Fermi-Dirac smearing | ||
function, with the electron temperature being set to 300 K. Note | function, with the electron temperature being set to 300 K. Note | ||
- | that, in '' | + | that, in '' |
- | value by using a unit enclosed in square bracket, such as "'' | + | value by using a unit enclosed in square bracket, such as "'' |
before the value. | before the value. | ||
This is not all, since smearing may lead to occupation of molecular | This is not all, since smearing may lead to occupation of molecular | ||
- | orbitals in the conduction band, we must tell '' | + | orbitals in the conduction band, we must tell '' |
extra, empty, molecular orbitals into the calculation, | extra, empty, molecular orbitals into the calculation, | ||
otherwise would be omitted (for reducing computational cost). To do | otherwise would be omitted (for reducing computational cost). To do | ||
- | this, we need to add the keyword [[http:// | + | this, we need to add the keyword [[http:// |
subsection: | subsection: | ||
<code cp2k> | <code cp2k> | ||
ADDED_MOS 10 | ADDED_MOS 10 | ||
- | </ | + | </ |
- | In this example, we have asked '' | + | In this example, we have asked '' |
lowest empty molecular orbitals in the calculation. It should be | lowest empty molecular orbitals in the calculation. It should be | ||
noted that given a chosen basis set, there is a maximum number of | noted that given a chosen basis set, there is a maximum number of | ||
Line 552: | Line 554: | ||
Number of orbital functions: | Number of orbital functions: | ||
Number of independent orbital functions: | Number of independent orbital functions: | ||
- | </ | + | </ |
unlike in the previous case with no smearing, now 26 molecular | unlike in the previous case with no smearing, now 26 molecular | ||
Line 577: | Line 579: | ||
ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): | ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): | ||
- | </ | + | </ |
In the final energy section of the output, we notice that there is | In the final energy section of the output, we notice that there is | ||
Line 584: | Line 586: | ||
< | < | ||
Electronic entropic energy: | Electronic entropic energy: | ||
- | </ | + | </ |
This should be small for the calculation to be a reliable | This should be small for the calculation to be a reliable | ||
Line 593: | Line 595: | ||
< | < | ||
Total energy: | Total energy: | ||
- | </ | + | </ |
and the final free energy extrapolated for \(TS \to 0\) is given by: | and the final free energy extrapolated for \(TS \to 0\) is given by: | ||
Line 599: | Line 601: | ||
< | < | ||
ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): | ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): | ||
- | </ | + | </ |
This is the energy to be quoted as the final result. | This is the energy to be quoted as the final result. |
howto/static_calculation.1390819282.txt.gz · Last modified: 2020/08/21 10:15 (external edit)