In this project, we will continue using the PWSCF code and look at convergence with respect to the
You will produce a short report documenting your findings. Your report should contain a separate section for each of the tasks listed below, and provide the explicit deliverables requested for each task indicated by the boldface point values below.
The report should be formatted as a single pdf document comprising your report and all requested files. Submit your PDF file via Assignment Upload by 11:59pm on 18 February 2021. Late submissions will not be accepted.
For all first-principles calculations for solids, you must pay attention to two convergence issues. The first is the cutoff energy,
Background for k-point convergence. Remember that we are dealing with infinite systems using periodic boundary conditions. This means that we can use the Bloch theorem to help us solve the Schrödinger equation. The Bloch theorem says that our wavefunction
The instructions below specify files on the EWS Linux system. First, let’s select our pseudopotential for Al. If you go to www.quantum-espresso.org/pseudopotentials, you can select which pseudopotential you’d like to use. Select the PBE (Perdew-Burke-Ernzerhof Generalized Gradient Approximation (GGA)) for the exchange correlation potential, and then select PAW for the type. After you filter, you can click on Al, and you should see two options: one that is “scalar relativistic,” and the other that is “fully relativistic.” The difference has to do with the way core electrons states (such as the Al.pbe-n-kjpaw_psl.0.1.UPF
potential. The electron configuration of Al is [Ne]
$ cd ~/QE//pseudo
$ wget http://www.quantum-espresso.org/wp-content/uploads/upf_files/Al.pbe-n-kjpaw_psl.0.1.UPF
or, alternatively, download it from your browser and move the file to the appropriate place. When we run QE, we will tell the code where to find this pseudopotential on our local disc. You may want to export your ESPRESSO_PSEUDO
environment variable (see walkthrough); else, you’ll need to make sure that the pseudo_dir variable in each input file points to the correct directory.
After downloading, you can look at the pseudopotential file using less; the information inside of PP_HEADER
reiterates much of what is described above.
Next create a directory to store your files. You should create a new subdirectory in your Runs
directory that you created last time. For example
$ cd ~/QE/Runs
$ mkdir Al
$ cd Al
From the /class/mse404ela/QuantumEspresso/Project
directory, copy over the input files Al.scf.inp
and Al.relax.inp
.
We will look first at the Al.scf.inp
input file. This input file is for Al in the fcc crystal phase.
Aluminum exists under standard conditions as a face-centered cubic (FCC) structure with four Al atoms in the conventional unit cell at
Wikipedia: Cubic Crystal System
QE operates using not the conventional unit cell, but the primitive unit cell based on the primitive axis vectors as the most economic way to define a unit cell. In the case of FCC lattices, this allows us to define our periodic crystal containing just a single Al atom at the origin [0 0 0].
Look at the input file, which you have copied over to your directory.
$ less Al.scf.inp
The file will look similar to the one for the H2 molecule in the walkthrough. Here we highlight some key points. First, the differences in the unit cell:
...
ibrav= 2,
...
ATOMIC_POSITIONS alat
Al 0.00 0.00 0.00
...
Here we specify a FCC lattice using ibrav=2
(c.f. INPUT_PW.html:ibrav) and locate a single Al atom at the origin of our primitive cell.
Next, we use a different smearing:
...
occupations = 'smearing',
smearing = 'methfessel-paxton',
degauss = 0.05,
...
A metal is a system with unoccupied bands near the Fermi energy (the energy of the highest occupied electron level) meaning that bands may cross at the Fermi surface. The DFT calculation scales quadratically with the number of bands in the calculation. To reduce computational costs, the DFT algorithm only considers the occupied bands, and a few unoccupied bands. At
where
When bands are near the Fermi level—as in metals—this means that small changes in the wavefunction can cause large changes in the band occupancy, making the algorithm unstable. To stabilize the algorithm, better reflect the continuous nature of the band occupancies at finite temperature, and reduce the number of k-points required for convergence, we employ a smearing function to the energy bands. This has the overall effect of producing a more accurate density of states.
Here we are telling QE to use a smearing potential for the atoms in the metal with “Methfessel-Paxton first-order spreading” (cf. Phys. Rev. B 40, 3616 (1989)) and a 0.05 Ry value for the Gaussian spreading for Brillouin-zone integration. This is a well-tested smearing approach for metallic systems.
Lastly, we also introduce an automatically generated grid of
...
K_POINTS {automatic}
4 4 4 0 0 0
After the keywork K_POINTS
, "automatic"
tells PWSCF to automatically generate a nkx nky nkz offx offy offz
where nk*
is the number of intervals in a direction and off*
is the offset of the origin of the grid.
If we now do
$ less Al.relax.inp,
you will see similar changes to what we had to relax the hydrogen molecule; now, however, we use "vc-relax"
(or variable cell relaxation, to relax the unit cell), and there is also a new card for &CELL
, which takes the default values.
You can read the documentation for the input file in the INPUT_PW
file; this is in the Docs subdirectory under the /class/mse404ela
directory or online at INPUT_PW.html.
If using the EWS workstations, in order to use the scratch space and not to overwrite each other’s files, please edit your input files (using, for example, vi) to set prefix=‘aluminum-
[10 pt] What is your calculated value of the total energy of the system in
[5 pt] How long did the calculation take in
Using the Al.relax.inp
input file, run the PWSCF code to relax the lattice parameter. N.B. Remember to make the same modifications to prefix, outdir, and pseudo_dir as you did above.
[5 pt] What is your calculated value of the total energy of the system in:
[5 pt] How long did the calculation take in
[10 pt] What is the value of the input lattice constant in a.u.?
[10 pt] Near the top of your output file you will see a block:
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 )
Towards the end of your output file (just below the line reading “End of BFGS Geometry Optimization”) you will see the block that looks something like:
CELL_PARAMETERS (alat= 10.20000000)
-0.509955391 0.000000000 0.509955391
0.000000000 0.509955391 0.509955391
-0.509955391 0.509955391 0.000000000
In units of the input lattice constant alat
, the lattice vector of the relaxed crystal geometry has grown—in this case—from 0.5 to 0.509955391. The lattice constant, alat, scales in direct proportion to this change (i.e. by a factor of 0.509955391/0.5).
Using your terminal values for the CELL_PARAMETERS
block, what is the lattice constant of your final relaxed geometry in a.u.?
To speed up the convergence calculations, we use scripts. For the cutoff energy convergence we can use the script from the last lab. Keep the lattice constant fixed at alat = 9.0 a.u.
[15 pt] Consider a range of energy cutoffs,
[15 pt] Suggest an appropriate value for Ecut for an accuracy of 0.1 mRyd/atom. Support your answer.
Hint: It may not be necessary to fit a decaying exponential if you can adequately substantiate your answer by inspection of your numerical data. For example: “Assuming Etrue = E @ Ecut = XX Ry, then beyond an Ecut of YY Ry, the system energy is converged to within the desired accuracy of ZZ Ry/atom.”
Modify the script from A3 to loop over even divisioned
Hint: To scan over
for kpts in " 2 2 2 0 0 0" " 4 4 4 0 0 0" " 6 6 6 0 0 0" ; do
sed "/ 4 4 4 0 0 0/s/.*/ $kpts/" $INPUTFILE | $PWSCF > out
But you may find other ways to achieve the same result, such as a “here document” (there is an example of how to do this in the /class/mse404ela/Bash-project
directory).
[15 pt] Make a plot of your scf energy as a function of the resolution of your k-point mesh.
[15 pt] Suggest an appropriate
Hint: It may not be necessary to fit a decaying exponential if you can adequately substantiate your answer by inspection of your numerical data. For example: “Assuming Etrue = E @ k-point mesh with resolution X-by-X-by-X, then for k-point meshes with resolution higher than Y-by-Y-by-Y, the system energy is converged to within the desired accuracy of ZZ Ry/atom.”
Once you have selected your cutoff energy and k-point mesh size to be within 0.1 mRyd/atom, modify Al.relax.inp
to reflect these values and re-run the relaxation.
Hint: If you get the error Error in routine scale_h (1): Not enough space allocated for radial FFT: try restarting with a larger cell_factor
try a better initial guess for your lattice parameter.
[10 pt] What is your calculated value for the relaxed lattice constant in a.u. using your converged Ecut and k-point mesh?
[10 pt] Find (from an appropriate reference) the lattice constant for aluminum at room temperature. How does your value compare with the experimental value?
You’ve computed the lattice constant for Al with density functional theory; now, let’s compute some elastic constants. As we talked about earlier, it’s better to separate the strains that change volume from those that conserve volume. The bulk modulus is defined to be the (linear) change in pressure with a small change in volume per atom. We will use a finite difference approximation to extract this. Edit your Al.scf.inp
script to use your converged values of Ecut, kpoint mesh, and your calculated lattice constant. Run this calculation and extract the computed pressure (derivative of total energy with respect to volume) using
$ grep 'P=' Al.scf.out
you will see a line that looks something like
total stress (Ry/bohr**3) (kbar) P= -0.73
though your number may be different.
Hint: The unit-cell volume,
The next step is to compute the two shear moduli. Aluminum is cubic, and so there are three unique elastic constants:
We’ve already calculated one elastic constant, the bulk modulus
So, what remains is to determine
while the stress tensor will be
The final consideration is to construct the strain tensor to conserve volume. We can compute the fractional change in volume as
which is a small change for small
We need to strain the crystal by changing the lattice vectors; in FCC, they are
To be able to easily enter arbitrary lattice vectors, use the ibrav = 0
option, and then you can use the CELL_PARAMETERS
card as such (c.f. INPUT_PW.html:CELL_PARAMETERS)
CELL_PARAMETERS alat
0.0 0.5 0.5
0.5 0.0 0.5
0.5 0.5 0.0
would give us an FCC crystal. Be aware: the cell parameters card is only used if ibrav=0
. The first line is the first lattice vector, the second line is the second lattice vector, and the third line is the third lattice vector. In this case, the units of the lattice vectors are alat
(as specified by celldm(1)
).
You will need to apply the strains to the lattice constants. Keep in mind: each vector is strained individually. So, for example, if we use the strain matrix above, the first lattice vector
and similar for the other two lattice vectors.
[20 pt] Create two input files, one with a shear strain of 0.5% and another with 1%, to compute the shear stresses (you may find a script useful for doing the math). Check that your stresses are linearly related to your strains, and determine
[10 pt] Find (from an appropriate reference) the value of
For
while all other strains are zero, the normal stresses are
and
so that the stresses should be equal and opposite. All other stresses should be zero, as long as we’re in the linear limit. This also assumes that the cell initially has zero stress: we need to be at equilibrium. You can eliminate small nonzero stress by computing
The final consideration is to construct the strain tensor to conserve volume. We can compute the fractional change in volume as
which is a small change for small
[20 pt] Create two input files, one with a shear strain of 0.5% and another with 1%, to compute the shear stresses (you may find a script useful for doing the math). Check that your stresses are linearly related to your strains, and determine
[10 pt] Combine all of your data to determine