Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
364 commits
Select commit Hold shift + click to select a range
f0402ec
Vacuum
Nov 14, 2021
203bdaa
bands
Nov 18, 2021
020a866
bands
Nov 18, 2021
ac1ebc0
BN relax
Nov 18, 2021
b484342
BN relax
Nov 18, 2021
0c8a4a7
commit
Nov 18, 2021
d90fe4a
commit
Nov 18, 2021
f46ac3a
commit
Nov 18, 2021
a6ffe16
commit
Nov 18, 2021
decfe53
add projections
Nov 19, 2021
855dc3d
starting on create
Nov 19, 2021
e89492d
Merge branch 'master' of https://github.com/cdhogan/DFT-basics
simonebrozzesi Dec 5, 2021
1f79586
update paths
simonebrozzesi Dec 5, 2021
bcee0c0
update paths
simonebrozzesi Dec 5, 2021
1ebb617
fix pseudo
simonebrozzesi Dec 5, 2021
1220b01
update readme
simonebrozzesi Dec 5, 2021
309b1e5
update silicon
simonebrozzesi Dec 6, 2021
cc1c8dc
pyrrole
Dec 12, 2021
31b2b67
pyrrole
Dec 12, 2021
9976cc8
pyrrole
Dec 12, 2021
f60f0bc
pyrrole
Dec 12, 2021
fc34d68
pyrrole
Dec 12, 2021
4af2cd0
GaAs
Dec 12, 2021
025d8e7
GaAs
Dec 12, 2021
143c613
GaAs
Dec 12, 2021
a58ca9a
GaAs
Dec 12, 2021
246f82e
GaAs
Dec 12, 2021
f2c3152
GaAs
Dec 12, 2021
2b6f2b6
Adding again graphene
Apr 7, 2022
ead0fe2
charged order
Apr 12, 2022
826d671
tidying
Apr 12, 2022
43378ba
kgrid
Apr 12, 2022
700f247
fixes
Apr 12, 2022
6cb3421
update pseudo
simonebrozzesi Apr 13, 2022
14a8dbf
update pseudo
simonebrozzesi Apr 13, 2022
b98b5dd
cutoff Gr
Apr 18, 2022
9b7e146
cutoff Gr
Apr 18, 2022
007e9e0
cutoff Gr
Apr 18, 2022
aea1b3a
cutoff Gr
Apr 18, 2022
da280cc
smearing tutorial
Apr 19, 2022
1a5a2c1
smearing
Apr 19, 2022
dc74a5b
smearing
Apr 19, 2022
bc612ba
smearing
Apr 19, 2022
e13290b
vacuum tutorial
Apr 19, 2022
b0b9975
vc relax
Apr 19, 2022
ac22533
graphene+GNR
Apr 19, 2022
3900dd1
images
Apr 20, 2022
30ff1c6
fixed links
Apr 20, 2022
9fb142d
Update Ge5H12.scf.in
simonebrozzesi Apr 26, 2022
4402d95
Update Ge5H12.nscf.in
simonebrozzesi Apr 26, 2022
995fc61
Update Ge5H12.scf.in
simonebrozzesi Apr 26, 2022
5d3bce8
Update Ge5H12.nscf.in
simonebrozzesi Apr 26, 2022
324dc0d
Update Ge5H12.scf.in
simonebrozzesi Apr 26, 2022
d80b8c7
Update Ge5H12.relax.in
simonebrozzesi Apr 26, 2022
65a1a5c
Update Grafene.scf.in
simonebrozzesi Apr 26, 2022
3c48b57
Create Si_bulk_nscf_kpt5.in
simonebrozzesi Apr 26, 2022
891fb33
Create Si_bulk_nscf_kpt10.in
simonebrozzesi Apr 26, 2022
3a1f78c
Create Si_bulk_nscf_kpt20.in
simonebrozzesi Apr 26, 2022
a6aa6f9
Create Si_bulk_nscf_bnd5.in
simonebrozzesi Apr 26, 2022
0c83c32
Create Si_bulk_nscf_bnd10.in
simonebrozzesi Apr 26, 2022
36a2a2d
Create Si_bulk_nscf_bnd15.in
simonebrozzesi Apr 26, 2022
41f0afd
Create link.sh
simonebrozzesi Apr 26, 2022
80916ca
Update link.sh
simonebrozzesi Apr 26, 2022
b6ac2f4
Update README.md
simonebrozzesi Apr 26, 2022
69a003e
Update README.md
simonebrozzesi Apr 26, 2022
1107ffc
Update Si_bulk_nscf_bnd10.in
simonebrozzesi Apr 26, 2022
a9174c0
Update Si_bulk_nscf_bnd5.in
simonebrozzesi Apr 26, 2022
5478734
Update Si_bulk_nscf_bnd15.in
simonebrozzesi Apr 26, 2022
7488839
Update Si_bulk_nscf_kpt10.in
simonebrozzesi Apr 26, 2022
0abda78
Update Si_bulk_nscf_kpt20.in
simonebrozzesi Apr 26, 2022
b5ab679
Update Si_bulk_nscf_kpt5.in
simonebrozzesi Apr 26, 2022
def0795
Fixed threshold
May 9, 2024
3c8fb1a
Fixed threshold
May 9, 2024
e721fc8
Fixed threshold, added log
May 9, 2024
f2517cf
Fixed threshold, added log
May 9, 2024
d51dcb9
Update README.md
cdhogan May 9, 2024
bcd4c24
Fixed threshold
May 9, 2024
55f5b65
Merge branch 'master' of github.com:cdhogan/DFT-basics
May 9, 2024
e6c841f
Update README.md
cdhogan May 9, 2024
377590e
Update README.md
cdhogan May 9, 2024
d9a64f9
Update README.md
cdhogan May 9, 2024
2bb1445
Rename Etot_vs_kgrid.png to Etot_vs_kgrid-mRy.png
cdhogan May 9, 2024
41a5011
Update README.md
cdhogan May 9, 2024
0487136
Threshold Gr
May 9, 2024
0a08602
Update README.md
cdhogan May 9, 2024
4683ae4
Fixed thres to Ry
May 9, 2024
9095856
Update README.md
cdhogan May 10, 2024
fd16490
Update README.md
cdhogan May 10, 2024
f347089
Update graphene.scf.in
cdhogan May 15, 2024
05a7c2b
Update README.md
cdhogan Jun 4, 2024
4cb3b79
Update README.md
cdhogan Jun 4, 2024
4510f0c
adding avogradro2
cdhogan Jun 4, 2024
7f6db32
adding avogradro2
cdhogan Jun 4, 2024
f19b2d5
matproj
cdhogan Jun 4, 2024
374006f
wurtzute
cdhogan Jun 4, 2024
54b6886
more avogadro2 menus
cdhogan Jun 4, 2024
06fd921
Add files via upload
cdhogan Dec 4, 2024
d88968b
Add files via upload
cdhogan Dec 4, 2024
e2f0a27
Add files via upload
cdhogan Dec 4, 2024
5806520
Update README.md
cdhogan Dec 4, 2024
b46efae
Update README.md
cdhogan Dec 6, 2024
c5b9af9
New DOS
cdhogan Apr 14, 2025
3a75619
Update DOS README.md
cdhogan Apr 15, 2025
6cb174d
adding figures
cdhogan Apr 15, 2025
e98d2e9
Update README.md
cdhogan Apr 15, 2025
d23bd5f
images
cdhogan Apr 15, 2025
53cd80a
Update README.md
cdhogan Apr 15, 2025
06aeb95
more plots
cdhogan Apr 15, 2025
3b0f51e
Merge branch 'master' of github.com:cdhogan/DFT-basics
cdhogan Apr 15, 2025
7c50711
Update README.md
cdhogan Apr 15, 2025
ccf7b27
Update README.md
cdhogan Apr 15, 2025
6bfa258
Update README.md
cdhogan Apr 15, 2025
ef390e0
add gnuplot tutorial
cdhogan Apr 15, 2025
888b57a
Update README.md
cdhogan Apr 16, 2025
d51e119
Update README.md
cdhogan Apr 16, 2025
ffbffb9
readme
cdhogan Apr 22, 2025
9f61242
charge
cdhogan Apr 22, 2025
a763a87
Update README.md
cdhogan Apr 22, 2025
4eeb461
Update README.md
cdhogan Apr 22, 2025
4706336
Add DOS and PROJWFC
cdhogan Apr 22, 2025
7f698fc
bands no README
cdhogan Apr 22, 2025
73e51ee
README
cdhogan Apr 22, 2025
3d87678
Update README.md
cdhogan Apr 22, 2025
cef9bfb
Update README.md
cdhogan Apr 22, 2025
9a0b3f4
Update README.md
cdhogan Apr 22, 2025
8e35baf
README
cdhogan Apr 22, 2025
3e15b3b
Merge branch 'master' of github.com:cdhogan/DFT-basics
cdhogan Apr 22, 2025
e4319fd
alat script
cdhogan Apr 22, 2025
583c5ac
Update README.md
cdhogan Apr 23, 2025
df97030
Update README.md
cdhogan Apr 23, 2025
28c27bc
Quick README
cdhogan Apr 23, 2025
716e77a
Update README.md
cdhogan Apr 23, 2025
674741b
BZ
cdhogan Apr 23, 2025
90b2e76
Update README.md
cdhogan Apr 23, 2025
ba006da
Update README.md
cdhogan Apr 23, 2025
7c97333
Added scripts for Si optics
cdhogan Apr 24, 2025
63e17c0
Added scripts for Si optics
cdhogan Apr 24, 2025
467fbfc
adding projected bands Gr
cdhogan Apr 25, 2025
d677c82
figs
cdhogan Apr 25, 2025
eca94d3
script
cdhogan Apr 25, 2025
1428e4d
figs
cdhogan Apr 25, 2025
1c0d94f
Update README.md
cdhogan Apr 25, 2025
58a4d2f
Update README.md
cdhogan Apr 25, 2025
54b0be8
Update README.md
cdhogan Apr 25, 2025
4419f27
Update README.md
cdhogan Apr 25, 2025
05204e4
Update README.md
cdhogan Apr 25, 2025
b954ac2
reordering
cdhogan Apr 25, 2025
ae71259
proj bands files
cdhogan Apr 25, 2025
7dfeb02
Update README.md
cdhogan Apr 25, 2025
7a65d0d
proj graphs
cdhogan Apr 25, 2025
fd187cd
Update README.md
cdhogan Apr 25, 2025
1baded3
kpdos
cdhogan Apr 25, 2025
66e5fba
Update README.md
cdhogan Apr 25, 2025
2054c1c
kpdos gnuplot to check
cdhogan Apr 25, 2025
d28fe9b
Merge branch 'master' of github.com:cdhogan/DFT-basics
cdhogan Apr 25, 2025
8187868
Update README.md
cdhogan Apr 25, 2025
55af741
Update README.md
cdhogan Apr 25, 2025
628bc50
kpdos
cdhogan Apr 25, 2025
36e734e
Update README.md
cdhogan Apr 25, 2025
0e67fe4
Update README.md
cdhogan Apr 29, 2025
316ebf7
CO new order
cdhogan Apr 29, 2025
8857a60
Relax
cdhogan Apr 29, 2025
88591af
Update README.md
cdhogan Apr 29, 2025
715b2f5
Update README.md
cdhogan Apr 29, 2025
97fd468
Update README.md
cdhogan Apr 29, 2025
44774ca
Update README.md
cdhogan Apr 29, 2025
dd555e6
Update README.md
cdhogan Apr 29, 2025
aea985e
minimal
cdhogan Apr 30, 2025
a798812
miniaml
cdhogan Apr 30, 2025
f69f393
Update README.md
cdhogan Apr 30, 2025
5a80ca8
new binding CO
cdhogan May 1, 2025
2e6bb58
Merge branch 'master' of github.com:cdhogan/DFT-basics
cdhogan May 1, 2025
78b26a0
new binding
cdhogan May 1, 2025
ee7ee2d
Update README.md
cdhogan May 1, 2025
a7ef431
figure
cdhogan May 1, 2025
1c76b2f
Update README.md
cdhogan May 1, 2025
4343226
new dissociation tutorial
cdhogan May 2, 2025
0e0fa6d
Update README.md
cdhogan May 2, 2025
fbc5752
Update README.md
cdhogan May 2, 2025
de51ebb
more points
cdhogan May 2, 2025
c239c5a
Update README.md
cdhogan May 2, 2025
e5885c8
Al O pseudo
cdhogan May 15, 2025
824e097
Al001 surface
cdhogan May 15, 2025
6306b43
Al001/O
cdhogan May 20, 2025
b694344
Al001/O
cdhogan May 20, 2025
1345985
figure
cdhogan May 20, 2025
436f52f
figure
cdhogan May 20, 2025
28ecddc
Update README.md
cdhogan May 20, 2025
b409c51
Update README.md
cdhogan May 20, 2025
27fe22b
Update README.md
cdhogan May 20, 2025
7a48006
ads
cdhogan May 20, 2025
4ab1b8b
add
cdhogan May 20, 2025
8fdafe3
Update README.md
cdhogan May 20, 2025
abac334
parallel
cdhogan May 20, 2025
f3ef9b5
Merge branch 'master' of github.com:cdhogan/DFT-basics
cdhogan May 20, 2025
ddf760a
parallel
cdhogan May 20, 2025
e3a7be5
Update README.md
cdhogan May 20, 2025
a3ad794
Update README.md
cdhogan May 20, 2025
82fd156
charge
cdhogan May 20, 2025
9b3dda0
Update README.md
cdhogan May 20, 2025
6bf07d9
CDD
cdhogan May 20, 2025
d72b399
Update README.md
cdhogan May 22, 2025
cd5c448
Update README.md
cdhogan May 22, 2025
590e245
potential
cdhogan May 23, 2025
f10e0c6
charge
cdhogan May 23, 2025
87da074
Update README.md
cdhogan May 23, 2025
a7f7cc9
figs
cdhogan May 23, 2025
0dcdf79
Merge branch 'master' of github.com:cdhogan/DFT-basics
cdhogan May 23, 2025
113ff22
Update README.md
cdhogan May 23, 2025
885c077
bader
cdhogan May 23, 2025
f306d33
Merge branch 'master' of github.com:cdhogan/DFT-basics
cdhogan May 23, 2025
5cc1c55
Update README.md
cdhogan May 23, 2025
2de9a63
optics
cdhogan May 24, 2025
a3b5814
Update README.md
cdhogan May 24, 2025
d8d668f
pw
cdhogan May 24, 2025
8a94561
pw
cdhogan May 24, 2025
fdd995d
Update README.md
cdhogan May 24, 2025
2492b08
expt
cdhogan May 24, 2025
5afc325
Update README.md
cdhogan May 24, 2025
f0e2a7f
vh
cdhogan May 24, 2025
f0fd877
Update README.md
cdhogan May 24, 2025
b7c1b31
graphene optics
cdhogan May 24, 2025
343007c
Update README.md
cdhogan May 24, 2025
d04f3a4
pw2gw
cdhogan May 25, 2025
c5049b3
epsilon
cdhogan May 25, 2025
bb1d26d
Update README.md
cdhogan May 25, 2025
8ea78de
XC
cdhogan May 26, 2025
ac8da07
orca
cdhogan May 26, 2025
5427f4a
Update README.md
cdhogan May 28, 2025
6bf0104
Update README.md
cdhogan May 30, 2025
c7acef9
Update README.md
cdhogan Jun 1, 2025
e21caa7
Update README.md
cdhogan Jun 3, 2025
085b7d8
PSeudo libraries
cdhogan Jun 3, 2025
0fccf1c
Script
cdhogan Jun 3, 2025
6856648
Update README.md
cdhogan Jun 4, 2025
a55abd8
vc final
cdhogan Jun 4, 2025
87e04d8
XC
cdhogan Jun 4, 2025
751d92e
Update README.md
cdhogan Jun 4, 2025
2d6542b
Update README.md
cdhogan Jun 4, 2025
ad718d2
Update README.md
cdhogan Jun 4, 2025
b8dd0c8
tidying up
cdhogan Jun 4, 2025
0a3b1e9
Merge branch 'master' of github.com:cdhogan/DFT-basics
cdhogan Jun 4, 2025
c03965b
cleaning up
cdhogan Jun 4, 2025
6bfc272
cleaning up
cdhogan Jun 4, 2025
4231f33
cleaning up
cdhogan Jun 4, 2025
39b7147
cleaning up
cdhogan Jun 4, 2025
a9bca98
cleaning up
cdhogan Jun 4, 2025
b6c4f12
cleaning up
cdhogan Jun 4, 2025
811d2ba
Al PP missing
cdhogan Jun 4, 2025
6e6a1d4
Update README.md
cdhogan Jun 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
Binary file added 0_Si_bulk/.DS_Store
Binary file not shown.
119 changes: 92 additions & 27 deletions 0_Si_bulk/0_cutoff/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,103 @@
# Convergency on the kinetic cutoff
QE expands the wavefunctions on a plane wave(PW) basis set.
As with any set, an infinite number of function is required to perfectly represent the original function.
We need to limit the number of PW to the smallest number that represent our system accurately
Look at the file Docs/DFT1.pdf page 16-18
1. Run the calculation using the provided input file:
```
pw.x < si.scf-manual.in > si.scf-manual.out
or to use multiple processors (parallel run) (require parallel version to be compiled)
mpirun -np 2 pw.x < si.scf-manual.in > si.scf-manual.out
```
2. Look at the information presented on the output file ('Docs/OUTPUT_PW' run with verbosity = 'high')
- An header containing information of the version of espresso used
# Convergence on the kinetic energy cutoff
QE expands the wavefunctions on a plane wave (PW) basis set.
As with any basis set, an infinite number of functions is required to perfectly represent the original function.
We need to limit the number of PW to the smallest number that represents our system accurately.

1. Look at the provided input file for bulk silicon and visualize it with `Xcrysden`. A brief explanation of variables is given in the file. Complete details are given on the [QE website](https://www.quantum-espresso.org/Doc/INPUT_PW.html).
```
% cat si.scf.in
% xcrysden --pwi si.scf.in
```
Now run the calculation, redirecting the output to a file:
```
% pw.x < si.scf.in > si.scf.out
```
or to use multiple processors, if quantum-espresso has been compiled in parallel
```
% mpirun -np 2 pw.x < si.scf.in > si.scf.out
```
2. Look at the information presented on the output file
- A header containing information of the version of espresso used
- A recap on the information of the system
- A list of matrix representation of the symmetries of the system + the character table of the symmetries
- The list of the point in k-space used
- The list of the points in k-space used
- The information on each self-consistent iteration
- The eigenvalues and occupations for the requested Kohn-Sham states at every k-point
- The total energy marked by a ! ( as a sum of different contributions)
- The forces acting on the atoms (should be 0 for a system at the equilibrium)
- Information on the time for each subroutine (Usefule for big calculation)
3. Repeat step 1 and change each time the value of ecutwfc from 5 up to 30 and the name of the output as to not override them
- Information on the total time and time for each subroutine. Note that QE often uses Rydberg and bohr atomic units: 1 Ry = 13.6057eV, 1 bohr = 0.529177 Angstrom.
3. Repeat step 1 and change each time the value of `ecutwfc` from 5 up to 30 Ry and the name of the output (so as to not overwrite them)
```
% pw.x < si.scf.in > si.scf.out_5Ry
```
Modify (edit) the `si.scf.in` file and change `ecutwfc = 5` to `ecutwfc = 10`
```
% pw.x < si.scf.in > si.scf.out_10Ry
```
You can also make this change directly to the original input file using the `sed` command:
```
% sed -e 's/ecutwfc = 5/ecutwfc = 10/' si.scf.in > si.scf.in_10Ry
% grep 'ecutwfc' si.scf.in_10Ry
ecutwfc = 10,
% pw.x < si.scf.in_10Ry > si.scf.out_10Ry
```
Repeat for 15,20,25 and 30 Ry.
```
[...]
% pw.x < si.scf.in > si.scf.out_30Ry
```
4. Use grep to print out the total energies from all files in one command using the wildcard *
```
% grep -e '!' *out*Ry
si.scf.out_10Ry:! total energy = -15.77444885 Ry
[...]
```
pw.x < si.scf-manual.in > si.scf-manual.out_5
change ecutwfc 5 -> 10
pw.x < si.scf-manual.in > si.scf-manual.out_10
...
change ecutwfc 25 -> 30
pw.x < si.scf-manual.in > si.scf-manual.out_30
4. Use grep to collect the total energies from all files in one command
Copy and paste the cutoff energies and total energies into a 2 column file (Ecut,Etot) called 'Etot_vs_Ecut.dat' and plot it to see if you have reached convergence.
```
gnuplot> plot "Etot_vs_Ecut.dat" w l
```
To the eye, the total energy looks well converged at 30 Ry. This is misleading however, as it simply depends on the energy range of your plot - see the logscale plot on the right. The correct threshold to use depends on what quantity (observable) you want to compute: a bond length, a lattice parameter, an energy gap, a binding energy, an STM image, a vibrational frequency...and to what precision you want!

Here are some rough guidelines on convergence (not for production/publication!):
* Total energy: 1 mRy/atom = 13.6 meV/atom (0.1 mRy/atom is better)
* Bond length: 0.002 Å
* Cell parameters: 0.01 Å
* Energy differences: 0.37 mRy/atom = 5 meV/atom (0.1 mRy/atom is better)
* Forces: 10 meV/Å

_NB: you must ALWAYS perform convergence tests yourself for your system!!_


![Total energy vs kinetic energy cutoff](Ref/Etot_vs_Ecut.png?raw=true "Total energy vs kinetic energy cutoff")

If the plot doesn't look right, make sure you have used the right cutoff in the appropriate input and output files:
```
% grep 'kinetic-energy cutoff' si.scf.out_25Ry
kinetic-energy cutoff = 25.0000 Ry
% grep 'ecutwfc' si.scf.in_25Ry
ecutwfc = 25,
```

6. Use grep on each file to extract the eigenvalues of the highest occupied and lowest unoccupied bands, and compute the band gap using the 'bc -l' program
```
grep -e "!" *
% grep -e 'highest' *out*Ry
si.scf.out_5Ry: highest occupied, lowest unoccupied level (ev): 6.0229 7.5083
% bc -l
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
7.5083-6.0229
1.4854
quit
```
5. Save the cutoff energies and total energies in a 2 column file and plot it to see if you have reached convergence
6. The script 'run_ecut' will do automatically everything from step 3 to 5 (explained using comments inside the script)
Save the energies in a 4 column file (Ecut, VBM, CBM, gap) called 'Gap_vs_Ecut.dat' and plot them versus the cutoff. How does the convergence compare with the value expected from the total energy run?
![Eigenvalues and gap vs kinetic energy cutoff](Ref/Gap_vs_Ecut.png?raw=true "Gap vs kinetic energy cutoff")
7. ADVANCED USERS: The shell scripts 'run_ecut' and 'run_plots' in the 'Script' directory will do everything automatically from step 3 to 5 (explained using comments inside the script). You may first have to modify the ENVIRONMENT_VARIABLES file in the root directory. The scripts must be run from the main 0_cutoff directory (or copied there). Hit 'q' to cycle through plot windows as they appear. Inspect the PDFs or PNGs that are created.
```
./run_ecut
./Script/run_ecut
./Script/run_plots
```
NB: Do not use the scripts for your own projects unless you understand well how they work!

### When you have completed this tutorial, you can move on to [1_kpoints: Convergence with k-points](../1_kpoints)
Binary file removed 0_Si_bulk/0_cutoff/Ref/E_vs_ecut.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ecut(Ry) Energy(Ry)
5 -15.60596061
10 -15.77444902
15 -15.83462803
10 -15.77444885
15 -15.83462812
20 -15.84756981
25 -15.85122085
30 -15.85219549
30 -15.85219551
Binary file added 0_Si_bulk/0_cutoff/Ref/Etot_vs_Ecut.pdf
Binary file not shown.
Binary file added 0_Si_bulk/0_cutoff/Ref/Etot_vs_Ecut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions 0_Si_bulk/0_cutoff/Ref/Gap_vs_Ecut.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Ecut VBM CBM Gap
5 6.0229 7.5083 1.4854
10 5.9615 7.1803 1.2188
15 5.9315 7.0729 1.1414
20 5.9210 7.0430 1.122
25 5.9101 7.0316 1.1215
30 5.9063 7.0268 1.1205
Binary file added 0_Si_bulk/0_cutoff/Ref/Gap_vs_Ecut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0_Si_bulk/0_cutoff/Ref/Gap_vs_ecut.pdf
Binary file not shown.
44 changes: 10 additions & 34 deletions 0_Si_bulk/0_cutoff/run_ecut → 0_Si_bulk/0_cutoff/Script/run_ecut
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@ echo "TMP_DIR:" $TMP_DIR
echo "Parallel command:" $RUN_COMMAND
echo "Started at: " `date`

SAVE=E_vs_ecut.dat #NAME=something assign a variable of name NAME and value something (can be a string ora number)
# Prepare the files to be plotted
SAVE=Etot_vs_Ecut-script.dat #NAME=something assign a variable of name NAME and value something (can be a string ora number)
#!!!!!! There must be no spaces when assigning variable
#Use "... ..." for a string with spaces
GAP=Gap_vs_ecut.dat
echo -e "# ecut(Ry)\tEnergy(Ry)" > $SAVE # COMMAND > NAME write the stdout of the command COMMAND into the file NAME
echo -e "# Ecut(Ry)\tEnergy(Ry)" > $SAVE # COMMAND > NAME write the stdout of the command COMMAND into the file NAME
#Create the file if it does not exist
#Overwrite the file it exist
#Use >> to append at the end of the file

GAP=Gap_vs_Ecut-script.dat
echo -e "# Ecut(Ry)\tVBM\tCBM\tGap (eV)" > $GAP

# Loop over cutoff energies
for ecut in 5 10 15 20 25 30; do #for NAME in LIST; do ... done
#cicle the variable NAME in a list of elements

IN=si_script.scf.in
OUT=si.scf.out_ecut$ecut
OUT=si_script.scf.out_Ecut$ecut
#<<DELIM ... DELIM defines a block of text
#Will still resolve variables values using $NAME
#cat NAME/TEXT read a file or string/block of text and print it into the stdout
Expand Down Expand Up @@ -73,36 +77,8 @@ echo -e "$ecut\t\t$ENERGY" >> $SAVE
BANDS=`cat $OUT | grep highest | awk '{print $7,$8,$8-$7}'`
echo -e "$ecut\t\t$BANDS" >> $GAP

done
done # end of main loop over cutoff energy

echo "Run completed at: " `date`

#Print a gnuplot script to plot the 2 column files
cat > plot.gnu <<EOF
#!/usr/bin/gnuplot

set term wxt enhanced

set xlabel "E_{cut} (Ry)"
set ylabel "E_{tot} (Ry)

plot \
'$SAVE' u 1:2 w lp pt 7 lw 2 lc rgb "black" title "E vs E_{cut}"

pause -1
set term pdfcairo enhanced
set output "${SAVE}.pdf"
replot
EOF

#Run the gnuplot script to make the plot
gnuplot plot.gnu



exit




echo "Now run the run_plots script"

120 changes: 120 additions & 0 deletions 0_Si_bulk/0_cutoff/Script/run_plots
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/usr/bin/env bash

SAVE=Etot_vs_Ecut-script.dat
GAP=Gap_vs_Ecut-script.dat

#Print a gnuplot script to plot the 2 column files
cat > plot-energy-script.gnu <<EOF
#!/usr/bin/gnuplot

# x11 should work on any system
# try wxt (ubuntu) or aqua (mac) for nicer plots
reset
set term x11 enhanced
set out

set xlabel "E_{cut} (Ry)"
set ylabel "E_{tot} (Ry)
thres_1mRy_per_atom=0.001*2
thres_10mRy_per_atom=0.01*2

plot \
'$SAVE' u 1:2 w lp pt 7 lw 2 lc rgb "black" title "Total energy"
replot GPVAL_DATA_Y_MIN t "Min value" w l lt 4 dt 4 lc "red",\
GPVAL_DATA_Y_MIN+thres_1mRy_per_atom w l lt 2 lc "blue" t "Min + 1mRy/atom",\
GPVAL_DATA_Y_MIN+thres_10mRy_per_atom w l lt 3 lc "magenta" t "Min + 10mRy/atom"



pause -1
set term pdfcairo enhanced
set output "${SAVE}.pdf"
replot

reset
set term pngcairo enhanced size 800,400
set output "${SAVE}.png"
set xlabel "E_{cut} (Ry)"
set ylabel "E_{tot} (Ry)
thres_1mRy_per_atom=0.001*2
thres_10mRy_per_atom=0.01*2
stats '$SAVE' u 1:2 name 'EN' nooutput
set multiplot

set size 0.6,0.9
set origin 0.03,0.05

plot \
'$SAVE' u 1:2 w lp pt 7 lw 2 lc rgb "black" title "Total energy",\
EN_min_y t "Min value" w l lt 4 dt 4 lc "red",\
EN_min_y+thres_1mRy_per_atom w l lt 2 lc "blue" t "Min + 1mRy/atom",\
EN_min_y+thres_10mRy_per_atom w l lt 3 lc "magenta" t "Min + 10mRy/atom"

set size 0.38,0.9
set origin 0.63,0.05
set ylabel "log_{10} (E_{tot}-E_{min}) (Ry)
set xlabel "E_{cut} (Ry)"
set grid y
set autoscale y
set logscale y
set yrange [0.0001:1]
plot \
'$SAVE' u 1:(\$2-EN_min_y) w lp pt 7 lw 2 lc rgb "black" title "Total energy"
set nomulti
pause -1
set term x11
set out
replot
pause -1

EOF


#Run the gnuplot script to make the plot of the total energy
gnuplot plot-energy-script.gnu

#Print a gnuplot script to plot the 4 column files
cat > plot-gap-script.gnu <<EOF
#!/usr/bin/gnuplot

set xlabel "E_{cut} (Ry)"
set ylabel "E (eV)

# Generate a PDF image
set term pdfcairo enhanced
set output "${GAP}.pdf"
set multiplot layout 1,2
plot \
'$GAP' u 1:3 w lp pt 7 lw 2 lc rgb "red" title "CBM",\
'$GAP' u 1:2 w lp pt 6 lw 2 lc rgb "blue" title "VBM"
plot \
'$GAP' u 1:4 w lp pt 5 lw 2 lc rgb "black" title "Gap"
set nomulti

# Generate a PNG image (useful for GitHub)
set term pngcairo enhanced size 800,400
set output "${GAP}.png"
set multiplot layout 1,2
plot \
'$GAP' u 1:3 w lp pt 7 lw 2 lc rgb "red" title "CBM",\
'$GAP' u 1:2 w lp pt 6 lw 2 lc rgb "blue" title "VBM"
plot \
'$GAP' u 1:4 w lp pt 5 lw 2 lc rgb "black" title "Gap"
set nomulti
replot

# Plot onscreen just the gap.
# x11 should work on most system. Try wxt (ubuntu) or aqua (mac) for nicer plots.
set term x11 enhanced
set out
plot \
'$GAP' u 1:4 w lp pt 5 lw 2 lc rgb "black" title "Gap"
replot
pause -1
EOF

#Run the gnuplot script to make the plot
gnuplot plot-gap-script.gnu

exit

Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
&CONTROL
calculation = "scf", !Type of calculation to be run
prefix = "Si", !Prefix that will mark the temporary datafiles.
!KEEP THE SAME FOR CALCULATION ON THE SAME MATERIAL
pseudo_dir = "../../Pseudo", !Directory where psuedopotential files are located
!KEEP THE SAME FOR ALL CALCULATIONS ON THE SAME MATERIAL
pseudo_dir = "../../Pseudo", !Directory where pseudopotential files are located
outdir = "./tmp", !Directory where temporary files are stored for further post-processing
restart_mode = "from_scratch"
verbosity = "high", !Amount of details to be printed in the output
tprnfor = .true. !If .true. calculate forces on atoms
wf_collect=.true. !Collect all temporary files (strongly advise to use this expecally for parallel runs)
!Only downside, it will consume some time to collect and write the data (not relevant for this tutorial)
/
&SYSTEM
ibrav = 2, !Number that specifies the Bravais lattice 2=FCC
celldm(1) = 10.21, !Specify the side lenght of the FCC lattice in [bohr]
celldm(1) = 10.21, !Specify the side length of the FCC lattice in [bohr]
!Look at the documentation for the meaning of celldim(1/2/3) for all lattices
nat = 2, !Total number of atoms in the unit cell
!The number of lines under the NAMELIST 'ATOMIC_POSITIONS' must be the same as 'nat'
ntyp = 1, !The number of types of atoms (pseudopotentials loaded)
!The number of lines under the NAMELIST 'ATOMIC_SPECIES' must be the same as 'ntyp'
ecutwfc = 5, !The kinetict cutoff on the wave functions in [Ry]
nbnd = 5 !The number of Kohn-Sham states to be calculated
ecutwfc = 5, !The kinetic energy cutoff on the wave functions in [Ry]
nbnd = 6 !The number of Kohn-Sham states to be calculated (here 4 occupied, 1 empty)
/
&ELECTRONS
conv_thr = 1.D-8, !Convergency threshold for self-consistency
mixing_beta = 0.7D0 , !Mix current charge density with previous. (Can influence convergence speed)
/
ATOMIC_SPECIES
Si 28.086 Si.pz-vbc.UPF
ATOMIC_POSITIONS
ATOMIC_POSITIONS {alat}
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS {automatic}
Expand Down
20 changes: 0 additions & 20 deletions 0_Si_bulk/1_alat/README.md

This file was deleted.

Loading