Problem Set 2: First-Principles Energy Methods: Harvard SEAS AP275 Computational Design of Materials Spring 2018
Problem Set 2: First-Principles Energy Methods: Harvard SEAS AP275 Computational Design of Materials Spring 2018
Problem Set 2: First-Principles Energy Methods: Harvard SEAS AP275 Computational Design of Materials Spring 2018
Problem 1 (10 points): Convergence of absolute energies with respect to cutoff energies.
A Using the Quantum ESPRESSO PWscf package, calculate the energy of Ge in the
diamond structure as a function of plane-wave cutoff energy. A good range to try is 5-
80 Ry, doing calculations at increments of 5 Ry. When changing the cutoff, make sure
to keep the other variables (lattice constant, k-points, etc) fixed and to record them.
Record and plot your final results. Specify when you reach the level of convergence of
around 5 meV/atom (convert this to Ry/atom). Note that the code calculates energy
per primitive cell.
B Do you see a trend in your calculated energies and calculation time with respect to the
cutoff? Is this what you expect and why?
C In Problem Set 1, we used a cubic unit cell. Here, we use the primitive cell. What are
the advantages and disadvantages of both methods?
A Using PWscf, calculate the energy as a function of the size of the k-point grid used
to integrate the Brillouin zone. For each grid, record the number of unique k-points.
Record the computational time. When changing the size of the k-point grid, make sure
to keep your other variables fixed (lattice constant, plane-wave cutoff, etc). One may
choose a lower cutoff than the “converged” cutoff in the last problem. There are some
“cross effects” in doing so, however we assume these are small.
B Do you see a trend in your calculated energies and computation times with respect to
the k-point grid size? If you see a trend, is this what you expect and why?
Problem 3 (10 points): Convergence of forces with respect to plane-wave cutoff energies.
Oftentimes we are interested in quantities other than energies. In this problem, we will
be calculating forces on atoms. Displace a Ge atom +0.05 in the z direction (fractional
coordinates). Keeping other parameters fixed, calculate the forces on a Ge atom as a function
of the kinetic energy cutoff. A good force value would be converged to within around 10
meV/Angstrom (convert this to Ry/bohr, since PWscf gives forces in Ry/bohr). Record
relevant parameters (lattice parameter, k-points, unique k-points, etc). A good k-point grid
to use is 4 × 4 × 4. Plot and record your results.
Page 1 of 3
Harvard SEAS AP275 Computational Design of Materials Spring 2018
Using PWscf, calculate the force on a Ge atom displaced +0.05 in the z direction (in frac-
tional coordinates) as a function of k-point grid size. Keep all other parameters fixed. Record
your relevant conditions (lattice parameter, cutoffs, etc).
In practice only energy differences have physical meaning, as opposed to absolute energy
scales, which can be arbitrarily shifted. Therefore, it is important to understand the conver-
gence properties. Using PWscf, calculate the energy difference between two Ge cyrstals at
different lattice parameters, as a function of cutoff. For example, you could calculate the en-
ergy of Ge at the experimental lattice parameter (10.70 bohr), and then calculate the energy
using another value close to it (10.75 bohr, for example), take the difference between the two
energies, and repeat for many energy cutoffs. Make sure to keep your other variables (lattice
constant, k-points, etc) fixed while changing the cutoff. Record all relevant parameters such
as the lattice constant, k-points, and so on. A good energy difference is converged to around
5 meV/atom (convert this to Ry/atom).
How do the cutoff requirements change when looking at absolute energies, looking at forces,
and looking at energy differences? How do the k-point grid requirements change? Can you
explain the differences in the requirements and the rates of convergence?
In this problem you will calculate the equilibrium lattice constant and bulk modulus of Ge.
Usually, we are interested in quantities such as forces or energy differences, not absolute
energies. Therefore, for this problem use the cutoff and k-point criteria that you determined
for the force and energy difference calculation. (In general, to be absolutely safe you should
test convergence specifically for the quantity you are interested in. So, ideally, we would test
convergence of lattice constant as a function of energy cutoff and k-point grid size, but we
are not going to do this.)
A Calculate the equilibrium lattice constant of Ge in the diamond structure from first
principles using PWscf. The experimental value is 10.7 bohr. How does the experi-
mental value compare with the calculated value? Is this expected? Make sure to record
all the relevant parameters (k-points, cutoffs, etc).
B Calculate the bulk modulus of Ge in the diamond structure. Here you will need to
derive some (simple) equations and then apply them to compute a material’s property,
a very typical scenario in computational science.
Page 2 of 3
Harvard SEAS AP275 Computational Design of Materials Spring 2018
C Solve problem 7A by directly minimizing the energy using structure optimization ca-
pability of Quantum Espresso. Think about what type of calculation the code should
do, find the required parameters in the online documentation and modify the Python
workflow accordingly. Compare with the results of problem 7A where you directly
scanned over lattice parameter values.
Hints: Remember that P = −∂E/∂V . Remember that PWscf calculates energies per prim-
itive unit cell. Be careful about unit conversions.
Calculate the elastic constants C11 , C12 , and C44 for Ge using first-principles energy methods.
You will need to perform proper deformations of the unit cell and to lower the symmetry. You
will have 8 atoms in the unit cell for diamond structure. Use the same (reduced) symmetry
for the original (not deformed) unit cell in order to make correct energy comparisons. You
may want to look up convenient expressions relating the elastic constants specifically in cubic
crystals.
Compute and plot the band structure of Ge. You will need to change the original calculation
mode to
calculation = ’bands’
and provide the list of k points along high some symmetry directions (in section K P OIN T S)
for which you want to compute the Kohn-Sham eigenvalues. The proper format of the
input file is very important. The details can be found in the PWscf manual. Look up the
relevant high symmetry directions and special k-points for the diamond crystal, which is
the same space group as Si and Ge. Include the valence bands and the 4 lowest conduction
bands. (change parameter nbnd) Compare your result with the band structure found in the
literature.
Page 3 of 3
Harvard SEAS AP275 Computational Design of Materials Spring 2018
Lab 2 Handout:
Quantum Espresso DFT Code
https://en.wikipedia.org/wiki/List_of_quantum_chemistry_and_solid-state_physics_software
The rest of this handout will show how to get energies and forces using the PWscf code in
Quantum-Espresso. Some helpful unit conversions are the following:
Page 1 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
• Now download the workflow automation tools and Python plugins for Quantum Espresso
that you will be adapting to solve exercises in this lab.
bond@vmint ~ $ cd ~/Software/labutil/
bond@vmint ~/Software/labutil $ git pull
If you changed the plugins and samples in this directory while working on the previous
assignment, the git command will notice this and will prompt you to ’merge’ your
changes. Do not do this. Instead, backup any of your changes by renaming this folder
to something else, for instance:
bond@vmint ~/Software/labutil $ cd ..
bond@vmint ~/Software $ mv labutil/ my_labutil
Then repeat the initial procedure steps to set up a fresh repository (see previous lab):
bond@vmint ~/Software $ git clone https://github.com/bkoz37/labutil.git
If, however, git does not detect any changes when you do git pull, it will simply
download and update the files.
Copy the sample files to your working directory.
bond@vmint ~/Software/labutil/lab2_samples $ cp * ~/WORK/Lab2/
Page 2 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
&control
calculation = ’scf’
tstress = .true.
tprnfor = .true.
pseudo_dir = ’/home/bond/Software/qe-6.0/pseudo’
outdir=’/home/bond/WORK/Lab2/Problem1/test’
/
&system
ibrav = 0
nat = 2
ntyp = 1
ecutwfc = 30
/
&electrons
diagonalization = ’david’
mixing_beta = 0.5
conv_thr = 1e-07
/
K_POINTS automatic
4 4 4 0 0 0
ATOMIC_SPECIES
Ge 72.61 Ge.pz-bhs.UPF
CELL_PARAMETERS {angstrom}
0.0 2.5 2.5
2.5 0.0 2.5
2.5 2.5 0.0
ATOMIC_POSITIONS {angstrom}
Ge 0.00000 0.00000 0.00000
Ge 1.25000 1.25000 1.25000
The most relevant lines for the calculations related to this lab are the following:
• The line
calculation = ’scf’
Page 3 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
• The line
tprnfor = .true.
indicates that forces will be printed out. A similar line appears for the stress.
• The line
indicates the location of the pseudopotential file that describes the behaviour of inner
electrons for each Ge atom . The code will look for the pseudopotential file in that
directory.
• The line
indicates the directory where temporary files (wavefunction, charge density) will be
written. We will be running each calculation and writing the output file to the same
folder, for convenience.
• The lines
ibrav = 0
nat = 2
ntyp = 1
indicate that our unit cell will be completely specified by its cell vectors using the
CELL PARAMETERS block, as described below. We also tell the code that we have two
atoms (nat = 2) of the same (ntyp = 1) species in it. These parameters will be
automatically filled in by our Python plugin, based on the information it finds in the
structure object.
• The line
ecutwfc = 30.0
Page 4 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
• Ge 72.61 Ge.pz-bhs.UPF indicates the atom label (Ge), atomic mass unit number for
Ge and the name (choice) of pseudopotential to be used.
• The lines
ATOMIC_POSITIONS {angstrom}
Ge 0.00000 0.00000 0.00000
Ge 1.25000 1.25000 1.25000
indicate where the two atoms in the unit cell are located.
• The lines
K POINTS automatic
4 4 4 0 0 0
• The full listing and description of all input file keywords is located here:
http://www.quantum-espresso.org/wp-content/uploads/Doc/INPUT_PW.html
We are ready now to run our first PWscf calculation. Just type
After a few seconds if everything goes well you should have in your directory a file called
pwscf.out. All relevant information is there. To look at the total energy of the system type
in command line
so here you can see the total value of the energy for the cell (your number might be slightly
different) and the total stress. Note that the final occurrence of total energy will have an
exclamation point by it. This something that you can use to hunt for it manually, for example
by typing
which will search all files terminated by .out in the current directory, looking for lines that
start with an exclamation point.
At the end of the file, it is written how long your program took to run. For example:
Page 5 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
Page 6 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
with X
unk (r) = cG eiGr .
G
In these equations, ψnk (r) is the wavefunction, unk (r) is a function that is periodic in the
same way as the lattice, the sum goes over all (at least in principle) reciprocal lattice vectors
G, and the cG are coefficients in the basis expansion. In this case, our basis functions
(i.e., what we expand in) are plane waves. They are called plane waves because surfaces of
constant phase are parallel planes perpendicular to the direction of propagation. Remember
that limiting the plane-wave expansion to the infinite, but numerable and discrete set of G
vectors that are integer multiples of the three primitive lattice vectors, we are selecting plane
waves that have a periodicity compatible with the periodic boundary conditions of our direct
lattice.
In actual calculations, we have to limit the plane wave expansion at some point (i.e.,
stop taking more values of G). This is called the planewave cutoff. Cutoffs are always given
in energy units (such as Rydberg or eV) corresponding to the kinetic energy of the highest
G. Note: The units of reciprocal lattice are the inverse of the direct lattice, or 1/length.
However, we can convert 1/length to energy units (remember that λν = c and that E = hν,
where λ is a wavelength, ν is a frequency, and E is an energy).
Problem 1 is designed to test cutoff convergence issues. You can always take a higher
cutoff than you need, but the calculations will take longer.
3.2 K-points
Because of the Bloch theorem, we need to solve a Schrödinger-like Kohn-Sham equation (i.e.
iterate selfconsistently the diagonalization of a M × M matrix, where M is the number of
basis functions) everywhere in the first Brillouin zone (if you dont know what a Brillouin
zone is, its time to go over the concepts of direct and reciprocal lattice). In practice, we
do this for a finite number of k values (e.g., the coarse grained k-point ”Monkhorst-Pack”
mesh), and get a value for E at each k. To obtain a value for E, the energy of the crystal,
we need to integrate over the first Brillouin zone, where the bands are occupied (and divide
by the volume). Thus, summing over a finite number of k points is an approximation to
performing an integral. You will need to make sure you have enough k-points to have a
converged value for the energy.
Page 7 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
number of k points= 8
Your calculation will scale roughly as the number of unique k-points. You can verify this
with the timing information.
The numerical value for your forces may be slightly different from the above example. Forces
are given in units of Ry/bohr, but the Python plugin converts them to eV/atom. Record
this number, and retest the convergence issues with respect to cutoffs and k-points.
Page 8 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
5 FAQ
• I get a message: Note: The following floating-point exceptions are sig-
nalling: IEEE DENORMAL
This just a low-level warning from the GNU compiler not being happy with a floating
point numeric convention in the PWscf code. Ignore it.
• The energies when you move an atom (the force calculations) are higher
than when you don’t?
This is correct. Remember equilibrium has the lowest energy. Equilibrium for this
structure has Ge atoms at (0, 0, 0) and at (0.25, 0.25, 0.25). As a side note the forces
will give you an idea of how far you are from equilibrium (they tell you which direction
the atoms “want” to move). The stresses tell you which direction the cell parameters
“want” to change to reach equilibrium.
Page 9 of 10
Harvard SEAS AP275 Computational Design of Materials Spring 2018
same. Don’t worry about the percentage errors so much. You could always arbitrarily
decrease the percentage errors on the forces by taking a bigger displacement. From
experience, we know that a good error on energy differences is around 5 meV/atom.
From experience, we also know that a good error on forces is 10 meV/Å. These are
just values that we know, because we have done many first-principles calculations in
the past. This is what you should look for.
• My energies are really different from Lab 1. What is the “correct” scale I
should be looking for?
Remember that absolute energies do not usually mean very much. We are mostly
interested in energy differences. Also, the reference energies are different. In lab 1, the
reference energy (when atoms are infinitely far apart) is 0. In lab 2, this is not the
case. The absolute energies can shift a lot, depending on which reference energies you
take.
• Why do I take k-point grids with the same number of points per direction?
Can I take other k-point grids?
For this material, we take the same number of k-points per direction because the three
lattice directions are equivalent. This is not always true. The “best” k-point meshes
are those that sample k-space evenly in all directions. Thus, for a tetragonal cell (with
a = b, c = 2a, and all angles 90 degrees) we might take a 8 × 8 × 4 mesh. Think about
why this is so. (Note that if a lattice vector is longer in real space, it is shorter in
k-space).
Page 10 of 10