INSTRUCTIONS FOR DAY 1, EXERCISE 1
In this exercise, you will first perform simple scf (self-consistent field) calculations on silicon.
Enter the directory ex1. You will see the following files:
- Si.sample.in this is a sample input file, for a primitive Si cell containing 2 atoms.
- Si.sample.sh this is a sample shell script that you can use (optionally) .
For each calculation that you will run, you can use Si.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.
First you need to login on to your specific node (you will have been told what this is). I suggest opening a second terminal window to do this. (X - the way to dispay graphical programs remotly only works on the head node. So I suggest two windows - one open on the head node, one on the compute node)
[Student-16:~] che721% ssh -Y firstname.lastname@example.org Password: Last login: Mon Sep 21 14:10:23 2009 from 18.104.22.168 Have a lot of fun... tuto01@cecamsrv4:~> ssh node09 ssh: node09: Name or service not known tuto01@cecamsrv4:~> ssh node009 The authenticity of host 'node009 (10.0.0.19)' can't be established. RSA key fingerprint is 28:18:f0:9e:ca:7d:c2:23:d9:75:94:89:f2:6a:c2:05. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'node009,10.0.0.19' (RSA) to the list of known hosts. Have a lot of fun... tuto01@node009:~>
- When you logged on to the compute node you were sent back to your homedirectory. Navigate back to the ex1 directory
- Open and read the sample file Si.sample.in
- Note that in the &control namelist, we have specified that we want to run an scf calculation.
- Silicon has the diamond structure. Note that we are using a (primitive) unit cell that corresponds to an fcc lattice, with 2 Si atoms in the atomic basis. Notice the values given for ibrav, nat, ntyp and ATOMIC_POSITIONS.
- In this file, the lattice constant celldm(1) has been set equal to 10.26 bohr = 5.43 Å, which is the experimental value.
- A 6×6×6 shifted Monkhorst-Pack k-point mesh has been used.
- The plane-wave cut-off for wavefunctions, ecutwfc, has been set to 20 Ry.
Use Xcrysden to view the structure in the sample input file:
xcrysden --pwi Si.sample.in
Play around with xcrysden! Rotate the view, display the boundaries of the conventional cubic cell, etc.
- How many atoms are contained in the conventional cubic cell?
- What is the nearest-neighbor distance?
Run an scf calculation:
The way to do this is:
pw.x < input_filename > output_filename
So in this particular case, you will type:
pw.x < Si.sample.in > Si.sample.out
Read the output, and answer the following questions:
- Was symmetry used to reduce the number of k-points from 6×6×6=216?
- How many scf iterations were performed before convergence was achieved?
- What is the final (converged) value for the total energy?
(Note: you can find this by looking for an exclamation mark in the output file). For example, you can type:
grep ! Si.sample.out
Note: If you set verbosity = 'high' in the &control namelist, you will get additional information in your output file, e.g., about symmetries and occupation numbers.
Convergence tests with respect to plane-wave cut-off:
Find out how the total energy changes when you vary the plane wave cut-off ecutwfc between 10 and 30 Ry, in steps of 5 Ry. You can either do this by copying the sample file Si.sample.in to other input files and editing them, and running pw.x using each of these input files in turn, or by running the sample shell script Si.sample.sh
Now make a data file (e.g., you can call it etotvsecut.dat) that contains the value of ecutwfc in the first column, and total energy in the second column. Remember that you can easily find the values of the total energy by searching for an exclamation mark, e.g., using the grep command.
Plot a graph of this data using your favorite plotting program (e.g., xmgrace or gnuplot).
- Does the total energy decrease monotonically as ecutwfc is increased?
- What value of ecutwfc are you 'happy' with?
Convergence with respect to Brillouin zone sampling:
- Fix the value of ecutwfc at whatever value you have decided is good enough. (Remember: differences in energy will converge at lower values of ecutwfc than the absolute value of the total energy!) I chose ecutwfc to be 20 Ry, but you can make whatever choice you want!
- Let the lattice constant celldm(1) remain at the experimental value.
- Vary the Monkhorst-Pack grid parameters nk1, nk2 and nk3. You can do this either by manually editing input files, or by modifying the script Si.sample.sh Use nk1=nk2=nk3= 1, 2, 3, 4, 5, 6. Leave the offset at k1=k2=k3 = 1.
- Run pw.x for each of the six input files you have made (either one by one, or using the shellscript). Remember: don't overwrite output files before you extract data from them!
- Assemble a data file that contains how the total energy varies with nk1=nk2=nk3. The first column should contain the value of nk1 (or, if you prefer, the number of k-points generated and used), and the second column should contain the value of the total energy.
- Plot a graph of this data. Do you think that the total energy is converging as you increase the number of k-points?
- Do you think it was a good choice to take nk1=nk2=nk3? Why?
- Is the convergence wrt the number of k-points monotonic? (Note that it need not necessarily be so!)