User Tools

Site Tools


howto:static_calculation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
static_calculation [2014/01/27 10:40] – [Introduction] 92.30.13.71howto:static_calculation [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Introduction ======+====== How to Calculate Energy and Forces ======
  
 +===== 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 '' QUICKSTEP ''.+energy and force calculation on a system using ''QUICKSTEP''.
  
 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 
-'' static_calculation.tgz ''. The calculations were carried out with +''CP2K'' version 2.4.
-'' CP2K '' SVN trunk revision 13180.+
  
 The reader should note that the integration grid settings used in The reader should note that the integration grid settings used in
 the example calculations have already chosen to be sufficient for the example calculations have already chosen to be sufficient for
-the given accuracy. A [[converging_grid|separate tutorial]] is available to show how to+the given accuracy. A [[converging_cutoff|separate tutorial]] is available to show how to
 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:
  
-  * '' Si_bulk8.inp '': the main input file for the calculation, which defines the system and the job parameters +  * ''Si_bulk8.inp'': the main input file for the calculation, which defines the system and the job parameters 
-  * '' BASIS_SET '': file containing parameters for the basis sets that can be used by '' CP2K '' for this calculation +  * ''BASIS_SET'': file containing parameters for the basis sets that can be used by ''CP2K'' for this calculation 
-  * '' POTENTIAL '': file containing parameters for the pseudopotentials that can be used by '' CP2K '' for this calculation+  * ''GTH_POTENTIALS'': file containing parameters for the pseudopotentials that can be used by ''CP2K'' for this calculation
  
 A list of basis set and pseudopotential files may be found in A list of basis set and pseudopotential files may be found in
-'' cp2k/tests/QS/ '' that comes with a '' cp2k '' source release. These+''cp2k/data/'' that comes with a ''cp2k'' source release. These
 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: '' Si_bulk8.inp '' in detail. The name of+Let us look at the main input: ''Si_bulk8.inp'' in detail. The name of
 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 "subsections" of other this tutorial, and some sections are "subsections" of other
 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://manual.cp2k.org/trunk/index.html|'' CP2K '' input reference manual]].+available via the [[http://manual.cp2k.org/trunk/index.html|''CP2K'' input reference manual]].
  
 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
- </code>+</code>
  
 The main sections in the input file are: The main sections in the input file are:
  
-  * [[http://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html|'' GLOBAL '']]: contains general options for the '' CP2K '' run, such as the name of the job, the type of run etc. +  * [[http://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html|''GLOBAL'']]: contains general options for the ''CP2K'' run, such as the name of the job, the type of run etc. 
-  * [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL.html|'' FORCE_EVAL '']]: contains all parameters associated with the evaluation of forces on atoms, this includes the initial atomic coordinates.+  * [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL.html|''FORCE_EVAL'']]: contains all parameters associated with the evaluation of forces on atoms, this includes the initial atomic coordinates.
  
-We look at each section in detail. The '' GLOBAL '' section in +We look at each section in detail. The ''GLOBAL'' section in 
-'' Si_bulk8.inp '' is presented below:+''Si_bulk8.inp'' is presented below:
  
 <code cp2k> <code cp2k>
Line 120: Line 120:
   PRINT_LEVEL LOW   PRINT_LEVEL LOW
 &END GLOBAL &END GLOBAL
- </code>+</code>
  
 We will be doing a static energy and force calculation, in this We will be doing a static energy and force calculation, in this
-case, we must set [[http://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html#desc_RUN_TYPE|'' RUNTYPE '']] to '' ENERGY_FORCE ''. Keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html#desc_PROJECT_NAME|'' PROJECT '']] is an +case, we must set [[http://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html#desc_RUN_TYPE|''RUN_TYPE'']] to ''ENERGY_FORCE''. Keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html#desc_PROJECT_NAME|''PROJECT'']] is an 
-alias for '' PROJECT_NAME '', which sets the root-name of the +alias for ''PROJECT_NAME'', which sets the root-name of the 
-calculation, in this case '' Si_bulk8 ''. Any output files automatically +calculation, in this case ''Si_bulk8''. Any output files automatically 
-generated by '' CP2K '' will have the name prefixed by +generated by ''CP2K'' will have the name prefixed by 
-'' Si_bulk8 ''. [[http://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html#desc_PRINT_LEVEL|'' PRINT_LEVEL '']] controls the default verbosity of the main +''Si_bulk8''. [[http://manual.cp2k.org/trunk/CP2K_INPUT/GLOBAL.html#desc_PRINT_LEVEL|''PRINT_LEVEL'']] controls the default verbosity of the main 
-output of '' CP2K '', in this example, it is set to "low". The+output of ''CP2K'', in this example, it is set to "low". The
 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 '' FORCE_EVAL '' line-by-line.+We now explain the section ''FORCE_EVAL'' line-by-line.
  
 <code cp2k> <code cp2k>
 METHOD Quickstep METHOD Quickstep
- </code>+</code>
  
-The keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL.html#desc_METHOD|'' METHOD '']] chooses the method for evaluating the forces on +The keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL.html#desc_METHOD|''METHOD'']] chooses the method for evaluating the forces on 
-atoms to '' QUICKSTEP '', i.e. Density Functional Theory using the+atoms to ''QUICKSTEP'', i.e. Density Functional Theory using the
 Gaussian and Planewaves (GPW) method. Gaussian and Planewaves (GPW) method.
  
Line 165: Line 165:
   &END COORD   &END COORD
 &END SUBSYS &END SUBSYS
- </code>+</code>
  
-The subsection [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS.html|'' SUBSYS '']] defines the simulation unit cell and the+The subsection [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS.html|''SUBSYS'']] defines the simulation unit cell and the
 initial coordinates of atoms in the calculation.  initial coordinates of atoms in the calculation. 
  
-The subsection [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/KIND.html|'' KIND '']] gives definitions of elements in the +The subsection [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/KIND.html|''KIND'']] gives definitions of elements in the 
-calculation. There must be one '' KIND '' subsection per element. In+calculation. There must be one ''KIND'' subsection per element. In
 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:
-'' DZVP-GTH-PADE '' (double-\(\zeta\) with polarisation basis optimised+''DZVP-GTH-PADE'' (double-\(\zeta\) with polarisation basis optimised
 for Geodecker-Teter-Hutter PADE LDA pseudopotential); and the for Geodecker-Teter-Hutter PADE LDA pseudopotential); and the
-pseudopotential: '' GTH-PADE-q4 '' (Geodecker-Teter-Hutter PADE LDA+pseudopotential: ''GTH-PADE-q4'' (Geodecker-Teter-Hutter PADE LDA
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html#desc_BASIS_SET_FILE_NAME|'' BASIS_SET_FILE_NAME '']] and [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html#desc_POTENTIAL_FILE_NAME|'' POTENTIAL_FILE_NAME '']] +files defined by [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html#desc_BASIS_SET_FILE_NAME|''BASIS_SET_FILE_NAME'']] and [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html#desc_POTENTIAL_FILE_NAME|''POTENTIAL_FILE_NAME'']] 
-keywords in [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html|'' DFT '']] subsection, in '' FORCE_EVAL '' section. The chosen+keywords in [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html|''DFT'']] subsection, in ''FORCE_EVAL'' section. The chosen
 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   1.0000000000         0.4500000000   1.0000000000
- </code>+</code>
  
-in file '' BASIS_SETS ''; and the chosen pseudopotential corresponds to+in file ''BASIS_SET''; and the chosen pseudopotential corresponds to
 parameters: parameters:
  
Line 207: Line 207:
                                         3.25819622                                         3.25819622
      0.48427842    1     2.72701346      0.48427842    1     2.72701346
- </code>+</code>
  
-in file '' GTH_POTENTIAL ''.+in file ''GTH_POTENTIALS''.
  
-The subsection [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html|'' CELL '']] defines the simulation unit cell used in a+The subsection [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html|''CELL'']] defines the simulation unit cell used in a
 calculation.  In this example, we define the unit cell as cubic, calculation.  In this example, we define the unit cell as cubic,
 with lattice constant equal to 5.4306975 Angstroms. "Angstrom" is with lattice constant equal to 5.4306975 Angstroms. "Angstrom" is
-the default unit for cell vectors. [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html#desc_A|'' A '']], [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html#desc_B|'' B '']] and [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html#desc_C|'' C '']] are the first,+the default unit for cell vectors. [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html#desc_A|''A'']], [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html#desc_B|''B'']] and [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html#desc_C|''C'']] are the first,
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html|'' CP2K '' input reference manual]] for more details.+define the cell, see [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/CELL.html|''CP2K'' input reference manual]] for more details.
  
-The initial atomic coordinates are specified in the [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/COORD.html|'' COORD '']]+The initial atomic coordinates are specified in the [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/COORD.html|''COORD'']]
 subsection. The default input format for atomic coordinates in subsection. The default input format for atomic coordinates in
-'' CP2K '' is:+''CP2K'' is:
 <code> <code>
 <ATOM_KIND> X Y Z <ATOM_KIND> X Y Z
- </code> +</code> 
-where '' X '', '' Y '' and '' Z '' are Cartesian coordinates in Angstroms. This +where ''X'', ''Y'' and ''Z'' are Cartesian coordinates in Angstroms. This 
-can be changed by configuring keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/COORD.html#desc_SCALED|'' SCALED '']] to '' .TRUE. '', in the +can be changed by configuring keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/COORD.html#desc_SCALED|''SCALED'']] to ''.TRUE.'', in the 
-'' COORD '' subsection, which makes the coordinate input '' X '' '' Y '' '' Z '' to+''COORD'' subsection, which makes the coordinate input ''X'' ''Y'' ''Z'' to
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/COORD.html#desc_UNIT|'' UNIT '']] with in the subsection. '' <ATOM_KIND> '' should be a label that +[[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/COORD.html#desc_UNIT|''UNIT'']] with in the subsection. ''<ATOM_KIND>'' should be a label that 
-corresponds to the definition of the elements in the [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/KIND.html|'' KIND '']]+corresponds to the definition of the elements in the [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/SUBSYS/KIND.html|''KIND'']]
 subsections. subsections.
  
-After the '' SUBSYS '' section in the input file '' Si_bulk8.inp '' follows +After the ''SUBSYS'' section in the input file ''Si_bulk8.inp'' follows 
-the [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html|'' DFT '']] subsection, which controls all aspects of the+the [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html|''DFT'']] subsection, which controls all aspects of the
 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
-'' METHOD '' keyword in '' FORCE_EVAL '' is set to '' QUICKSTEP ''.+''METHOD'' keyword in ''FORCE_EVAL'' is set to ''QUICKSTEP''.
  
 <code cp2k> <code cp2k>
 BASIS_SET_FILE_NAME  BASIS_SET BASIS_SET_FILE_NAME  BASIS_SET
 POTENTIAL_FILE_NAME  GTH_POTENTIALS POTENTIAL_FILE_NAME  GTH_POTENTIALS
- </code>+</code>
  
-As already mentioned above, the keywords [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html#desc_BASIS_SET_FILE_NAME|'' BASIS_SET_FILE_NAME '']] and +As already mentioned above, the keywords [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html#desc_BASIS_SET_FILE_NAME|''BASIS_SET_FILE_NAME'']] and 
-[[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html#desc_POTENTIAL_FILE_NAME|'' POTENTIAL_FILE_NAME '']] set the files that contains basis set and+[[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT.html#desc_POTENTIAL_FILE_NAME|''POTENTIAL_FILE_NAME'']] set the files that contains basis set and
 pseudopotential parameters. pseudopotential parameters.
  
Line 252: Line 252:
   EPS_DEFAULT 1.0E-10   EPS_DEFAULT 1.0E-10
 &END QS &END QS
- </code>+</code>
  
-The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/QS.html|'' QS '']] subsection contains general control parameters used by +The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/QS.html|''QS'']] subsection contains general control parameters used by 
-'' QUICKSTEP ''. [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/QS.html#desc_EPS_DEFAULT|'' EPS_DEFAULT '']] sets the default value for all tolerances +''QUICKSTEP''. [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/QS.html#desc_EPS_DEFAULT|''EPS_DEFAULT'']] sets the default value for all tolerances 
-used within '' QUICKSTEP ''. The individual tolerances ('' EPS_* '') can be +used within ''QUICKSTEP''. The individual tolerances (''EPS_*'') can be 
-set, and they will override the '' EPS_DEFAULT '' value.+set, and they will override the ''EPS_DEFAULT'' value.
  
 <code cp2k> <code cp2k>
Line 265: Line 265:
   REL_CUTOFF 60   REL_CUTOFF 60
 &END MGRID &END MGRID
- </code>+</code>
  
-The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/MGRID.html|'' MGRID '']] subsection defines how the integration grid used in +The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/MGRID.html|''MGRID'']] subsection defines how the integration grid used in 
-'' QUICKSTEP '' calculations should be setup. '' QUICKSTEP '' uses a+''QUICKSTEP'' calculations should be setup. ''QUICKSTEP'' uses a
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/XC.html|'' XC '']] subsection follows:+The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/XC.html|''XC'']] subsection follows:
  
 <code cp2k> <code cp2k>
Line 289: Line 289:
   &END XC_FUNCTIONAL   &END XC_FUNCTIONAL
 &END XC &END XC
- </code>+</code>
  
 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
- </code>+</code>
  
-The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html|'' SCF '']] subsection defines all the settings related to methods+The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html|''SCF'']] subsection defines all the settings related to methods
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html#desc_SCF_GUESS|'' SCF_GUESS '']] sets how the initial trial electron density function +[[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html#desc_SCF_GUESS|''SCF_GUESS'']] sets how the initial trial electron density function 
-\(\rho(\vec{r})\) is to be generated. In this example ('' ATOMIC ''), the+\(\rho(\vec{r})\) is to be generated. In this example (''ATOMIC''), the
 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.  [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html#desc_EPS_SCF|'' EPS_SCF '']] sets the tolerance of the charge density +result quickly.  [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html#desc_EPS_SCF|''EPS_SCF'']] sets the tolerance of the charge density 
-residual. This overrides the '' EPS_DEFAULT '' value set in '' QS '' +residual. This overrides the ''EPS_DEFAULT'' value set in ''QS'' 
-subsection. [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html#desc_MAX_SCF|'' MAX_SCF '']] sets the maximum number of self-consistency +subsection. [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html#desc_MAX_SCF|''MAX_SCF'']] sets the maximum number of self-consistency 
-loops '' QUICKSTEP '' is allowed to perform for each ground-state energy+loops ''QUICKSTEP'' is allowed to perform for each ground-state energy
 calculation. calculation.
  
Line 330: Line 330:
   ALGORITHM STANDARD   ALGORITHM STANDARD
 &END DIAGONALIZATION &END DIAGONALIZATION
- </code>+</code>
  
-The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/DIAGONALIZATION.html|'' DIAGONALIZATION '']] subsection tells the code to use the+The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/DIAGONALIZATION.html|''DIAGONALIZATION '']] subsection tells the code to use the
 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 "'' ON ''", which +takes an argument, and in this case is set to "''ON''", which 
-equivalent to "'' .TRUE. ''" or "'' T ''", and indicates that the+equivalent to "''.TRUE.''" or "''T''", and indicates that the
 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 "'' .TRUE. ''". The+the subsection heading, which defaults to "''.TRUE.''". The
 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
-'' DIAGONALIZATION '' block or change "'' ON ''" to "'' OFF ''" (or +''DIAGONALIZATION'' block or change "''ON''" to "''OFF''" (or 
-"'' .FALSE. ''"), and add the [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/DIAGONALIZATION/OT.html|'' OT '']] subsection instead. The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/DIAGONALIZATION.html#desc_ALGORITHM|'' ALGORITHM '']]+"''.FALSE.''"), and add the [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/DIAGONALIZATION/OT.html|''OT'']] subsection instead. The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/DIAGONALIZATION.html#desc_ALGORITHM|''ALGORITHM'']]
 keyword sets the algorithm to use for diagonalisation of the keyword sets the algorithm to use for diagonalisation of the
-Kohn-Sham Hamiltonian. "'' STANDARD ''" means the standard+Kohn-Sham Hamiltonian. "''STANDARD''" means the standard
 LAPACK/SCALAPACK subroutines are to be used for diagonalisation. LAPACK/SCALAPACK subroutines are to be used for diagonalisation.
  
Line 353: Line 353:
   NBROYDEN 8   NBROYDEN 8
 &END MIXING &END MIXING
- </code>+</code>
  
-The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/MIXING.html|'' MIXING '']] subsection contains all the parameters associated with+The [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/MIXING.html|''MIXING'']] subsection contains all the parameters associated with
 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 '' .TRUE. '' ('' T '') or '' .FALSE. '' +admits a value, which can be either ''.TRUE.'' (''T'') or ''.FALSE.'' 
-('' F ''), which switches charge mixing on or off. The default is +(''F''), which switches charge mixing on or off. The default is 
-'' .TRUE. ''. Note that this subsection //only applies to the traditional+''.TRUE.''. Note that this subsection //only applies to the traditional
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/MIXING.html#desc_ALPHA|'' ALPHA '']] sets the mixing parameter; in this example 0.4 of the output+[[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/MIXING.html#desc_ALPHA|''ALPHA'']] sets the mixing parameter; in this example 0.4 of the output
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/MIXING.html#desc_METHOD|'' METHOD '']] sets+input density in the next SCF iteration. The keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/MIXING.html#desc_METHOD|''METHOD'']] sets
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/MIXING.html#desc_NBUFFER|'' NBROYDEN '']] is an alias to the parameter '' NBUFFER '', and it+keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/MIXING.html#desc_NBUFFER|''NBROYDEN'']] is an alias to the parameter ''NBUFFER'', and it
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/PRINT.html|'' PRINT '']] subsection in '' FORCE_EVAL '' section:+The final [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/PRINT.html|''PRINT'']] subsection in ''FORCE_EVAL'' section:
  
 <code cp2k> <code cp2k>
Line 377: Line 377:
   &END FORCES   &END FORCES
 &END PRINT &END PRINT
- </code>+</code>
  
-tells '' CP2K '', in this case, to print out atomic forces in the main+tells ''CP2K'', in this case, to print out atomic forces in the main
 output of the calculation. output of the calculation.
-====== Running the Calculation ====== 
  
-To run the calculation, the reader needs to have a working '' CP2K ''+ 
 +===== Running the Calculation ===== 
 +To run the calculation, the reader needs to have a working ''CP2K''
 package compiled, and with the path to its binaries in the system package compiled, and with the path to its binaries in the system
-'' PATH ''. The files '' Si_bulk8.inp '', '' BASIS_SET '' and '' GTH_POTENTIAL ''+''PATH''. The files ''Si_bulk8.inp'', ''BASIS_SET'' and ''GTH_POTENTIAL''
 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 '' CP2K ''. Type command:+use the MPI version of ''CP2K''. Type command:
 <code> <code>
-mpirun -n 2 -o Si_bulk8.out Si_bulk8.inp & +mpirun -n 2 cp2k.popt -o Si_bulk8.out Si_bulk8.inp & 
- </code> +</code> 
-in the working directory to run '' CP2K '' in parallel with 2 MPI +in the working directory to run ''CP2K'' in parallel with 2 MPI 
-processes in the background. The '' -o '' option redirects the '' CP2K '' +processes in the background. The ''-o'' option redirects the ''CP2K'' 
-output to file '' Si_bulk8.out ''. Note that the '' -o '' option //appends// +output to file ''Si_bulk8.out''. Note that the ''-o'' option //appends// 
-output of successive runs to '' Si_bulk8.out '', so if the reader wants +output of successive runs to ''Si_bulk8.out'', so if the reader wants 
-to start completely from afresh, they must delete '' Si_bulk8.out ''+to start completely from afresh, they must delete ''Si_bulk8.out''
 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:
  
-  * '' Si_bulk8.out '' +  * ''Si_bulk8.out'' 
-  * '' Si_bulk8-RESTART.wfn '' +  * ''Si_bulk8-RESTART.wfn'' 
-  * '' Si_bulk8-RESTART.wfn.bak-1 ''+  * ''Si_bulk8-RESTART.wfn.bak-1''
  
-The file '' Si_bulk8.out '' contains the main output of the +The file ''Si_bulk8.out'' contains the main output of the 
-job. '' Si_bulk8-RESTART.wfn '' is the final Kohn-Sham wavefunctions +job. ''Si_bulk8-RESTART.wfn'' is the final Kohn-Sham wavefunctions 
-from the calculation. '' Si_bulk8-RESTART.wfn.bak-<n> '' records the +from the calculation. ''Si_bulk8-RESTART.wfn.bak-<n>'' records the 
-Kohn-Sham wavefunctions obtained from the '' <n> ''-th previous SCF +Kohn-Sham wavefunctions obtained from the ''<n>''-th previous SCF 
-step; in this case, '' Si_bulk8-RESTART.wfn.bak-1 '' contains the+step; in this case, ''Si_bulk8-RESTART.wfn.bak-1'' contains the
 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, they need to change the '' SCF_GUESS '' keyword in '' SCF '' +wavefunctions, they need to change the ''SCF_GUESS'' keyword in ''SCF'' 
-subsection of '' FORCE_EVAL '' section to '' RESTART '':+subsection of ''FORCE_EVAL'' section to ''RESTART'':
 <code cp2k> <code cp2k>
 SCF_GUESS RESTART SCF_GUESS RESTART
- </code> +</code> 
-provided that the new calculation shares the same '' PROJECT_NAME '' as+provided that the new calculation shares the same ''PROJECT_NAME'' as
 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 '' CP2K '' output in more detail.+We now look at the main ''CP2K'' output in more detail.
  
 <code> <code>
Line 451: Line 452:
  
  *** SCF run converged in    10 steps ***  *** SCF run converged in    10 steps ***
- </code>+</code>
  
 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:
           1      Si         -0.00000001    -0.00000001    -0.00000001           1      Si         -0.00000001    -0.00000001    -0.00000001
 SUM OF ATOMIC FORCES          -0.00000000    -0.00000000    -0.00000000     0.00000000 SUM OF ATOMIC FORCES          -0.00000000    -0.00000000    -0.00000000     0.00000000
- </code>+</code>
  
 The above shows the results on final energies and forces.  One The above shows the results on final energies and forces.  One
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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/SMEAR.html|'' SMEAR '']] inside +To add smearing, we need to add the subsection [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF/SMEAR.html|''SMEAR'']] inside 
-subsection '' SCF '':+subsection ''SCF'':
  
 <code cp2k> <code cp2k>
Line 515: Line 517:
   ELECTRONIC_TEMPERATURE [K] 300   ELECTRONIC_TEMPERATURE [K] 300
 &END SMEAR &END SMEAR
- </code>+</code>
  
-This tells '' QUICKSTEP '' to use a smearing function for the electron+This tells ''QUICKSTEP'' to use a smearing function for the electron
 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 '' CP2K '', one can explicitly define the unit of a given input +that, in ''CP2K'', one can explicitly define the unit of a given input 
-value by using a unit enclosed in square bracket, such as "'' [K] ''",+value by using a unit enclosed in square bracket, such as "''[K]''",
 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 '' CP2K '' to include+orbitals in the conduction band, we must tell ''CP2K'' to include
 extra, empty, molecular orbitals into the calculation, which extra, empty, molecular orbitals into the calculation, which
 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://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html#desc_ADDED_MOS|'' ADDED_MOS '']] in the '' SCF ''+this, we need to add the keyword [[http://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/SCF.html#desc_ADDED_MOS|''ADDED_MOS'']] in the ''SCF''
 subsection: subsection:
  
 <code cp2k> <code cp2k>
 ADDED_MOS 10 ADDED_MOS 10
- </code>+</code>
  
-In this example, we have asked '' CP2K '' to not to omit 10 of the+In this example, we have asked ''CP2K'' to not to omit 10 of the
 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:                                                104 Number of orbital functions:                                                104
 Number of independent orbital functions:                                    104 Number of independent orbital functions:                                    104
- </code>+</code>
  
 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.):              -31.297887031736590 ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.):              -31.297887031736590
- </code>+</code>
  
 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:
 <code> <code>
 Electronic entropic energy:                                  -0.00001687947145 Electronic entropic energy:                                  -0.00001687947145
- </code>+</code>
  
 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:
 <code> <code>
 Total energy:                                               -31.29788686349247 Total energy:                                               -31.29788686349247
- </code>+</code>
  
 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:
 <code> <code>
 ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.):              -31.297887031736590 ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.):              -31.297887031736590
- </code>+</code>
  
 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.1390819249.txt.gz · Last modified: 2020/08/21 10:15 (external edit)