Skip to content

Commit

Permalink
correct and add details about epsilon calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
pranabdas committed Sep 29, 2023
1 parent 0040964 commit afcad01
Show file tree
Hide file tree
Showing 10 changed files with 2,012 additions and 1,703 deletions.
36 changes: 25 additions & 11 deletions docs/hands-on/epsilon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
title: Dielectric constant
---

First we perform our self consistent field calculation:
First we perform self consistent field calculation:

```bash
mpirun -np 4 pw.x -in pw.scf.silicon.in > pw.scf.silicon.out
mpirun -np 4 pw.x -i pw.scf.silicon_epsilon.in > pw.scf.silicon_epsilon.out
```

Next step we perform `nscf` calculation:

import CodeBlock from '@theme/CodeBlock';
import pw_nscf_silicon_in from '!!raw-loader!/src/silicon/pw.nscf.silicon_epsilon.in';
import pw_scf_silicon_in from '!!raw-loader!/src/silicon/pw.scf.silicon_epsilon.in';

<CodeBlock language="bash" title="src/silicon/pw.nscf.silicon_epsilon.in" showLineNumbers>{pw_nscf_silicon_in}</CodeBlock>
<CodeBlock language="bash" title="src/silicon/pw.scf.silicon_epsilon.in" showLineNumbers>{pw_scf_silicon_in}</CodeBlock>

Especially, notice following changes:

```fortran
nbnd = 16
nbnd = 20
nosym = .true.
noinv = .true.
```
Expand All @@ -27,9 +25,16 @@ We turn off the automatic reduction of k-points that `pw.x` does by using
crystal symmetries (`nosym = .true.` and `noinv = .true.`). This is because
`epsilon.x` does not recognize crystal symmetries, therefore the entire list of
k-points in the grid is needed. Secondly, we calculate a larger number of bands
(16), since we are interested in interband transitions.
(20), since we are interested in interband transitions. Also, note that
`epsilon.x` doesn't support the reduction of the k-points grid into the
irreducible Brillouin zone, so the PW runs must be performed with a uniform
k-points grid and all k-points weights must be equal to each other, i.e. in the
k-points card the k-points coordinates must be given manually in `crystal` or
`alat` or `bohr`, but not with the `automatic` option. However, the automatic
k-points option seems to work. If necessary, we can perform `nscf` calculation
with finer k-grid.

The final step is to prepare the input file for `epsilon.x`:
Next step is to prepare the input file for `epsilon.x`:

import epsilon_si from '!!raw-loader!/src/silicon/epsilon.si.in';

Expand All @@ -41,7 +46,7 @@ given above. The variables `wmin`, `wmax` and `nw` define the energy grid for
the dielectric function. All the energy variables are in eV.

```bash
mpirun -np 1 epsilon.x < epsilon.si.in > epsilon.si.out
mpirun -np 4 epsilon.x -i epsilon.si.in > epsilon.si.out
```

We will see the results are saved in separate `.dat` files. We can plot the real
Expand Down Expand Up @@ -76,6 +81,15 @@ plt.show()

:::warning

Ultra-soft pseudopotentials do not work with `epsilon.x`.
Ultra-soft pseudopotentials do not work with `epsilon.x`. Also note that the
above example is not tested against the k-mesh. We usually need finer k-mesh for
$\epsilon$ to converge. By default the maximum number of k-points is set to
40000 in Quantum Espresso, if we need more k-points, we can change
[Modules/parameters.f90](https://gitlab.com/QEF/q-e/-/blob/develop/Modules/parameters.f90)
and recompile Quantum Espresso.

:::

### Resources

- <a target="_blank" href={require('/resources/eps_man.pdf').default}>Epsilon.x manual</a>
6 changes: 3 additions & 3 deletions notebooks/silicon-epsilon.ipynb

Large diffs are not rendered by default.

1,413 changes: 730 additions & 683 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@easyops-cn/docusaurus-search-local": "^0.35.0",
"@docusaurus/core": "2.4.3",
"@docusaurus/preset-classic": "2.4.3",
"@easyops-cn/docusaurus-search-local": "^0.36.0",
"@mdx-js/react": "^1.6.22",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.2.1",
Expand Down
Binary file modified resources/eps_man.pdf
Binary file not shown.
998 changes: 499 additions & 499 deletions src/silicon/epsi_silicon.dat

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/silicon/epsilon.si.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
&inputpp
outdir = "/tmp/silicon/"
outdir = "/tmp/"
prefix = "silicon"
calculation = "eps"
/
Expand Down
1,002 changes: 501 additions & 501 deletions src/silicon/epsr_silicon.dat

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/silicon/pw.nscf.silicon_epsilon.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
&CONTROL
calculation = 'nscf',
prefix = 'silicon',
outdir = '/tmp/silicon/'
outdir = '/tmp/'
pseudo_dir = '../pseudos/'
verbosity = 'high'
/
Expand All @@ -12,7 +12,7 @@
nat = 2,
ntyp = 1,
ecutwfc = 30
nbnd = 16
nbnd = 20
nosym = .true.
noinv = .true.
/
Expand Down
248 changes: 248 additions & 0 deletions src/silicon/pw.scf.silicon_epsilon.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
&CONTROL
calculation = 'scf',
prefix = 'silicon',
outdir = '/tmp/'
pseudo_dir = '../pseudos/'
verbosity = 'high'
/

&SYSTEM
ibrav = 2,
celldm(1) = 10.26,
nat = 2,
ntyp = 1,
ecutwfc = 40
nbnd = 20
nosym = .TRUE.
noinv = .TRUE.
/

&ELECTRONS
mixing_beta = 0.6
/

ATOMIC_SPECIES
Si 28.086 Si.pz-vbc.UPF

ATOMIC_POSITIONS (alat)
Si 0.0 0.0 0.0
Si 0.25 0.25 0.25

K_POINTS crystal
216
0.00000000 0.00000000 0.00000000 4.629630e-03
0.00000000 0.00000000 0.16666667 4.629630e-03
0.00000000 0.00000000 0.33333333 4.629630e-03
0.00000000 0.00000000 0.50000000 4.629630e-03
0.00000000 0.00000000 0.66666667 4.629630e-03
0.00000000 0.00000000 0.83333333 4.629630e-03
0.00000000 0.16666667 0.00000000 4.629630e-03
0.00000000 0.16666667 0.16666667 4.629630e-03
0.00000000 0.16666667 0.33333333 4.629630e-03
0.00000000 0.16666667 0.50000000 4.629630e-03
0.00000000 0.16666667 0.66666667 4.629630e-03
0.00000000 0.16666667 0.83333333 4.629630e-03
0.00000000 0.33333333 0.00000000 4.629630e-03
0.00000000 0.33333333 0.16666667 4.629630e-03
0.00000000 0.33333333 0.33333333 4.629630e-03
0.00000000 0.33333333 0.50000000 4.629630e-03
0.00000000 0.33333333 0.66666667 4.629630e-03
0.00000000 0.33333333 0.83333333 4.629630e-03
0.00000000 0.50000000 0.00000000 4.629630e-03
0.00000000 0.50000000 0.16666667 4.629630e-03
0.00000000 0.50000000 0.33333333 4.629630e-03
0.00000000 0.50000000 0.50000000 4.629630e-03
0.00000000 0.50000000 0.66666667 4.629630e-03
0.00000000 0.50000000 0.83333333 4.629630e-03
0.00000000 0.66666667 0.00000000 4.629630e-03
0.00000000 0.66666667 0.16666667 4.629630e-03
0.00000000 0.66666667 0.33333333 4.629630e-03
0.00000000 0.66666667 0.50000000 4.629630e-03
0.00000000 0.66666667 0.66666667 4.629630e-03
0.00000000 0.66666667 0.83333333 4.629630e-03
0.00000000 0.83333333 0.00000000 4.629630e-03
0.00000000 0.83333333 0.16666667 4.629630e-03
0.00000000 0.83333333 0.33333333 4.629630e-03
0.00000000 0.83333333 0.50000000 4.629630e-03
0.00000000 0.83333333 0.66666667 4.629630e-03
0.00000000 0.83333333 0.83333333 4.629630e-03
0.16666667 0.00000000 0.00000000 4.629630e-03
0.16666667 0.00000000 0.16666667 4.629630e-03
0.16666667 0.00000000 0.33333333 4.629630e-03
0.16666667 0.00000000 0.50000000 4.629630e-03
0.16666667 0.00000000 0.66666667 4.629630e-03
0.16666667 0.00000000 0.83333333 4.629630e-03
0.16666667 0.16666667 0.00000000 4.629630e-03
0.16666667 0.16666667 0.16666667 4.629630e-03
0.16666667 0.16666667 0.33333333 4.629630e-03
0.16666667 0.16666667 0.50000000 4.629630e-03
0.16666667 0.16666667 0.66666667 4.629630e-03
0.16666667 0.16666667 0.83333333 4.629630e-03
0.16666667 0.33333333 0.00000000 4.629630e-03
0.16666667 0.33333333 0.16666667 4.629630e-03
0.16666667 0.33333333 0.33333333 4.629630e-03
0.16666667 0.33333333 0.50000000 4.629630e-03
0.16666667 0.33333333 0.66666667 4.629630e-03
0.16666667 0.33333333 0.83333333 4.629630e-03
0.16666667 0.50000000 0.00000000 4.629630e-03
0.16666667 0.50000000 0.16666667 4.629630e-03
0.16666667 0.50000000 0.33333333 4.629630e-03
0.16666667 0.50000000 0.50000000 4.629630e-03
0.16666667 0.50000000 0.66666667 4.629630e-03
0.16666667 0.50000000 0.83333333 4.629630e-03
0.16666667 0.66666667 0.00000000 4.629630e-03
0.16666667 0.66666667 0.16666667 4.629630e-03
0.16666667 0.66666667 0.33333333 4.629630e-03
0.16666667 0.66666667 0.50000000 4.629630e-03
0.16666667 0.66666667 0.66666667 4.629630e-03
0.16666667 0.66666667 0.83333333 4.629630e-03
0.16666667 0.83333333 0.00000000 4.629630e-03
0.16666667 0.83333333 0.16666667 4.629630e-03
0.16666667 0.83333333 0.33333333 4.629630e-03
0.16666667 0.83333333 0.50000000 4.629630e-03
0.16666667 0.83333333 0.66666667 4.629630e-03
0.16666667 0.83333333 0.83333333 4.629630e-03
0.33333333 0.00000000 0.00000000 4.629630e-03
0.33333333 0.00000000 0.16666667 4.629630e-03
0.33333333 0.00000000 0.33333333 4.629630e-03
0.33333333 0.00000000 0.50000000 4.629630e-03
0.33333333 0.00000000 0.66666667 4.629630e-03
0.33333333 0.00000000 0.83333333 4.629630e-03
0.33333333 0.16666667 0.00000000 4.629630e-03
0.33333333 0.16666667 0.16666667 4.629630e-03
0.33333333 0.16666667 0.33333333 4.629630e-03
0.33333333 0.16666667 0.50000000 4.629630e-03
0.33333333 0.16666667 0.66666667 4.629630e-03
0.33333333 0.16666667 0.83333333 4.629630e-03
0.33333333 0.33333333 0.00000000 4.629630e-03
0.33333333 0.33333333 0.16666667 4.629630e-03
0.33333333 0.33333333 0.33333333 4.629630e-03
0.33333333 0.33333333 0.50000000 4.629630e-03
0.33333333 0.33333333 0.66666667 4.629630e-03
0.33333333 0.33333333 0.83333333 4.629630e-03
0.33333333 0.50000000 0.00000000 4.629630e-03
0.33333333 0.50000000 0.16666667 4.629630e-03
0.33333333 0.50000000 0.33333333 4.629630e-03
0.33333333 0.50000000 0.50000000 4.629630e-03
0.33333333 0.50000000 0.66666667 4.629630e-03
0.33333333 0.50000000 0.83333333 4.629630e-03
0.33333333 0.66666667 0.00000000 4.629630e-03
0.33333333 0.66666667 0.16666667 4.629630e-03
0.33333333 0.66666667 0.33333333 4.629630e-03
0.33333333 0.66666667 0.50000000 4.629630e-03
0.33333333 0.66666667 0.66666667 4.629630e-03
0.33333333 0.66666667 0.83333333 4.629630e-03
0.33333333 0.83333333 0.00000000 4.629630e-03
0.33333333 0.83333333 0.16666667 4.629630e-03
0.33333333 0.83333333 0.33333333 4.629630e-03
0.33333333 0.83333333 0.50000000 4.629630e-03
0.33333333 0.83333333 0.66666667 4.629630e-03
0.33333333 0.83333333 0.83333333 4.629630e-03
0.50000000 0.00000000 0.00000000 4.629630e-03
0.50000000 0.00000000 0.16666667 4.629630e-03
0.50000000 0.00000000 0.33333333 4.629630e-03
0.50000000 0.00000000 0.50000000 4.629630e-03
0.50000000 0.00000000 0.66666667 4.629630e-03
0.50000000 0.00000000 0.83333333 4.629630e-03
0.50000000 0.16666667 0.00000000 4.629630e-03
0.50000000 0.16666667 0.16666667 4.629630e-03
0.50000000 0.16666667 0.33333333 4.629630e-03
0.50000000 0.16666667 0.50000000 4.629630e-03
0.50000000 0.16666667 0.66666667 4.629630e-03
0.50000000 0.16666667 0.83333333 4.629630e-03
0.50000000 0.33333333 0.00000000 4.629630e-03
0.50000000 0.33333333 0.16666667 4.629630e-03
0.50000000 0.33333333 0.33333333 4.629630e-03
0.50000000 0.33333333 0.50000000 4.629630e-03
0.50000000 0.33333333 0.66666667 4.629630e-03
0.50000000 0.33333333 0.83333333 4.629630e-03
0.50000000 0.50000000 0.00000000 4.629630e-03
0.50000000 0.50000000 0.16666667 4.629630e-03
0.50000000 0.50000000 0.33333333 4.629630e-03
0.50000000 0.50000000 0.50000000 4.629630e-03
0.50000000 0.50000000 0.66666667 4.629630e-03
0.50000000 0.50000000 0.83333333 4.629630e-03
0.50000000 0.66666667 0.00000000 4.629630e-03
0.50000000 0.66666667 0.16666667 4.629630e-03
0.50000000 0.66666667 0.33333333 4.629630e-03
0.50000000 0.66666667 0.50000000 4.629630e-03
0.50000000 0.66666667 0.66666667 4.629630e-03
0.50000000 0.66666667 0.83333333 4.629630e-03
0.50000000 0.83333333 0.00000000 4.629630e-03
0.50000000 0.83333333 0.16666667 4.629630e-03
0.50000000 0.83333333 0.33333333 4.629630e-03
0.50000000 0.83333333 0.50000000 4.629630e-03
0.50000000 0.83333333 0.66666667 4.629630e-03
0.50000000 0.83333333 0.83333333 4.629630e-03
0.66666667 0.00000000 0.00000000 4.629630e-03
0.66666667 0.00000000 0.16666667 4.629630e-03
0.66666667 0.00000000 0.33333333 4.629630e-03
0.66666667 0.00000000 0.50000000 4.629630e-03
0.66666667 0.00000000 0.66666667 4.629630e-03
0.66666667 0.00000000 0.83333333 4.629630e-03
0.66666667 0.16666667 0.00000000 4.629630e-03
0.66666667 0.16666667 0.16666667 4.629630e-03
0.66666667 0.16666667 0.33333333 4.629630e-03
0.66666667 0.16666667 0.50000000 4.629630e-03
0.66666667 0.16666667 0.66666667 4.629630e-03
0.66666667 0.16666667 0.83333333 4.629630e-03
0.66666667 0.33333333 0.00000000 4.629630e-03
0.66666667 0.33333333 0.16666667 4.629630e-03
0.66666667 0.33333333 0.33333333 4.629630e-03
0.66666667 0.33333333 0.50000000 4.629630e-03
0.66666667 0.33333333 0.66666667 4.629630e-03
0.66666667 0.33333333 0.83333333 4.629630e-03
0.66666667 0.50000000 0.00000000 4.629630e-03
0.66666667 0.50000000 0.16666667 4.629630e-03
0.66666667 0.50000000 0.33333333 4.629630e-03
0.66666667 0.50000000 0.50000000 4.629630e-03
0.66666667 0.50000000 0.66666667 4.629630e-03
0.66666667 0.50000000 0.83333333 4.629630e-03
0.66666667 0.66666667 0.00000000 4.629630e-03
0.66666667 0.66666667 0.16666667 4.629630e-03
0.66666667 0.66666667 0.33333333 4.629630e-03
0.66666667 0.66666667 0.50000000 4.629630e-03
0.66666667 0.66666667 0.66666667 4.629630e-03
0.66666667 0.66666667 0.83333333 4.629630e-03
0.66666667 0.83333333 0.00000000 4.629630e-03
0.66666667 0.83333333 0.16666667 4.629630e-03
0.66666667 0.83333333 0.33333333 4.629630e-03
0.66666667 0.83333333 0.50000000 4.629630e-03
0.66666667 0.83333333 0.66666667 4.629630e-03
0.66666667 0.83333333 0.83333333 4.629630e-03
0.83333333 0.00000000 0.00000000 4.629630e-03
0.83333333 0.00000000 0.16666667 4.629630e-03
0.83333333 0.00000000 0.33333333 4.629630e-03
0.83333333 0.00000000 0.50000000 4.629630e-03
0.83333333 0.00000000 0.66666667 4.629630e-03
0.83333333 0.00000000 0.83333333 4.629630e-03
0.83333333 0.16666667 0.00000000 4.629630e-03
0.83333333 0.16666667 0.16666667 4.629630e-03
0.83333333 0.16666667 0.33333333 4.629630e-03
0.83333333 0.16666667 0.50000000 4.629630e-03
0.83333333 0.16666667 0.66666667 4.629630e-03
0.83333333 0.16666667 0.83333333 4.629630e-03
0.83333333 0.33333333 0.00000000 4.629630e-03
0.83333333 0.33333333 0.16666667 4.629630e-03
0.83333333 0.33333333 0.33333333 4.629630e-03
0.83333333 0.33333333 0.50000000 4.629630e-03
0.83333333 0.33333333 0.66666667 4.629630e-03
0.83333333 0.33333333 0.83333333 4.629630e-03
0.83333333 0.50000000 0.00000000 4.629630e-03
0.83333333 0.50000000 0.16666667 4.629630e-03
0.83333333 0.50000000 0.33333333 4.629630e-03
0.83333333 0.50000000 0.50000000 4.629630e-03
0.83333333 0.50000000 0.66666667 4.629630e-03
0.83333333 0.50000000 0.83333333 4.629630e-03
0.83333333 0.66666667 0.00000000 4.629630e-03
0.83333333 0.66666667 0.16666667 4.629630e-03
0.83333333 0.66666667 0.33333333 4.629630e-03
0.83333333 0.66666667 0.50000000 4.629630e-03
0.83333333 0.66666667 0.66666667 4.629630e-03
0.83333333 0.66666667 0.83333333 4.629630e-03
0.83333333 0.83333333 0.00000000 4.629630e-03
0.83333333 0.83333333 0.16666667 4.629630e-03
0.83333333 0.83333333 0.33333333 4.629630e-03
0.83333333 0.83333333 0.50000000 4.629630e-03
0.83333333 0.83333333 0.66666667 4.629630e-03
0.83333333 0.83333333 0.83333333 4.629630e-03

0 comments on commit afcad01

Please sign in to comment.