Structural and electronic properties of semiconductors and metals: Difference between revisions
Line 109: | Line 109: | ||
===Output file description=== | ===Output file description=== | ||
We can now inspect the output (scf.diamond.in > scf.diamond.out) using vi/more/less command. | |||
We found: | |||
A recap of the configuration that is being calculated: | |||
bravais-lattice index = 2 | |||
lattice parameter (alat) = 6.7403 a.u. | |||
unit-cell volume = 76.5550 (a.u.)^3 | |||
number of atoms/cell = 2 | |||
number of atomic types = 1 | |||
number of electrons = 8.00 | |||
number of Kohn-Sham states= 4 | |||
kinetic-energy cutoff = 40.0000 Ry | |||
charge density cutoff = 160.0000 Ry | |||
convergence threshold = 1.0E-08 | |||
mixing beta = 0.7000 | |||
Exchange-correlation= SLA PZ NOGX NOGC | |||
Deatailed information of the unit cell: | |||
celldm(1)= 6.740278 celldm(2)= 0.000000 celldm(3)= 0.000000 | |||
celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000 | |||
crystal axes: (cart. coord. in units of alat) | |||
a(1) = ( -0.500000 0.000000 0.500000 ) | |||
a(2) = ( 0.000000 0.500000 0.500000 ) | |||
a(3) = ( -0.500000 0.500000 0.000000 ) | |||
reciprocal axes: (cart. coord. in units 2 pi/alat) | |||
b(1) = ( -1.000000 -1.000000 1.000000 ) | |||
b(2) = ( 1.000000 1.000000 1.000000 ) | |||
b(3) = ( -1.000000 1.000000 -1.000000 ) | |||
== Exercises: == | == Exercises: == |
Revision as of 11:09, 2 December 2020
Prev: LabQSM#Lecture 1: Basic DFT calculations and Convergences
Structural and electronic properties of Diamond
In this tutorial we will see how to setup a calculation and to get total energies using the PW code from the Quantum ESPRESSO distribution.
Some helpful conversions:
1 bohr = 1 a.u. (atomic unit) = 0.529177249 angstroms.
1 Rydberg = 13.6056981 eV
1 eV =1.60217733 x 10-19 Joules
For all first-principles calculations, you must pay attention to two convergence parameters. The first one is the energy cutoff, which is the max kinetic energy used in wave-function expansion. The second is the number of k-points, which measures how well the continuous integral over the BZ is discretized.
Diamond is a face-centered cubic structure with two C atoms at 0 0 0 and 0.25 0.25 0.25 a is the lattice parameter
Now let's see in detail how a QE input is structured to make a total energy calculation for this system. An example can be found in ~/LabQSM/LAB_1/test_diamond/scf.diamond.in that you can read e.g. using the editor vi
:
Input file description
&CONTROL prefix='diamond', calculation = 'scf' restart_mode='from_scratch', pseudo_dir = './pseudo/' outdir = './SCRATCH' / &SYSTEM ibrav = 2, celldm(1) = 6.7402778 nat = 2, ntyp = 1, ecutwfc = 40.0 / &ELECTRONS mixing_mode = 'plain' mixing_beta = 0.7 conv_thr = 1.0d-8 / ATOMIC_SPECIES C 12.011 C.pz-vbc.UPF ATOMIC_POSITIONS (alat) C 0.00 0.00 0.00 C 0.25 0.25 0.25 K_POINTS {automatic} 4 4 4 0 0 0
The input file for PWscf is structured in a number of NAMELISTS and INPUT CARDS:
&NAMELIST1 ... / &NAMELIST2 ... / &NAMELIST3 ... / INPUT_CARD1 .... .... INPUT_CARD2 .... ....
The use of NAMELISTS allows to specify the value of an input variable, not all the variables need to be specified, for most variable, a default value is assigned. Variable can be inserted in any order. NAMELISTS are read in a specific order. INPUT CARDS are specific of QuantumESPRESSO codes and are used to provide input data that are always needed.
There are three mandatory NAMELISTS:
- &CONTROL: variables that control the kind of calculation (here scf), where to get the pseudopopotentials, and the verbosity needed in the output.
- &SYSTEM: variables specifying the system as the crystal structure, number of atoms, dimension of the basis set.
- &ELECTRONS variables controlling the algorithm to solve the Kohn-Sham equations.
Next, we have three mandatory INPUT CARDS:
- ATOMIC_SPECIES : name, mass and pseudopotential file
- ATOMIC_POSITIONS: atom type and coordinate in the unit cell
- K_POINTS: definition of the k point grid for the BZ integration
Other NAMELISTS relative to other kinds of calculations as relaxations, cell relaxations and other INPUT CARDS will be shown later.
The complete list of QE variables can be found in the documentation of the code at: | http://www.quantum-espresso.org/Doc/INPUT_PW.html
Now that we know how a QE input looks like let's run it and see what the code does and analyze the output:
Running pw.x
Let's create a working directory e.g.
mkdir diamond
and copy in this directory the scf.diamond.in input file we have inspected.
Now you can run the pw.x executable as:
$> pw.x < scf.diamond.in > scf.diamond.out
It is also possible to run in parallel:
$> export OMP_NUM_THREADS=2 #we use 2 threads $> pw.x < scf.diamond.in > scf.diamond.out
or
$> mpirun -np 2 pw.x < scf.diamond.in > scf.diamond.out #we use 2 processors
Several files will be generated in ./SCRATCH, most of them needed mainly for post-processing now let's have a look to the readable output (scf.diamond.out).
Output file description
We can now inspect the output (scf.diamond.in > scf.diamond.out) using vi/more/less command. We found:
A recap of the configuration that is being calculated:
bravais-lattice index = 2 lattice parameter (alat) = 6.7403 a.u. unit-cell volume = 76.5550 (a.u.)^3 number of atoms/cell = 2 number of atomic types = 1 number of electrons = 8.00 number of Kohn-Sham states= 4 kinetic-energy cutoff = 40.0000 Ry charge density cutoff = 160.0000 Ry convergence threshold = 1.0E-08 mixing beta = 0.7000 Exchange-correlation= SLA PZ NOGX NOGC
Deatailed information of the unit cell:
celldm(1)= 6.740278 celldm(2)= 0.000000 celldm(3)= 0.000000 celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000
crystal axes: (cart. coord. in units of alat) a(1) = ( -0.500000 0.000000 0.500000 ) a(2) = ( 0.000000 0.500000 0.500000 ) a(3) = ( -0.500000 0.500000 0.000000 )
reciprocal axes: (cart. coord. in units 2 pi/alat) b(1) = ( -1.000000 -1.000000 1.000000 ) b(2) = ( 1.000000 1.000000 1.000000 ) b(3) = ( -1.000000 1.000000 -1.000000 )