Dielectric function, as well as the DOS, is a quantity that requires the integration over the whole Brillouin zone. In general, in order to produce reliable data, a convergency test over the size of the k-point mesh needs to be run. Since the optical properties depends on both occupied and unoccupied states, another convergency test over the number of bands nbnd must be performed. In this section we will calculate the eps2 and the DOS simultaneously.
- Run a scf calculation to get a converged charge density
- Run a nscf calculation to get the eigenvalues od the system
- Compute the density of states
- Compute de matrix elements and the dielectric function components
- Plot the imaginary part of the dielectric function vs energy.
-
Move into the
Si_bulk/Dos_optdirectory -
Run the scf calculation with the command to generate the charge density in the tmp directory:
% pw.x < Si_bulk.scf.in > Si_bulk.scf.out -
Create the directory needed for the convergency on the k-point and the number of bands.
% mkdir kpt5 kpt10 kpt20 bnd5 bnd10 bnd15 -
Run the scf calculation to generate the charge density in the tmp directory:
% pw.x < Si_bulk.scf.in > Si_bulk.scf.out -
Now we have to copy the tmp folder in the directories previously created for the convergence. This is necessary to separate the calculation for each k-point and nbnd, avoiding confusion and issues in reading and writing the eigenvalues generated in the different nscf calculation that will be performed.
% cp -r tmp kpt5 % cp -r tmp kpt10 % cp -r tmp kpt20 % cp -r tmp bnd5 % cp -r tmp bnd10 % cp -r tmp bnd15Alternatively, this can be done with a simple for loop just by the command line, typing:
% for i in 5 10 20; do cp -r tmp kpt$i; done % for i in 5 10 15; do cp -r tmp bnd$i; done -
Move the different nscf input in the relative directories typing:
% mv Si_bulk_nscf_kpt5.in kpt5/ % mv Si_bulk_nscf_kpt10.in kpt10/ % mv Si_bulk_nscf_kpt20.in kpt20/ % mv Si_bulk_nscf_bnd5.in bnd5/ % mv Si_bulk_nscf_bnd10.in bnd10/ % mv Si_bulk_nscf_bnd15.in bnd15/As done before, also this step can be done automatically with an analogue for loop:
% for i in 5 10 20; do mv Si_bulk_nscf_kpt$i.in kpt$i/; done % for i in 5 10 15; do mv Si_bulk_nscf_bnd$i.in bnd$i/; done -
We have to copy the Si_bulk.dos.in and Si_bulk.pw2gw.in files in the kptXX e bndYY directories. This is necessary to avoid overwriting of the files since the dos.x and pw2gw.x codes generate file with default name (e.g.
epsTOT.dat). We have to do this with both the dos and pw2gw input files.% xargs -n 1 cp -v Si_bulk_dos.in<<<"kpt5/ kpt10/ kpt20/ bnd5/ bnd10/ bnd15/" % xargs -n 1 cp -v Si_bulk_pw2gw.in<<<"kpt5/ kpt10/ kpt20/ bnd5/ bnd10/ bnd15/" -
Once completed the organization of the input files in the relative folder we can start the calculations. Starting from the bnd5 folder we have to run in sequence the nscf , the dos and the pw2gw calculation, running the commands:
% cd bnd5/ % pw.x < Si_bulk_nscf_bnd5.in > Si_bulk_nscf_bnd5.out % dos.x < Si_bulk_dos.in > Si_bulk_dos.out % pw2gw.x < Si_bulk_pw2gw.in > Si_bulk_pw2gw.out % rm -r tmp % cd ../bnd10/And so on with the other directories.
-
Now we can plot the calculated quantities checking the convergence for higher values of k-points grid and nbnd.
-
To plot the DOS of graphene for different values of nbnd, in gnuplot
gnuplot> plot 'bnd5/Si_bulk.dos.dat' u 1:2 t 'bnd5' w l dashtype 2 , 'bnd10/Si_bulk.dos.dat' u 1:2 w l lw 2 lc rgb 'red' t 'bnd10' , 'bnd15/Si_bulk.dos.dat' u 1:2 w l lw 2 lc rgb 'black' t 'bnd15' -
To plot the DOS of graphene for different values of kpt, in gnuplot
gnuplot> plot 'kpt5/Si_bulk.dos.dat' u 1:2 t 'kpt5' w l dashtype 2 , 'kpt10/Si_bulk.dos.dat' u 1:2 w l lw 2 lc rgb 'red' t 'kpt10' , 'kpt20/Si_bulk.dos.dat' u 1:2 w l lw 2 lc rgb 'black' t 'kpt20' ``` -
To plot the eps2 of graphene for different values of nbnd, in gnuplot :
gnuplot> plot 'bnd5/epsTOT.dat' u 1:2 t 'bnd5' w l dashtype 2 , 'bnd10/epsTOT.dat' u 1:2 w l lw 1 lc rgb 'red' t 'bnd10' , 'bnd15/epsTOT.dat' u 1:2 w l lw 2 lc rgb 'blue' t 'bnd15' -
To plot the eps2 of graphene for different values of kpt, in gnuplot
gnuplot> plot 'kpt5/epsTOT.dat' u 1:2 t 'kpt5' w l dashtype 2 , 'kpt10/epsTOT.dat' u 1:2 w l lw 1 lc rgb 'red' t 'kpt10' , 'kpt20/epsTOT.dat' u 1:2 w l lw 2 lc rgb 'blue' t 'kpt20'