INSTRUCTIONS FOR DAY 1, EXERCISE 3
Note that the following color code has been used in this instruction sheet:
Broad headings are in red.
File names are in magenta.
Phrases to be typed into the command line are in blue.
Input parameters are in dark green.
A very brief reminder of useful linux commands:
cp A B copies file A to file B.
mv A B moves file A to file B.
mkdir C creates a directory named C.
ls C lists the names of the files and sub-directories contained in directory C
vi A or gedit A are some of the many ways in which you can open the file A for reading and/or editing.
Adding an ampersand & at the end of your command will make it run in the background, so that you can continue to issue other commands while the original one is still running.
In this exercise, you will perform simple scf (self-consistent field) calculations on alumin(i)um.
There are 2 main ways in which Al differs from Si:
It has the FCC crystal structure, instead of the diamond structure.
It is a metal, and therefore has to be treated differently.
Go to the directory day1/exercise3 (if you are not already there!)
You will see the following files:
day1_exercise3_instructions.html this file!
Al.sample.in this is a sample input file.
Al.sample.sh this is a sample shell script that you can use (optionally) .
For each calculation that you will run, you can use Al.sample.in as a template that you can copy to another file and then edit. Alternatively, you can use shell scripts to automate this process.
Open and read the sample file Al.sample.in
Compared to your input files for Si (exercise 1) there are two main differences:
(i) Now nat = 1 instead of nat = 2, and accordingly there is only one Al atom at 0.0 0.0 0.0
(ii) There are additional lines, saying that the occupation should be smeared, which type of smearing to use, and what value of degauss (smearing width) to use.
Note that now we have set verbosity = 'high' in the &control namelist ; so that the code wll print out occupation numbers, etc.
Use Xcrysden to view the structure in the sample file:
xcrysden -- pwi Al.sample.in &
How many atoms are contained in the conventional cubic cell?
What is the coordination number of each atom?
What is the nearest-neighbor distance?
Run an scf calculation:
pw.x < Al.sample.in > Al.sample.out
Read the output, and answer the following questions:
How many bands were computed? How does this compare with the number of electrons?
What is the Fermi energy?
Now do convergence tests with respect to plane-wave cut-off:
In principle, you should now run a series of calcuations with different values of ecutwfc (as you did for Si) and see at what value of ecutwfc your total energy has converged. However, to save time, let us assume that this has been done. Keep working with ecutwfc=12.
Now do convergence tests with respect to Brillouin zone sampling and smearing width:
We will simultaneously decide what k-point mesh (values of nk1, nk2, nk3) and the value of the smearing width (degauss) to use. For simplicity, let us assume now that we will only use the Marzari-Vanderbilt smearing.
Loop over values of nk1, nk2, nk3 = 6 6 6, 8 8 8, 12 12 12, 16 16 16
For each of these k-point meshes, loop over degauss ranging from 0.02 to 0.10 (at intervals chosen by you).
Make input files of the form al_degauss_nk_scf.in (inserting the appropriate values of degauss and nk).
In order to do this, you can either edit your input files manually, or use the shell script Al.sample.sh
(If doing the latter, read the shell script carefully and see whether you need to insert additional values or lines).
Run pw.x for each value of nk and degauss, either using the shell script or a command of the form
pw.x < al_degauss.<val>_nk.<val>_scf.in > al_degauss.<val>_nk.<val>_scf.out
(of course, you should substitute the appropriate values).
For each value of degauss used, assemble data files of the form al-m-v.degauss (e.g., al-m-v.02) which contain two columns, the first consisting of the number of BZ divisions nk, and the second containing the total energy.
(You could do this using grep commands, etc., or you can do it by hand).
Plot a graph showing how the total energy varies with the number of k-points and the smearing width, using a plotting program of your choice. For example, if using xmgrace, type:
xmgrace al.m-v* &
The 'true' converged result is obtained in the limit of zero smearing and an infinite number of k-points.
Based upon this, decide what values of nk1=nk2=nk3 and degauss you consider satisfactory.
(Note: you will have to achieve some sort of compromise between accuracy and computational time!)
(Optional extra assignment: repeat this whole section using Gaussian smearing instead of Marzari-Vanderbilt smearing. Which smearing works better?)
Now obtain the equilibrium lattice constant of Al:
Fix ecutwfc and nk1=nk2=nk3 at the values you decided (above) were the best ones to use.
Vary the lattice constant, i.e., celldm(1) from 7.0 to 8.0 bohr, in intervals of 0.1 bohr, and run pw.x for each value of celldm(1). You can do this manually or by writing a shell script.
Assemble the results for the dependence of total energy on lattice constant in a data file (2 columns, the first containing the lattice constant in bohr, and the second containing total energy in Ry).
Plot this data. Do you obtain a smooth curve?
Fit this data to an equation of state by running ev.x
When you run this, you will be prompted to supply:
the type of Bravais lattice (note: using the name and not the ibrav number)
which particular equation of state you want to use
(I usually use the 2nd Order Birch eq., but you can experiment with other choices too.)
the name of the input file containing the data of lattice constant and total energy
the name of the output file where you want the results of the fitting procedure
Look at the output file (whose name you supplied in the previous step):
From the fit, what are the values of the equilibrium lattice constant a0 and bulk modulus k0?
If there is a discrepancy between experimental and theoretical values, can you understand where this arises from?
Can you tell whether the quality of fit is good or poor?
Optional extra assignments:
Plot the band structure of Al along high-symmetry directions.
Plot the electronic density of states of Al. In what ways does the DOS for Al differ from that of Si?