User Tools

Site Tools


howto:running_qe_computation

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:running_qe_computation [2019/08/13 12:50]
mtaillefumier
howto:running_qe_computation [2019/12/23 20:54] (current)
oschuett [How to do calculations like Quantum ESPRESSO]
Line 1: Line 1:
 +====== How to run calculations like Quantum ESPRESSO ======
 +
 +
 ===== Introduction ===== ===== Introduction =====
  
Line 8: Line 11:
 An other popular program for plane wave DFT is [[http://​www.quantum-espresso.org|Quantum Expresso]] (QE). A full description of QE functionalities is outside the scope of this tutorial, but one of the main functionalities is ground state minimization and geometry optimization of crystals. In this tutorial, we will show how to do QE calculations with CP2K + An other popular program for plane wave DFT is [[http://​www.quantum-espresso.org|Quantum Expresso]] (QE). A full description of QE functionalities is outside the scope of this tutorial, but one of the main functionalities is ground state minimization and geometry optimization of crystals. In this tutorial, we will show how to do QE calculations with CP2K +
 SIRIUS. We will consider the simple case of silicium doped with germanium and SIRIUS. We will consider the simple case of silicium doped with germanium and
-show how to convert a QE input file to cp2k input file. Files for this tutorial can be found [[https://​www.cp2k.org/​?​image=potentials-sige.tar.gz&​ns=&​tab_details=view&​do=media&​tab_files=files|here]] while the cp2k input files can be found in the cp2k tests directory.+show how to convert a QE input file to cp2k input file. Files for this tutorial can be found [[https://​www.cp2k.org/​_media/​howto:​si7ge.tar.gz|here]] while the cp2k input files can be found in the cp2k tests directory.
  
 === Word of caution with the pseudo-potential files === === Word of caution with the pseudo-potential files ===
Line 35: Line 38:
   /   /
   &system   &system
-  ibrav=0, celldm(1)=1,​ ecutwfc=30,  +  ibrav=0, celldm(1)=1,​ ecutwfc=25,  
-  ecutrho = 300, occupations = '​smearing', ​+  ecutrho = 400, occupations = '​smearing', ​
   smearing = '​gauss',​ degauss = 0.001,   smearing = '​gauss',​ degauss = 0.001,
   nat=8 ntyp=2   nat=8 ntyp=2
Line 77: Line 80:
        ​USE_SYMMETRY true        ​USE_SYMMETRY true
        ​NUM_MAG_DIMS 0        ​NUM_MAG_DIMS 0
-       ​GK_CUTOFF ​6.0 +       ​GK_CUTOFF ​5.0 
-       ​PW_CUTOFF ​18.00+       ​PW_CUTOFF ​20.00
        ​ENERGY_TOL 1e-10        ​ENERGY_TOL 1e-10
        ​POTENTIAL_TOL 1e-8        ​POTENTIAL_TOL 1e-8
Line 199: Line 202:
 for cp2k input file. Note the presence of the keyword ''​SCALED''​ in the section ''​COORD''​ for cp2k input file. Note the presence of the keyword ''​SCALED''​ in the section ''​COORD''​
 which indicates that cp2k should treat the coordinates as given in the lattice which indicates that cp2k should treat the coordinates as given in the lattice
-basis. Putting these two sections together, we have+basis. **The coordinates do not have to be given in the lattice basis, any format supported by cp2k will work**. Putting these two sections together, we have
  
 <​code>​ <​code>​
Line 326: Line 329:
 ^ QE input ^ CP2K input ^ ^ QE input ^ CP2K input ^
 |<​code>​ |<​code>​
-ecutwfc=30 +ecutwfc=25 
-ecutrho = 300+ecutrho = 400
 </​code>​|<​code>​ </​code>​|<​code>​
 &​FORCE_EVAL &​FORCE_EVAL
Line 334: Line 337:
     &​PARAMETERS     &​PARAMETERS
        ​ELECTRONIC_STRUCTURE_METHOD ​ pseudopotential        ​ELECTRONIC_STRUCTURE_METHOD ​ pseudopotential
-       ​GK_CUTOFF ​6.0 +       ​GK_CUTOFF ​5.0 
-       ​PW_CUTOFF ​18.00+       ​PW_CUTOFF ​20.00
     &END PARAMETERS     &END PARAMETERS
   &END PW_DFT   &END PW_DFT
Line 348: Line 351:
     &​PARAMETERS     &​PARAMETERS
        ​ELECTRONIC_STRUCTURE_METHOD ​ pseudopotential        ​ELECTRONIC_STRUCTURE_METHOD ​ pseudopotential
-       ​GK_CUTOFF ​6.0 +       ​GK_CUTOFF ​5.0 
-       ​PW_CUTOFF ​18.00+       ​PW_CUTOFF ​20.00
        ​NGRIDK 2 2 2        ​NGRIDK 2 2 2
        ​SHIFTK 0 0 0        ​SHIFTK 0 0 0
Line 431: Line 434:
 Energy Energy
 -------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-valence_eval_sum ​         :        -4.94444720 +valence_eval_sum ​         :        -5.08815701 
-<​rho|V^{XC}> ​             :       -30.28985204 +<​rho|V^{XC}> ​             :       -30.23739234 
-<​rho|E^{XC}> ​             :       -43.77347053+<​rho|E^{XC}> ​             :       -43.72437220
 <​mag|B^{XC}> ​             :         ​0.00000000 <​mag|B^{XC}> ​             :         ​0.00000000
-<​rho|V^{H}> ​              : ​      106.74147275 +<​rho|V^{H}> ​              : ​      106.32392644 
-one-electron contribution :       -81.39606791 ​(Ha),      -162.79213582 ​(Ry) +one-electron contribution :       -81.17469111 ​(Ha),      -162.34938222 ​(Ry) 
-hartree contribution ​     :        53.37073638 +hartree contribution ​     :        53.16196322 
-xc contribution ​          : ​      -43.77347053 +xc contribution ​          : ​      -43.72437220 
-ewald contribution ​       :       -68.41309923+ewald contribution ​       :       -68.41309922
 PAW contribution ​         :         ​0.00000000 PAW contribution ​         :         ​0.00000000
-Total energy ​             :      -140.21190129 ​(Ha),      -280.42380259 ​(Ry)+Total energy ​             :      -140.15019932 ​(Ha),      -280.30039863 ​(Ry)
  
-band gap (eV) :         0.36618436 +band gap (eV) :         0.34564591 
-Efermi ​       :         0.24797319+Efermi ​       :         0.24495087
  
-iteration :  ​10, RMS 3.843002363419E-11, energy difference : 0.000000000000E+00+iteration :  ​11, RMS 1.265254419560E-11, energy difference : 0.000000000000E+00
  
-converged after 11 SCF iterations! +converged after 12 SCF iterations!
- +
- ​ENERGY| Total FORCE_EVAL ( SIRIUS ) energy (a.u.): ​        ​-140.211901294509545+
  
 + ​ENERGY| Total FORCE_EVAL ( SIRIUS ) energy (a.u.): ​        ​-140.150199315127225
 </​code>​ </​code>​
  
-===== Cell relaxation ​===== +===== Molecular dynamics ​=====
- +
-Quantum expresso supports many types of calculations that cp2k supports natively. For instance, it is possible to do cell relaxation in cp2k with the sirius backend, something that QE can do as well. The following QE input file +
-<​code>​ +
-&​control +
-calculation='​scf',​ +
-restart_mode='​from_scratch',​ +
-pseudo_dir = '​./',​ +
-outdir='​./',​ +
-prefix = '​scf_',​ +
-tstress = false, +
-tprnfor = false, +
-verbosity = '​high',​ +
-wf_collect = false +
-+
-&​system +
-ibrav=0, celldm(1)=1,​ ecutwfc=30, ecutrho = 300, +
-occupations = '​smearing',​ smearing = '​gauss',​ degauss = 0.001, +
-nat=8 ntyp=2 +
-+
-&​electrons +
-conv_thr =  1.0d-11, +
-mixing_beta = 0.7, +
-electron_maxstep = 100 +
-+
-&IONS +
-ion_dynamics='​bfgs',​ +
-+
-&CELL +
-cell_dynamics='​bfgs',​ +
-+
-ATOMIC_SPECIES +
-Ge 0.0 ge_lda_v1.uspp.F.UPF +
-Si 0.0 si_lda_v1.uspp.F.UPF +
-CELL_PARAMETERS +
-       ​10.26253566 ​       0.00000000 ​       0.00000000 +
-        0.00000000 ​      ​10.26253566 ​       0.00000000 +
-        0.00000000 ​       0.00000000 ​      ​10.26253566 +
-ATOMIC_POSITIONS (crystal) +
-Ge          0.00000000 ​        ​0.00000000 ​        ​0.00000000 +
-Si          0.00000000 ​        ​0.50000000 ​        ​0.50000000 +
-Si          0.50000000 ​        ​0.00000000 ​        ​0.50000000 +
-Si          0.50000000 ​        ​0.50000000 ​        ​0.00000000 +
-Si          0.75000000 ​        ​0.75000000 ​        ​0.25000000 +
-Si          0.75000000 ​        ​0.25000000 ​        ​0.75000000 +
-Si          0.25000000 ​        ​0.75000000 ​        ​0.75000000 +
-Si          0.25000000 ​        ​0.25000000 ​        ​0.25000000 +
-K_POINTS (automatic) +
-2 2 2  0 0 0 +
-</​code>​ +
- +
-describes the computation of the cell relaxation for Si7Ge for instance. The cp2k input file for the sirius backend will look like+
  
 +Quantum expresso supports many types of calculations that cp2k supports natively. For instance, it is possible to do molecular dynamics in cp2k with the sirius backend, something that QE can do as well. To do this, we can start from the previous cp2k input file for Si7Ge and add a small section for setting the parameters relevant for the molecular dynamics. The ''​symmetry''​ parameter **should be off** during molecular dynamics configurations. ​
 + 
 <​code>​ <​code>​
 &​FORCE_EVAL &​FORCE_EVAL
Line 519: Line 472:
        ​ELECTRONIC_STRUCTURE_METHOD ​ pseudopotential        ​ELECTRONIC_STRUCTURE_METHOD ​ pseudopotential
        ​SMEARING_WIDTH 0.01        ​SMEARING_WIDTH 0.01
-       ​USE_SYMMETRY ​true+       ​USE_SYMMETRY ​false
        ​NUM_MAG_DIMS 0        ​NUM_MAG_DIMS 0
-       ​GK_CUTOFF ​6.0 +       ​GK_CUTOFF ​5.0 
-       ​PW_CUTOFF ​18.00+       ​PW_CUTOFF ​20.00
        ​ENERGY_TOL 1e-10        ​ENERGY_TOL 1e-10
        ​POTENTIAL_TOL 1e-8        ​POTENTIAL_TOL 1e-8
Line 581: Line 534:
       OPTIMIZER LBFGS       OPTIMIZER LBFGS
    &​END GEO_OPT    &​END GEO_OPT
 +   &​MD
 +      ENSEMBLE NVE
 +      TIMESTEP 0.1 
 +      STEPS 125
 +      TEMPERATURE 300.0
 +   &​END MD
 &END MOTION &END MOTION
 &GLOBAL &GLOBAL
   PROJECT Si7Ge   PROJECT Si7Ge
   PRINT_LEVEL MEDIUM   PRINT_LEVEL MEDIUM
-  RUN_TYPE ​GEO_OPT+  RUN_TYPE ​MD
 &END GLOBAL &END GLOBAL
 </​code>​ </​code>​
Line 593: Line 552:
 </​code>​ </​code>​
  
-you should obtain a file ''​Si7Ge-pos-1.xyz''​ that contains the positions of the atoms after relaxation+you should obtain a file ''​Si7Ge-pos-1.xyz''​ that contains the positions of the atoms and ''​Si7Ge-1.ener''​ that contains the different energies and temperature as a function of time. The calculations are done in the micro-canonical ensemble which means that the total energy (the sum of the potential which is the total energy given by SIRIUS and the kinetic energy) is conserved during the integration process. It is possible to compare these results with QE, but instead of doing the molecular dynamics with QE, we take the positions of the atoms at each time step and compute the potential energy for this atom position with QE.  
 +{{:​howto:​cp2k-sirius-md.png|}} 
 +The total energy given by QE and CP2K/SIRIUS are shifted by a small offset. More generally, converting the input file from QE to CP2K is not a warranty to obtain the same results for the total energy. The reasons for this multiple : 
 +  * Indicating the same cutoff does not warranty the fft grid size. 
 +  * QE and SIRIUS treat the radial integrals interpolation differently 
 +  * The functional in QE do not use libxc by default, while CP2K/SIRIUS does. 
 +  * The minimization method is sensitive to the initial states. 
 +For all these reasons, we should not try to compare results at the binary level
howto/running_qe_computation.1565700622.txt.gz · Last modified: 2019/08/13 12:50 by mtaillefumier