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/02/03 10:28] – remove spaces in code text oschuetthowto: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
Line 14: 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:
Line 21: Line 22:
   * ''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
Line 103: 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:
Line 119: 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
Line 135: Line 136:
 <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
Line 164: 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
Line 193: 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 206: 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
Line 222: Line 223:
 <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
Line 241: Line 242:
 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
Line 251: 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
Line 264: 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
Line 288: 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 308: 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
Line 329: 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
Line 352: 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
Line 376: 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 ====== 
  
 +
 +===== Running the Calculation =====
 To run the calculation, the reader needs to have a working ''CP2K'' 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
Line 388: Line 390:
 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''
Line 396: Line 398:
 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:
  
Line 415: Line 417:
 <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
Line 450: 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 488: 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 497: 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 514: 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
Line 532: Line 535:
 <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
Line 551: 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 576: 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 583: 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 592: 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 598: 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.1391423321.txt.gz · Last modified: 2020/08/21 10:15 (external edit)