a quick introduction to quantum espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/main.pdf6...

32
A quick introduction to Quantum Espresso Simone di Cataldo September 27, 2019 Contents 1 Preamble 3 2 Density Functional Theory 3 2.1 What can we calculate with DFT? ................. 5 2.2 What can’t we calculate with DFT? ................ 5 3 The Quantum Espresso distribution 6 3.1 How to install ............................. 6 3.2 Packages ................................ 7 4 Running a DFT calculation 8 4.1 Understanding the calculation .................... 8 4.1.1 Energy Cutoff ......................... 9 4.1.2 Pseudopotential ....................... 10 4.1.3 Brillouin zone sampling ................... 10 4.1.4 Phonon calculations ..................... 10 5 Input files, explained 11 5.1 The must-do calculation (ground state charge density) ...... 11 5.1.1 Example, method 1 ..................... 12 5.1.2 Example, method 2 ..................... 13 5.2 Band structure ............................ 15 5.2.1 Example, part 1 ....................... 16 5.2.2 Example, part 2 ....................... 17 5.3 Density of states ........................... 18 5.3.1 Example, part 1 ....................... 19 5.3.2 Example, part 2 ....................... 20 5.4 Phonons ................................ 21 5.4.1 Example, part 1 - calculate dynamical matrices ...... 22 5.4.2 Example, part 2 - calculate interatomic force constant .. 22 5.4.3 Example, part 3 - calculate the phonon density of states . 22 5.4.4 Example, part 4 - calculate the phonon dispersions .... 22 2

Upload: others

Post on 14-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

A quick introduction to Quantum Espresso

Simone di Cataldo

September 27, 2019

Contents1 Preamble 3

2 Density Functional Theory 32.1 What can we calculate with DFT? . . . . . . . . . . . . . . . . . 52.2 What can’t we calculate with DFT? . . . . . . . . . . . . . . . . 5

3 The Quantum Espresso distribution 63.1 How to install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.2 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Running a DFT calculation 84.1 Understanding the calculation . . . . . . . . . . . . . . . . . . . . 8

4.1.1 Energy Cutoff . . . . . . . . . . . . . . . . . . . . . . . . . 94.1.2 Pseudopotential . . . . . . . . . . . . . . . . . . . . . . . 104.1.3 Brillouin zone sampling . . . . . . . . . . . . . . . . . . . 104.1.4 Phonon calculations . . . . . . . . . . . . . . . . . . . . . 10

5 Input files, explained 115.1 The must-do calculation (ground state charge density) . . . . . . 11

5.1.1 Example, method 1 . . . . . . . . . . . . . . . . . . . . . 125.1.2 Example, method 2 . . . . . . . . . . . . . . . . . . . . . 13

5.2 Band structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155.2.1 Example, part 1 . . . . . . . . . . . . . . . . . . . . . . . 165.2.2 Example, part 2 . . . . . . . . . . . . . . . . . . . . . . . 17

5.3 Density of states . . . . . . . . . . . . . . . . . . . . . . . . . . . 185.3.1 Example, part 1 . . . . . . . . . . . . . . . . . . . . . . . 195.3.2 Example, part 2 . . . . . . . . . . . . . . . . . . . . . . . 20

5.4 Phonons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.4.1 Example, part 1 - calculate dynamical matrices . . . . . . 225.4.2 Example, part 2 - calculate interatomic force constant . . 225.4.3 Example, part 3 - calculate the phonon density of states . 225.4.4 Example, part 4 - calculate the phonon dispersions . . . . 22

2

Page 2: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

6 Example: result 23

1 PreambleThis short introduction is meant to give other students a basic understandingin Density Functional Theory (DFT) and Quantum Espresso (QE). Althoughthere are a lot of resources on DFT online, these are often either too superficial,or too in depth. Here we will try to find a compromise between the two, andprovide guidelines to get a calculation done with some understanding of whatis happening inside the "DFT black box". It would be impossible to give anexhaustive explanation, for which I’ll recommend references in the text.

I strongly recommend to anyone interested in this topic the introductorylecture of prof. Paolo Giannozzi (one of the fathers of Quantum Espresso), whichyou can find on YouTube (https://youtu.be/1AH2pkijDPg) [8]. It lasts aboutone hour and gets you through the theory very quickly. It covers many importantaspects, as good as it can be done in one hour. You may also be interested inthe second video of the channel (Density Functional Perturbation Theory, usedfor phonon calculations) and in the third video (specific implementation of DFTin Quantum Espresso)

An in-depth treatment of basic DFT is also given in A Primer in DensityFunctional Theory [7]. It is way too long for a simple project, but it can bea useful reference. The two founding papers for DFT (Hohenberg and Kohntheorem, and Kohn and Sham theorem) are also listed in bibliography [10, 11].

2 Density Functional TheoryDensity Functional Theory (DFT) is by far the most popular quantum mechan-ical modeling method for solid state physics. The main reason is its quite goodaccuracy compared to its computational cost. As suggested by its name, inDFT all the relevant physical quantities can be expressed as a functional of theelectron density.

To understand why this is an advantage, let’s consider the electronic Hamil-tonian in a solid, within the Born-Oppenheimer (BO) approximation. Since weonly care about the electrons, we neglect the ion-ion interaction and the ionickinetic energy.

H = −∑i

~2∇2i

2m−∑iJ

ZJe2

4πε0|~ri − ~RJ |+

1

2

∑i 6=j

e2

4πε0|~ri − ~rj |(1)

where ~r is the position of the electron and ~R is the position of the ion. The threeterms on the right hand side of the equations are the electronic kinetic energy,the ion-electron interaction and the electron-electron interaction, respectively.As it will occur later, it is useful to mention now that we can think of the ion-electron interaction as if the fixed ions generate an external potential, whichacts on the electrons.

3

Page 3: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

If we want to describe our N-electron system then we have to solve theSchrödinger’s equation

HΨ = EΨ (2)

where Ψ is the wavefunction of the N-electron system, and E is its total energy.Now, Ψ has to describe N electrons, with N≈ 1023, and each electron has 3degrees of freedom, so Ψ depends on 3N variables. Instead if we can express thetotal energy E as a functional of the electron density n(~r), we have E = E[n(~r)],where n is a function of only three variables. The first Hohenberg and Kohntheorem states that, in fact, this is possible [10]. From an analytical perspectivethe problem is not simpler, because the explicit functional dependence of Efrom n is not known, but from a numerical point of view, things are incrediblysimpler.

In particular, the second Hohenberg and Kohn theorem states that for aconstant number of electrons N, the electron density n(~r) which minimizes E[n]has to be the ground state electron density of the N-electron system [10]. Thisimplies that we can start from an arbitrary n0(~r) and follow a minimizationprocedure until we find the minimum of E[n]. When E is minimized, n will bethe correct ground-state electron density 1.

So far we realized that it is possible to express the total energy of the systemas a functional of the electron density, and a variational principle guarantees thatwe can find a (unique) solution for the energy of the system, but we have noidea on how this could be done. The next step is to observe that the Hohenbergand Kohn theorems do not have any requirements on the Hamiltonian of thesystem, i.e. they are also valid for an Hamiltonian without electron-electroninteraction. This property is exploited by Kohn and Sham, which arrive tothe following conclusion: it is possible to represent the ground state densityn(~r) of the interacting N-electron system (with Hamiltonian (1)) as the groundstate density of a non-interacting system of N electrons in a fictitious externalpotential, called self-consistent potential (vscf ), constructed in such a way thatthe correct ground state density is reproduced [11]. This conclusion representsan immense advantage, because whenever electrons are non-interacting we candecouple the Schrödinger’s equation in N independent equations (also calledKohn&Sham equations), solve them one by one to obtain the single particleorbitals (also called Kohn&Sham orbitals) and from those calculate the groundstate charge density. {

−~2∇2

2m+ vscf (~r)

}ψi(~r) = εiψi(~r) (3)

Once the ψ are known, I can construct the ground state electron density bysumming over the square modulus of the non-interacting Kohn&Sham (KS) ψ,i.e. n(~r) =

∑Ni=1 |ψi(~r)|2. Note that n is the same for both the interacting and

non-interacting system!Within suitable approximations on the dependence of the total energy on

the electron density (especially for the so-called exchange-correlation energy),1The first Hohenberg and Kohn theorem guarantees that the solution is unique

4

Page 4: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

the form of vscf (~r) can be constructed starting from the ionic positions and theelectron density n(~r). Note that n(~r) is both a required ingredient to constructthe Hamiltonian, and one of the results we are interested into! The solution hasto be reached using a self-consistent algorithm: we start from a trial densityn0(~r), construct vscf (~r), solve (3), calculate n1(~r) and so on, until our resultsdo not change from one cycle to another (i.e. we achieved "self consistency").The self consistent (SCF) loop is the central loop in any DFT code.

2.1 What can we calculate with DFT?DFT can be used to calculate the ground state energy of a system, and theeigenvalues εi of the single-particle equation give the dispersion relationshipε(~k), as will be clarified later. 2.

Moreover, a perturbative approach to DFT (called Density Functional Per-turbation Theory) can be used to calculate the n-th order derivatives of thetotal energy with respect to a perturbation, which gives quantities such as theforces acting on each atom, pressure, phonon frequencies, and so on. It makesuse of the Hellman-Feynman theorem for first derivatives and its extension, the2n+1 theorem, for higher order derivatives.

In short, we can reliably calculate:

• Total energy of a given structure

• Band structure, density of states

• Forces acting on each atom, stress tensor

• Elastic properties

• Phonon frequencies (within the harmonic approximation)

• Electric polarizability, Raman and Infrared activity

• Electron-phonon coupling, superconducting Tc

2.2 What can’t we calculate with DFT?DFT is a ground-state theory, therefore it fails to calculate time-dependentproperties, such as excited states or response to time-dependent fields. There isa complicated extension to the theory which does that (Time-dependent DensityFunctional Theory).

It is very difficult to describe localized states within DFT. Atoms with local-ized d or f orbitals such as some transition metals, actinides, and lanthanides,can be problematic. Calculations with these elements should be carried outcarefully, and results should be examined critically.

2From a formal point of view there is no direct correspondence between the eigenvalues ofthe single particle equations and the eigenvalues of the full, interacting equation. Howeverthere is very often a good correspondence, and DFT bands are nowadays accepted as a goodestimate of the real bands.

5

Page 5: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

3 The Quantum Espresso distributionQuantum Espresso is an integrated suite of Open-Source computer codes forelectronic-structure calculations and materials modeling at the nanoscale. It isbased on density-functional theory, plane waves, and pseudopotentials. [2].

We will worry about plane waves and pseudopotentials in section 4.1. Fornow it is enough to say that Quantum Espresso is an ensemble of programs whichcan be used to calculate the properties listed in 2.1. The installation can be abit tricky if you are not familiar with bash. The following instructions for instal-lation will work for most Linux distributions and Mac OSX. For the latter youfirst need to install the command line tools (go to https://developer.apple.com/downloads/index.action, register and download command line tools).

3.1 How to install1. Go to https://gitlab.com/QEF/q-e/tags

2. Download the latest version by clicking on the cloud with a down arrow(.zip or .tar format)

3. Unpack the downloaded folder

4. With the terminal, change directory into the newly created folder (e.g. cd/home/Downloads/q-e-qe-X.X.X/)

5. I recommend installing the parallel environment OpenMPI. Although thisis not strictly necessary, it allows you to use multiple processors to speedup the calculations.

6. Execute "configure" script by typing "./configure". This does most of thework for you, as it checks whether you have the necessary libraries.

7. If a library or a compiler is missing, it will give an error

8. Copy the name of the missing library on google and find a package whichcontains it (Stack Exchange is your friend)

9. Linux systems: type "sudo apt-get update", then "sudo apt-get upgrade",then "sudo apt-get install NAME_OF_PACKAGE"

10. Max OSX systems: you may need to install macports or homebrew, andthen do "sudo port install NAME_OF_PACKAGE" or "brew installNAME_OF_PACKAGE"

11. Once all the necessary libraries are there, the script will finish with success

12. Execute the command "make all"

13. Again, if you do not have "make" installed, you can install it via apt-get(Linux) or homebrew (OSX)

14. The code will be compiled, and executables copied into the q-e-qe-X.X.X/bin/folder. In order to get access to the executables from anywhere, you haveto add them to the $PATH variable

6

Page 6: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

15. Open the file ".bashrc" or ".bash_profile" in your home folder with anytext editor. This is a hidden file, so you need to open it from the terminal,typing "vim /home/.bashrc" or "emacs /home/.bashrc"

16. Add the line "export PATH=$PATH:/path/to/qe-folder/bin/" (e.g. ex-port PATH=$PATH:/home/Downloads/q-e-qe-X.X.X/bin) to your .bashrcor .bash_profile folder

17. Close and re-open the terminal (it will force it to load the new settings)

18. Try to type "pw.x" and press enter. If you did everything correctly, theprogram pw.x should start (you can kill it with ctrl+c)

3.2 PackagesThere are a lot of executables inside the q-e-qe-X.X.X/bin/, here’s a short (notexhaustive) list, with a short description. More details on how to use each codeare described in section 4.

• pw.x

• It is by far the main and most important: it executes the self consistentcalculation to find the ground state charge density. It can also minimizeforces to find the optimal structure from a given set of atomic positions.The results of this calculation are the starting point for any other calcu-lation.

• dos.x

• A small script which sums over the eigenvalues obtained by pw.x to getthe density of states

• bands.x

• Another small script which collects the output of a special pw.x calcula-tion, and produces a data file to plot the bands

• ph.x

• A code which uses Density Functional Perturbation Theory to calculatethe dynamical matrix at different ~q points in the Brillouin zone (BZ). Thedynamical matrices are used by other executables to calculate the phonondispersions. It can also calculate the electron-phonon coupling.

• q2r.x

• A small script which transforms the dynamical matrices (reciprocal space)to the interatomic force constant matrices (real space). It is an interme-diate step to calculate the phonon dispersion relationship

• matdyn.x

• A small script which takes the interatomic force constant matrix and in-terpolates them on a given path in the BZ. Used to calculate the phonondispersions.

7

Page 7: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

• pp.x

• A post processing tool to plot various observables (charge density, wavefunctions, self-consistent potential and so on)

• plotband.x

• A useful tool to collect the result of a band structure calculation andtransform it into a gnuplot-readable file

I also recommend the installation of a visualization software. Xcrysden isthe most integrated with Quantum Espresso, and can be installed by just typing"sudo apt-get install xcrysden" (Linux) or "sudo port install xcrysden" (MacOSX, once macports is installed).

To visualize the structure open an output file of QE by typing "xcrysden–pwo output_file.out"

Another very nice visualization software is VESTA (http://jp-minerals.org/vesta/en/). It is less integrated with Quantum Espresso, but it has muchbetter graphical options to make good-looking structures.

4 Running a DFT calculationRunning a calculation requires an input file for each package, containing infor-mation on the configuration of ions (unit cell, atomic positions) plus some othernumerical parameters, and a pseudopotential file for each element in the inputfile. I recommend reading the next section ("Understanding the calculation")to get a feeling of what each of these parameters mean. If you don’t care andyou just want to crunch some numbers, I have provided an example for eachcalculation. The examples show calculations for the cubic phase of copper.

Once the input file is ready, execute the command"pw.x < input_file.in > output_file.out"The following command reads the file "input_file.in" and redirects it to pw.x

as if you were typing it in the terminal. Then, the standard output is redirectedto a file called "output_file.out", so that you can read it.

If you set up a multiprocessor environment you can type"mpirun -np N pw.x input_file.in > output_file.out"where N is the number of cores in your machine (typically 2 or 4).

4.1 Understanding the calculationIn section 2 we saw that with the Kohn and Sham picture we can representour system of N interacting electrons in terms of N noninteracting electrons inan external, self consistent potential, and that this gives rise to a Schrödinger’sequation that can be solved numerically. There are some extra details which areneeded to understand all the parameters that one has to set up into the inputfile.

First and foremost, we consider all of our DFT calculations to be done ina solid, i.e. a system with discrete translational invariance. This implies that

8

Page 8: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

we can use the Bloch theorem. The advantages of using the Bloch theorem aretwo:

1. The Hamiltonian is diagonal in ~k

2. All the calculations can be restricted to a single unit cell

Using Bloch theorem, equation 3 is expressed in the Bloch basis, and definesthe dispersion relationship ε~k(

− ~2

2m(1

i∆ + ~k)2 + vscf (~r)

)u~k(~r) = ε~ku~k(~r) (4)

where ~k is a wave vector belonging to the first Brillouin zone and vscf andu~k(~r) are lattice-periodic functions. This equation should look familiar. If it isnot, I recommend you to read chapter 8 of Aschroft and Mermin’s "Solid StatePhysics" [4]. This equation is saying that not only we can solve a single particleequation, we can also solve it for different values of ~k, as the Hamiltonian isalready diagonal in ~k. For each given ~k we will get a set of εi(~k), which is ourdispersion relationship.

4.1.1 Energy Cutoff

Equation 4 is still a second order differential equation, which needs to be solvednumerically. The easiest way to do it is the following: instead of directly solvingthe solution, we can expand the wave function u~k(~r) as a sum of basis setfunctions, weighed with a coefficient. Then the correct solution is found if onefinds the right coefficients, i.e. if one solves a linear system, which is much easierto do in a machine. In principle one has to consider an infinite sum of basisset functions. In practice, one has to truncate the expansion, including enoughbasis functions to describe all the physics correctly. In Quantum Espresso theexpansion is done in terms of plane waves, which have several advantages.

In the code, the number of plane waves included in the calculation is ex-pressed as a cutoff energy (ecutwfc in the input file). The higher the cutoffenergy, the more plane waves (but also the slower the calculation). The optimalcutoff mostly depends on the element and the size of the cell, and little on thechemical environment. In order to check which cutoff is right for your system,you should run a calculation with different values of the energy cutoff, until thetotal energy converges, i.e. the difference between the total energy, calculatedwith two different cutoff energies is smaller than the required accuracy (typi-cally 1 meV/atom) The total energy cutoff depends on the elements includedin your calculations, and it is bound by the element which requires the highestcutoff. With a cutoff of 60-80 Ry you should be safe for all elements, but I dorecommend checking for convergence, as with some elements need a much lowercutoff.

9

Page 9: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

4.1.2 Pseudopotential

The number of plane waves required can be reduced dramatically by the useof a pseudopotential. In short, a pseudopotential is a modification of the ionicpotential which allows one to greatly reduce the number of plane waves needed,without changing the chemical properties of the atoms. There is an incrediblylarge variety of pseudopotentials, which mostly has to do with the method usedto generate it. The potentials recommended on the website of QE are usuallyall reliable, but unless you know what you’re doing use them at your own risk.

I recommend the Optimized Norm Conserving Vanderbilt (ONCV) poten-tials. You can find a database in the .UPF format (used by Quantum Espresso)at this address http://www.quantum-simulation.org/potentials/sg15_oncv/with almost all elements. These potentials are rather costly (they require a highenergy cutoff) but the are very robust.

4.1.3 Brillouin zone sampling

In the previous section we saw that equation 4 can be solved for a given ~k. Manyelectronic and thermodynamic properties of the solid, however, depend on thedispersion relationship ε~k over the whole Brillouin zone (i.e. for all possiblevalues of ~k in the first BZ). In principle there are infinitely many ~k. In practicewhat the code does is sampling the first BZ (which is a 3D solid) with a discretegrid.

The number of points needed in the grid depends on several factors, and itis not obvious to decide how many to use. In particular, not many k-points areneeded for the ground state charge density, but a lot are needed for the densityof states. In the next sections we’ll see some guidelines on a case-by-case basis.

In order to reduce the number of ~k points needed, the code typically intro-duces a smearing on the occupations, such as the Fermi function at T 6= 0, or aGaussian broadening. Imagine that for every sum involving δ functions, we sumover a Gaussian instead. This helps to greatly speed up convergence. Valuesbetween 0.01 and 0.08 Ry are reasonable for the self-consistent calculation. Thelarger the smearing, the less the ~k points needed, and the faster the calculation.Values too large, however, may give wrong results, especially in semiconductorswhere the conduction band may become occupied. As a first guess, try with0.05 Ry.

4.1.4 Phonon calculations

Phonon calculations are possible within an extension of DFT called DensityFunctional Perturbation Theory (DFPT). The process is, in principle, quitesimple, and it was outlined during the course. First, the equilibrium positions ofthe atoms have to be calculated. Then, using the harmonic approximation, thelinear spring constants are calculated. For an in-depth overview I recommendyou ref. [5], for details on the calculations see section 5.4.

10

Page 10: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

5 Input files, explainedNote: you can also find the input files here [3].

5.1 The must-do calculation (ground state charge density)This is the first step for any calculation you want to do. You need to set thestructure in your input file, then a few more parameters, and run the pw.x code.A complete reference of all the parameters for the input file can be found athttps://www.quantum-espresso.org/Doc/INPUT_PW.html. Also have a lookat the sample input files that follow each section Note: in the input files theexclamation mark is used for comments.

The most starting point is setting up the atomic positions correctly. Followthis workflow, and don’t give up if you cannot make it at first try (it takes somepractice).

1. Look up the structure in a reference, you will need the space group andthe Wyckoff positions. The ".cif" files also contain this information.

2. Look up in Wikipedia which Bravais lattice corresponds to your spacegroup (https://en.wikipedia.org/wiki/List_of_space_groups). Forinstance, space group 71 (or Immm) is a body-centered orthorhombic.Note: for our purpose it is important to check whether it is simple, face-centered, etc.

3. Look up in the input guide (https://www.quantum-espresso.org/Doc/INPUT_PW.html) at the keyword "ibrav" which number corresponds toyour lattice type

4. The "ibrav" instructions also contains useful information on which cellparameters you will need to input (e.g. for a cubic you only need toinput one lattice parameter, for a tetragonal you need to input two, for amonoclinic you need three lattice parameters and an angle, and so on)

5. Provide the cell parameters in the input file. The three axes are called a,b and c, and the angles between them α, β and γ

6. Note: The format might be not intuitive. The first cell parameter (celldm(1))has to be in Bohr. Then celldm(2) and celldm(3), if needed, have to be ex-pressed as the ratio b/a and c/a, respectively. Finally, celldm(4), celldm(5)and celldm(6), if needed, are the cosine of the angles α, β and γ

7. Add the atomic coordinates (see below)

There are mostly two methods to provide the atomic coordinates. Usuallyin literature only the inequivalent positions of atoms are given, and the fullstructure has to be reconstructed by symmetry operations (or a program thatdoes it for you). The same is true also for crystallographic information files(".cif"). The first method is to directly add the space group in the input file("space_group = ###"), and then only give the inequivalent positions for theatoms, with their Wyckoff position. The second method is to use a software

11

Page 11: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

like VESTA to reconstruct the cell, and then export it in a format where allthe coordinates are explicitly given (such as ".vasp" extension), and the cellis described by the three lattice vectors. With symmetric structures the firstmethod is usually very easy and fast, while the second is more automatic forstructures with low symmetry.

Note: in the input file you have to specify the "number of atoms" in the cell.Actually, when you use the first method you need to specify only the number ofatoms given in input (which is going to be less, as the others are generated bysymmetry!)

In the output file of the self consistent calculation, an estimate for the Fermienergy will be given. Look into the output file (or into the standard output) forthe keyword "Fermi" (capital F is important). Alternatively, if you redirectedthe standard output to a file, you can type from the terminal "grep ’Fermi’output_file_name". Note that this number makes sense only in a metal. In aninsulator the code will still print a "Fermi energy", which has no meaning, noteven the chemical potential.

5.1.1 Example, method 1

In a paper the information on the crystal structure would look like this ([9, 6])

Space group: 225 (Fm− 3m)Atom Wyckoff position CoordinatesCu 4a (0,0,0)

The position of the atoms, given this symmetry, do not require to specify anycoordinates (there is no free parameter). This can be checked by visiting againthe Bilbao Crystallographic Server at the subpage for Wyckoff positions (http://www.cryst.ehu.es/cryst/get_wp.html). The page requires the input of thespace group, and returns all the Wyckoff positions for that space group, withthe specification of which coordinates are fixed by symmetry, and which haveto be given. See a sample input file in the next page.

12

Page 12: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

5.1.2 Example, method 2

We can reconstruct the above crystal structure in a program like VESTA, andexport it into the ".vasp" format, which looks as follows:

The first three vectors are the lattice vectors (in Å). Then, there is a lineexpressing to which element each line refers to, and last there are the atomiccoordinates, in units of the lattice vectors. Note that in this case the numberof atoms written in the input file reflects the number of atoms in the unit cell.The input file is below.

13

Page 13: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

&control ! Input file is divided in sections, depending on thevariables affected. This mostly affects file i/o and cal-culation type.

calculation = ’scf’ ! Which type of calculation has to be performed (scf =self consistent field)

outdir = ’./output’ ! Path to the folder to store the output files. The nextcalculations will have to read into this folder, so checkthat the path is correct

pseudo_dir = ’/home/simonedicataldo/QE-pseudopotentials/’prefix = ’Cu’ ! It’s a label for the calculation. Has to be the same

when you read into the output folder in a subsequentcalculation.

tstress = .true. ! Calculates and prints the stress tensor (if .true.)tprnfor = .true. ! Calculates and prints the forces acting on each atom

(if .true.)forc_conv_thr = 1e-5&end

&systemibrav = 2 ! Explained above. 6 is for simple tetragonal, 2 is for

fcc and so oncelldm(1) = 6.90 ! Units for celldm(1) are Bohr (1 Bohr ≈ 1.89 Å)space_group = 225 ! Space group number. Needed in order to input coor-

dinates using Wyckoff positionsnat = 1 ! Number of atoms in the atomic coordinatesntyp = 1 ! How many different atomic species there are! nbnd = 16 ! You can change the number of bands included, but

be careful, there have to be a few more than half thenumber of electrons

ecutwfc = 120 ! Very important! Cutoff energy on the plane wavesexpansion.

occupations = ’smearing’ ! Using a smearing on the occupations so that we needless k points

smearing = ’mp’ ! Type of smearingdegauss = 0.02 ! Width of smearing (in Ry)&end&electronsconv_thr = 1.D-8 ! Convergence threshold on scf calculation&end&ions ! Ignored in scf calculations, only used in "relax" and

"vc-relax" calculationsion_dynamics = ’bfgs’&end&cell ! Ignored in scf calculations, only used in "vc-relax"

calculationscell_dynamics = ’bfgs’press = 0 ! Pressure to be applied to the cell for high-pressure

calculations. It is in kilobar (1 kB = 0.1 GPa)&endATOMIC_SPECIESCu 63.54 Cu_ONCV_PBE_sr.upf

ATOMIC_POSITIONS crystal_sg ! The crystal_sg command is used to determine theatomic positions from Wyckoff positions

Cu 4a ! Since the position of Cu is determined unequivocallyfrom the Wyckoff positions, no coordinates should bewritten

K_POINTS automatic4 4 4 0 0 0 ! The first three numbers determine how many ~k points

in each direction have to be used.

14

Page 14: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

New structure1.03.5999999046 0.0000000000 0.00000000000.0000000000 3.5999999046 0.00000000000.0000000000 0.0000000000 3.5999999046Cu4Direct0.000000000 0.000000000 0.0000000000.000000000 0.500000000 0.5000000000.500000000 0.000000000 0.5000000000.500000000 0.500000000 0.000000000

5.2 Band structureIn order to calculate the bands in a way that can give a nice plot, one has tocalculate the eigenvalues of the equation (4) for a specific set of values of ~k. Inparticular, we want to construct a path in ~r space which connects all the highsymmetry points of the Brillouin zone, and then calculate ε~k for this path. Notethat this approach can not come out of a self-consistent calculation, becausehere we are only sampling a line into a 3D space. What we can do is

1. Perform a self-consistent calculation to get the correct ground state chargedensity and self-consistent potential (see 5.1)

2. Solve equation (4) with the potential obtained in the previous calculationon the desired path in ~k space

3. This is done by using "pw.x", selecting "bands" as the type of calculation,and giving the path in the Brillouin zone as input

4. Collect the result of the previous calculation into a data file

5. Done by the simple script "bands.x". It produces a file with the extension".gnu" which contains the linearized path (in units of 2π

a ) in ~k space on thefirst column, and the corresponding energy (in eV) on the second column.

The high-symmetry points in the Brillouin zone depend on the space groupof our system. Once the coordinates of these points are known, the path isautomatically generated by QE by using a special option in the k-points set-ting (crystal_b, for crystal coordinates), which only requires the coordinates ofthe special points and the number of intermediate points between each specialpoint. These coordinates can be obtained by visiting the Bilbao CrystallographicServer (http://www.cryst.ehu.es/cryst/get_kvec.html) and entering thespace group number of our system. Here the coordinates and names of thehigh-symmetry points are given, as well as a 3D representation of the BZ. As arule of thumb, you want to figure out a path which visit all the high-symmetrypoints via high-symmetry lines, without passing along the same line twice.

15

Page 15: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

5.2.1 Example, part 1

First run a self-consistent calculation (see "The must-do calculation", section5.1). Then run pw.x again with the "bands" option (solve Schrödinger’s equa-tion on a given path in reciprocal space). A sample input file is in the nextpage

16

Page 16: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

5.2.2 Example, part 2

Then collect the result running the script "bands.x" The output, "Cu.bands.gnu’contains the plottable data!

17

Page 17: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

5.3 Density of statesMathematically the energy dependent density of states is obtained from thedispersion relationship ε(~k) using the formula

dos(ε) =

∫d3k

(2π)3δ(ε− ε(~k)) (5)

The above formula is mathematically sound, but not directly applicable in acomputational algorithm. In fact, the sum on the left is obtained as an infinitesum of infinitely narrow functions (the δ functions). In practice one eithersubstitutes the δ functions with a function of finite width (like a gaussian), oruses an interpolation method (the tetrahedron method). For the purpose ofcalculating the density of state, the tetrahedron method is by far more efficient,although it still needs a large number of ~k points in order to give a smoothdensity of states.

There is a trick which allows one to use a very fine grid of ~k points without toomuch computational effort. The trick exploits the fact that the self-consistentpotential and the ground state charge density need a relatively small number of~k points to converge. It works as follows

1. Perform a self-consistent calculation to get the correct ground state chargedensity and self-consistent potential (see 5.1). Here you do not need a lotof ~k points. As a result, you will obtain the correct self-consistent potentialand charge density.

2. Perform a non-self-consistent calculation, which starts from the potentialobtained in the previous step. Now you will use the tetrahedron method,and a large number of ~k points. This can be done using the "pw.x" code,selecting a calculation of type "nscf", occupation "tetrahedra", and a fine~k grid

3. Collect the results using the "dos.x" script. It outputs a dos file, which isa three columns file containing the energy on the first column, the densityof states (states/eV) on the second column, and the integral of the densityof states on the third column.

The method discussed above is much faster, as equation (4) on the fine ~k gridonly needs to be solved once!

18

Page 18: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

5.3.1 Example, part 1

First run a self-consistent calculation (see "The must-do calculation", section5.1). Then, run pw.x again, with the option "nscf", using the tetrahedronmethod for occupations, and a much denser ~k grid.

19

Page 19: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

5.3.2 Example, part 2

Once the non self consistent calculation has finished, run the "dos.x" script tocollect the results. See the sample input file in the next page. This will producea plottable file called "Cu.dos.dat".

20

Page 20: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

5.4 PhononsThe calculation of phonon dispersions requires several steps and, in general, ittakes much longer than a self-consistent calculation. It is articulated in thefollowing steps:

1. Check that the ions are in their equilibrium positions! Forces should beclose to zero, stress tensor should be diagonal, and all diagonal componentsshould be the same (homogeneous pressure). You may want to use the’relax’ option (see 5.1). Since we want to perturb the atomic positionsw.r.t. equilibrium, we first want to make sure that the atomic positionsare at equilibrium, i.e. each component of the force acting on atoms is ofthe order of (or less than) 1 meV/atom.

2. Calculate the ground state charge density with the equilibrium positionsof the ions (see 5.1).

3. Calculate the dynamical matrices in reciprocal space on a grid (usingph.x). 3 In this step the code performs a small displacement of theatoms, and calculates the resulting perturbation on the potential and onthe charge density. Within linear response theory (see [5]) the dynamicalmatrices are calculated. The strength of QE lies in the fact that thedynamical matrices are calculated directly in reciprocal space, thereforethere is no need of constructing a supercell.

4. Calculate the force constants from reciprocal to real space (using q2r.x),which simply means that a Fourier transform is performed, from the dy-namical matrix (reciprocal space), to the force constant matrix (real space)

5. Interpolate on a dense grid in reciprocal space to calculate phonon densityof states (using matdyn.x)

6. Interpolate on a line in reciprocal space to calculate phonon dispersionrelationship (using matdyn.x)

The last two points are the so-called Fourier interpolation. Imagine we havea function F (~q) which is calculated in reciprocal space on a finite grid ~qi. Wecan calculate the inverse-Fourier transform f(~r) = 1

(2π)3

∑Ni=1 F (~qi)e

i~qi~r. Evenif our grid contains a few points, we can perform this Fourier transform foran arbitrarily dense ~r grid. Then if we want to know F (~q) at a specific ~q, wejust need to calculate the Fourier transform F (~q) =

∑~r f(~r)e−i~q~r. This kind

of interpolation is much more efficient than directly interpolating in reciprocalspace, so that reasonable phonon dispersions can be obtained with very smallgrids.

The dynamical matrices calculated by ph.x are the Fourier transform of theforce constant matrix (the linear spring system between atoms in real space).This allows one to calculate the perturbations to the atomic positions without

3Note: this grid has nothing to do with the ~k grid of the scf calculation, except that itsamples the same Brillouin zone.

21

Page 21: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

the need of a supercell to describe long-wavelength modes. In order to getthe phonon dispersions one uses the tool q2r.x to transform these dynamicalmatrices into the force constant matrix (which is defined in real space). Thenthe force constant matrix can be either read by an external tool, or read by thebuilt-in tools of Quantum Espresso. The tool matdyn.x reads the interatomicforce constant matrix to calculate the dynamical matrix at a given point inreciprocal space. The points can be defined on a fine grid (to calculate thephonon density of states) or on a path between high-symmetry points in theBrillouin zone (to plot the phonon dispersions).

5.4.1 Example, part 1 - calculate dynamical matrices

First perform a self-consistent calculation (see 5.1). Try to optimize the pa-rameters so that the self consistent calculation is fast (less than two or threeminutes) or the phonon calculation will take a very long time.

Execute the code ph.x

5.4.2 Example, part 2 - calculate interatomic force constant

Execute the code q2r.x (it reads the files in the folder where it is executed).An explanation of the contents of the fc file can be found at [1]. This is only

needed if you want to use your own tools to read it.

5.4.3 Example, part 3 - calculate the phonon density of states

Now we can read the interatomic force constant file to calculate the phonondensity of states. Run matdyn.x with the flag ’dos = .true.’. A file named"matdyn.dos" will be produced. The first column contains the energies (incm−1), while the second contains the dos (states/cm−1).

5.4.4 Example, part 4 - calculate the phonon dispersions

This produces a file named "Cu.phbands.gp" which contains a gnuplot-friendlydata structure which you can plot. Note: the first column contains the energies(in cm−1), while the n following columns contain a phonon branch each.

If one or more of your modes display negative frequencies, it means that yoursystem is dynamically unstable. This may have a few different causes. It mightbe because of an actual physical instability, but more likely your calculationis not converged (try using a larger smearing) or the atoms in your unit cellare not at their equilibrium positions (check that the forces between atoms areless than 10−4 Ry/au and that the stress tensor is diagonal and all diagonalelements are equal).

22

Page 22: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

6 Example: resultUsing the input files and the pseudopotentials provided, you should in the endobtain this band structure and density of states. This plot was made usingxmgrace, but you can use any plotting tool you’re comfortable with.

23

Page 23: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

Γ X W L Γ X

-10

-5

0

5

ε−

εV

BM

(e

V)

Cu - Fm-3m

0 1 2 3 4DOS (states/spin/eV)

Figure 1: Left panel: band structure calculation for the face centered cubicphase of Cu. Right panel: density of states.

24

Page 24: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

Below we can see the phonon dispersions and phonon density of states forthe fcc phase. Note that in Γ three frequencies go to zero, as expected.

Γ X W L Γ X0

400

ω (

cm

-1)

Cu - Fm-3m

0 0.05DOS (states/eV)

Figure 2: Left panel: Phonon dispersion for the face centered cubic phase ofCu. Right panel: phonon density of states.

25

Page 25: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

References[1] Discussion on the interatomic force constant matrix in the qe forum.

[2] https://www.quantum-espresso.org.

[3] Input files for qe downloadable here.

[4] N. W. Ashcroft and Mermin. Solid State Physics. Saunders College Pub-lishing, 1976.

[5] Stefano Baroni, Stefano de Gironcoli, Andrea Dal Corso, and Paolo Gi-annozzi. Phonons and related crystal properties from density-functionalperturbation theory. Reviews of Modern Physics, 73:515, 2001.

[6] Robert A. Evarestov and Andrei V. Bandura. First-principles calculationson the four phases of batio3. Journal of Computational Chemistry, 33:1123–1130, 2012.

[7] C. Fiolhais, F. Nogueira, and M. Marques. A Primer in Density FunctionalTheory. Springer, 2003.

[8] Paolo Giannozzi. Introduction to density functional theory (dft).

[9] J. Harada, T. Pedersen, and Z. Barnea. X-ray and neutron diffraction studyof tetragonal barium titanate. Acta Cryst., A26:336, 1970.

[10] P. Hohenberg and W. Kohn. Inhomogeneous electron gas. Phys. Rev.,136(3B):B864–B871, 1964.

[11] W. Kohn and L. J. Sham. Self-consistent equations including exchange andcorrelation effects. Phys. Rev., 140(4A):A1133–A1138, 1965.

26

Page 26: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

&control ! Input file is divided in sections, depending on thevariables affected. This mostly affects file i/o and cal-culation type.

calculation = ’scf’ ! Which type of calculation has to be performed (scf =self consistent field)

outdir = ’./output’ ! Path to the folder to store the output files. The nextcalculations will have to read into this folder, so checkthat the path is correct

pseudo_dir = ’/home/simonedicataldo/QE-pseudopotentials/’prefix = ’Cu’ ! It’s a label for the calculation. Has to be the same

when you read into the output folder in a subsequentcalculation.

tstress = .true. ! Calculates and prints the stress tensor (if .true.)tprnfor = .true. ! Calculates and prints the forces acting on each atom

(if .true.)forc_conv_thr = 1e-5&end

&systemibrav = 0 ! Explained above. 6 is for simple tetragonal, 2 is for

fcc and so oncelldm(1) = 6.90 ! Units for celldm(1) are Bohr (1 Bohr ≈ 1.89 Å)nat = 4 ! Number of atoms in the atomic coordinatesntyp = 1 ! How many different atomic species there are! nbnd = 16 ! You can change the number of bands included, but

be careful, there have to be a few more than half thenumber of electrons

ecutwfc = 120 ! Very important! Cutoff energy on the plane wavesexpansion.

occupations = ’smearing’ ! Using a smearing on the occupations so that we needless k points

smearing = ’mp’ ! Type of smearingdegauss = 0.02 ! Width of smearing (in Ry)&end&electronsconv_thr = 1.D-8 ! Convergence threshold on scf calculation&end&ions ! Ignored in scf calculations, only used in "relax" and

"vc-relax" calculationsion_dynamics = ’bfgs’&end&cell ! Ignored in scf calculations, only used in "vc-relax"

calculationscell_dynamics = ’bfgs’press = 0 ! Pressure to be applied to the cell for high-pressure

calculations. It is in kilobar (1 kB = 0.1 GPa)&endATOMIC_SPECIESCu 63.54 Cu_ONCV_PBE_sr.upf

CELL_PARAMETERS angstrom 3.5999999046 0.0000000000 0.00000000000.0000000000 3.5999999046 0.00000000000.0000000000 0.0000000000 3.5999999046ATOMIC_POSITIONS crystal ! Crystal coordinatesCu 0.000000000 0.000000000 0.000000000Cu 0.000000000 0.500000000 0.500000000Cu 0.500000000 0.000000000 0.500000000Cu 0.500000000 0.500000000 0.000000000K_POINTS automatic4 4 4 0 0 0 ! The first three numbers determine how many ~k points

in each direction have to be used.

27

Page 27: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

Band structure calculation&control ! Input file is divided in sections, depending on the

variables affected. This mostly affects file i/o and cal-culation type.

calculation = ’bands’ ! Which type of calculation has to be performed (scf =self consistent field)

outdir = ’./output’ ! Path to the folder to store the output files. The nextcalculations will have to read into this folder

pseudo_dir = ’/home/simonedicataldo/QE-pseudopotentials/’prefix = ’Cu’ ! It’s a label for the calculation. Has to be the same

when you read into the output folder in a subsequentcalculation.

&end&systemibrav = 2 ! Explained above. 6 is for simple tetragonalcelldm(1) = 6.90 ! Units for celldm(1) are Bohr (1 Bohr ≈ 1.89 Å)space_group = 225 ! Space group number. Needed in order to input coor-

dinates using Wyckoff positionsnat = 1 ! Number of atoms in the atomic coordinatesntyp = 1 ! How many different atomic species there are! nbnd = 16 ! You can change the number of bands included, but

be careful, there have to be a few more than half thenumber of electrons

ecutwfc = 120 ! Very important! Cutoff energy on the plane wavesexpansion.

occupations = ’smearing’ ! Using a smearing on the occupations so that we needless k points

smearing = ’mp’ ! Type of smearingdegauss = 0.04 ! Width of smearing (in Ry)&end&electronsconv_thr = 1.D-8 ! Convergence threshold on scf calculation&endATOMIC_SPECIESCu 65 Cu_ONCV_PBE_sr.upfATOMIC_POSITIONS crystal_sg ! The crystal_sg command is used to determine the

atomic positions from Wyckoff positionsCu 4aK_POINTS crystal_b60 0 0 50!Gamma 0.5 0 0.5 50!X 0.5 0.25 0.75 50!W 0.5 0.5 0.5 50!L 0 0 0 50!Gamma 0.5 0 0.5 50!X

28

Page 28: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

&bandsprefix = ’Cu’ Prefix which has to match that of the previous calcula-

tionsoutdir = ’./output’ Output folder in which data has to be readfilband = ’Cu.bands’ ! Name of the file with plottable data&end

29

Page 29: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

Non self consistent calculation&control ! Input file is divided in sections, depending on the

variables affected. This mostly affects file i/o and cal-culation type.

calculation = ’nscf’ ! Which type of calculation has to be performed (scf =self consistent field)

outdir = ’./output’ ! Path to the folder to store the output files.pseudo_dir = ’/home/simonedicataldo/QE-pseudopotentials/’prefix = ’Cu’ ! It’s a label for the calculation. Has to be the same

when you read into the output folder in a subsequentcalculation.

tstress = .true. ! Calculates and prints the stress tensor (if .true.)tprnfor = .true. ! Calculates and prints the forces acting on each atom

(if .true.)&end&systemibrav = 2 ! Explained above. 6 is for simple tetragonalcelldm(1) = 6.9 ! Units for celldm(1) are Bohr (1 Bohr ≈ 1.89 Å)space_group = 225 ! Space group number. Needed in order to input coor-

dinates using Wyckoff positionsnat = 1 ! Number of atoms in the atomic coordinatesntyp = 1 ! How many different atomic species there are! nbnd = 16 ! You can change the number of bands included, but

be careful, there have to be a few more than half thenumber of electrons

ecutwfc = 120 ! Very important! Cutoff energy on the plane wavesexpansion.

occupations = ’tetrahedra’ ! Using a smearing on the occupations so that we needless k points

&end&electronsconv_thr = 1.D-8 ! Convergence threshold on scf calculation&end&ions ! Ignored in scf calculations, only used in "relax" and

"vc-relax" calculationsion_dynamics = ’bfgs’&end&cell ! Ignored in scf calculations, only used in "vc-relax"

calculationscell_dynamics = ’bfgs’press = 0 ! Pressure to be applied to the cell for high-pressure

calculations. It is in kilobar (1 kB = 0.1 GPa)&endATOMIC_SPECIESCu 63.54 Cu_ONCV_PBE_sr.upfATOMIC_POSITIONS crystal_sg ! The crystal_sg command is used to determine the

atomic positions from Wyckoff positionsCu 4a ! Since the position of Ba is determined unequivocally

from the Wyckoff positions, no coordinates should bewritten

K_POINTS automatic32 32 32 0 0 0 ! The first three numbers determine how many ~k points

in each direction have to be used.

30

Page 30: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

&dosprefix = ’Cu’outdir = ’./output’Emin = -20 ! Starting energy for integrationEmax = 50 ! Final energy for integrationDeltaE = 0.1 ! Energy grid stepfildos = ’Cu.dos.dat’&end

&inputphoutdir = ’./output’prefix = ’Cu’ldisp = .true. ! Calculate dynamical matrices on a grid in reciprocal

spacefildyn = ’Cu.dyn’ ! Prefix for the name of dynamical matricesnq1 = 2, ! Defining a grid of points in reciprocal space to calculate

dynamical matricesnq2 = 2, ! The choice depends on the size and shape of your cellnq3 = 2, !&end

&inputfildyn = ’Cu.dyn’ ! Prefix for the name of dynamical matricesflfrc = ’Cu.fc’ ! Name of interatomic force constant matrix file&end

&inputflfrc = ’Cu.fc’ ! Force constant fileasr = ’crystal’ ! Acoustic sum rule to apply to acoustic modes in gammados = .true. ! Flag to calculate density of statesnk1 = 8, nk2 = 8, nk3 = 8 ! Grid to integrate density of statesdeltaE = 1 ! Energy step, in cm-1&end

31

Page 31: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

&inputflfrc = ’Cu.fc’ ! Interatomic force constant fileq_in_band_form = .true. ! If this option is true, then the points should be provided

belowq_in_cryst_coord = .true. Note: the points are given in the exact same way as a

band structure calculationflfrq = ’Cu.phbands’ ! Name of the output file&end6 ! Number of different points given (in crystal coordinates)0 0 0 50 !Gamma0.5 0 0.5 50 !X0.5 0.25 0.75 50 !W0.5 0.5 0.5 50 !L0 0 0 50 !Gamma0.5 0 0.5 50 !X

32

Page 32: A quick introduction to Quantum Espressolampx.tugraz.at/.../bands/dft/calculations/cataldo/MAIN.pdf6 Example: result 23 1 Preamble This short introduction is meant to give other students

References[1] Discussion on the interatomic force constant matrix in the qe forum.

[2] https://www.quantum-espresso.org.

[3] Input files for qe downloadable here.

[4] N. W. Ashcroft and Mermin. Solid State Physics. Saunders College Pub-lishing, 1976.

[5] Stefano Baroni, Stefano de Gironcoli, Andrea Dal Corso, and Paolo Gi-annozzi. Phonons and related crystal properties from density-functionalperturbation theory. Reviews of Modern Physics, 73:515, 2001.

[6] Robert A. Evarestov and Andrei V. Bandura. First-principles calculationson the four phases of batio3. Journal of Computational Chemistry, 33:1123–1130, 2012.

[7] C. Fiolhais, F. Nogueira, and M. Marques. A Primer in Density FunctionalTheory. Springer, 2003.

[8] Paolo Giannozzi. Introduction to density functional theory (dft).

[9] J. Harada, T. Pedersen, and Z. Barnea. X-ray and neutron diffraction studyof tetragonal barium titanate. Acta Cryst., A26:336, 1970.

[10] P. Hohenberg and W. Kohn. Inhomogeneous electron gas. Phys. Rev.,136(3B):B864–B871, 1964.

[11] W. Kohn and L. J. Sham. Self-consistent equations including exchange andcorrelation effects. Phys. Rev., 140(4A):A1133–A1138, 1965.

26