Commit c2323727 authored by Marco Govoni's avatar Marco Govoni
Browse files

Updated tutorial 1.0, Added tutorial 2.0

parent 29594568
%% Cell type:markdown id: tags:
This tutorial can be downloaded [link](http://greatfire.uchicago.edu/west-public/West/raw/master/doc/tutorials/west_100.ipynb).
%% Cell type:markdown id: tags:
# 1.0 Getting Started: GW calculation
%% Cell type:markdown id: tags:
In order to compute the GW electronic structure of the silane molecule you need to run `pw.x`, `wstat.x` and `wfreq.x` in sequence. Documentation for building and installing WEST is available at this [link](http://www.west-code.org/doc/West/latest/installation.html).
%% Cell type:markdown id: tags:
The GW workflow involves three sequental steps:
- Step 1: Ground State
- Step 2: Screening
- Step 3: Quasiparticle corrections
Each step is explained below. At the end of step 3 you will be able to obtain the electronic structure of the silane molecule at the $G_0W_0 @ PBE$ level of theory, where the GW is computed without empty states and with full frequency integration using the countour deformation technique. For more information about the implementation, we refer to [Govoni et al., J. Chem. Theory Comput. 11, 2680 (2015)](https://doi.org/10.1021/ct500958p).
%% Cell type:markdown id: tags:
## Step 1: Ground State
%% Cell type:markdown id: tags:
The ground state electronic structure of silane molecule with [QuantumEspresso](https://www.quantum-espresso.org/) is obtained by running `pw.x`. Currently, WEST supports the version 6.1.0 of Quantum Espresso. The pseudopotential files for **Si** and **H** in UPF format can be downloaded from: [QE-PP](https://www.quantum-espresso.org/pseudopotentials) database, or from [SG15](http://www.quantum-simulation.org/potentials/sg15_oncv/upf/) database. Check out the `pw.x` [input description](https://www.quantum-espresso.org/Doc/INPUT_PW.html) in order to generate an input file for QuantumEspresso called `pw.in`.
%% Cell type:markdown id: tags:
Download these files in your current working directory:
%% Cell type:code id: tags:
``` python
%%bash
wget -N -q http://www.west-code.org/doc/training/silane/pw.in
wget -N -q http://www.quantum-simulation.org/potentials/sg15_oncv/upf/H_ONCV_PBE-1.2.upf
wget -N -q http://www.quantum-simulation.org/potentials/sg15_oncv/upf/Si_ONCV_PBE-1.2.upf
```
%% Cell type:markdown id: tags:
Let's inspect the ``pw.in`` file, input for ``pw.x``.
%% Cell type:code id: tags:
``` python
%%bash
cat pw.in
```
%%%% Output: stream
&control
calculation = 'scf'
restart_mode = 'from_scratch'
pseudo_dir = './'
outdir = './'
prefix = 'silane'
wf_collect = .TRUE.
/
&system
ibrav = 1
celldm(1) = 20
nat = 5
ntyp = 2
ecutwfc = 25.0
nbnd = 10
assume_isolated ='mp'
/
&electrons
diago_full_acc = .TRUE.
/
ATOMIC_SPECIES
Si 28.0855 Si_ONCV_PBE-1.2.upf
H 1.00794 H_ONCV_PBE-1.2.upf
ATOMIC_POSITIONS bohr
Si 10.000000 10.000000 10.000000
H 11.614581 11.614581 11.614581
H 8.385418 8.385418 11.614581
H 8.385418 11.614581 8.385418
H 11.614581 8.385418 8.385418
K_POINTS {gamma}
%% Cell type:markdown id: tags:
Run ``pw.in`` on 2 cores.
Run ``pw.x`` on 2 cores.
%% Cell type:code id: tags:
``` python
%%bash
mpirun -n 2 pw.x < pw.in > pw.out
```
%% Cell type:markdown id: tags:
The output file ``pw.out`` contains information about the ground state calculation.
%% Cell type:markdown id: tags:
## Step 2: Screening
%% Cell type:markdown id: tags:
The static dielectric screening is computed using the projective dielectric eigendecomposition (PDEP) technique. Check out the ``wstat.x`` [input description](http://www.west-code.org/doc/West/latest/) and generate an input file for WEST called ``wstat.in``.
%% Cell type:markdown id: tags:
Download this file in your current working directory:
%% Cell type:code id: tags:
``` python
%%bash
wget -N -q http://www.west-code.org/doc/training/silane/wstat.in
```
%% Cell type:markdown id: tags:
Let's inspect the ``wstat.in`` file, input for ``wstat.x``.
%% Cell type:code id: tags:
``` python
%%bash
cat wstat.in
```
%%%% Output: stream
input_west:
qe_prefix: silane
west_prefix: silane
outdir: ./
wstat_control:
wstat_calculation: S
n_pdep_eigen: 50
%% Cell type:markdown id: tags:
Run ``wstat.in`` on 2 cores.
Run ``wstat.x`` on 2 cores.
%% Cell type:code id: tags:
``` python
%%bash
mpirun -n 2 wstat.x -i wstat.in > wstat.out
```
%% Cell type:markdown id: tags:
The output file ``wstat.out`` contains information about the PDEP iterations, and the dielectric eigenvalues can be found in the file ``<west_prefix>.wstat.save/wstat.json``.
Below we show how to load, print, and plot the PDEP eigenvalues.
%% Cell type:code id: tags:
``` python
import json
import numpy as np
# Load the output data
with open('silane.wstat.save/wstat.json') as json_file:
data = json.load(json_file)
# Extract converged PDEP eigenvalues
ev = np.array(data["exec"]["davitr"][-1]["ev"],dtype="f8")
```
%% Cell type:code id: tags:
``` python
# Print
print(ev)
```
%%%% Output: stream
[-1.27478021 -1.19127122 -1.19120182 -1.19117265 -0.82405876 -0.82403634
-0.8239814 -0.63586048 -0.62939276 -0.62938952 -0.5005205 -0.50049623
-0.50047244 -0.42993907 -0.42992203 -0.42991856 -0.23238121 -0.23237804
-0.23237301 -0.18322991 -0.18321449 -0.18320583 -0.1783964 -0.17750084
-0.17749955 -0.1459245 -0.14591779 -0.1459143 -0.12258015 -0.12012226
-0.12011826 -0.12011616 -0.11634693 -0.11634526 -0.11528926 -0.11528499
-0.11528457 -0.09408215 -0.09408058 -0.09408013 -0.07995372 -0.07995119
-0.07995041 -0.07477358 -0.07310084 -0.07309955 -0.0657784 -0.06577326
-0.06576894 -0.06313431]
%% Cell type:code id: tags:
``` python
import matplotlib.pyplot as plt
# Create x-axis
iv = np.linspace(1,ev.size,ev.size,endpoint=True)
# Plot
plt.plot(iv,ev,'o-',label="XXX")
plt.xlabel("i")
plt.ylabel("PDEP eigenvalue")
plt.show()
```
%%%% Output: display_data
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYoAAAEGCAYAAAB7DNKzAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgbklEQVR4nO3de3RddZ338fc3yWl76IXQ0oYmUAoIlVYuHSIX6wUKWmQQKl6e4RkVZ2SqS30WOGO11VnqjDOC9Bkfx2dcs1Yfcax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jJQoREQkIw2PFRGRjFSjEBGRjJQoREQkIyUKERHJSIlCREQyUqIQEZGMlChERCQjJQoREcno/wOZ4imkU5kxXAAAAABJRU5ErkJggg==)
%% Cell type:markdown id: tags:
## Step 3: Quasiparticle corrections
%% Cell type:markdown id: tags:
The GW electronic structure is computed treating the frequency integration of the correlation part of the self energy with the Contour Deformation techinique and by computing the dielectric screening at multipole frequencies with Lanczos iterations. Check out the ``wfreq.x`` [input description](http://www.west-code.org/doc/West/latest/) and generate an input file for WEST called ``wfreq.in``.
%% Cell type:markdown id: tags:
Download this file in your current working directory:
%% Cell type:code id: tags:
``` python
%%bash
wget -N -q http://www.west-code.org/doc/training/silane/wfreq.in
```
%% Cell type:markdown id: tags:
Let's inspect the ``wfreq.in`` file, input for ``wfreq.x``.
%% Cell type:code id: tags:
``` python
%%bash
cat wfreq.in
```
%%%% Output: stream
input_west:
qe_prefix: silane
west_prefix: silane
outdir: ./
wstat_control:
wstat_calculation: S
n_pdep_eigen: 50
wfreq_control:
wfreq_calculation: XWGQ
n_pdep_eigen_to_use: 50
qp_bandrange: [1,5]
n_refreq: 300
ecut_refreq: 2.0
%% Cell type:markdown id: tags:
Run ``wfreq.in`` on 2 cores.
Run ``wfreq.x`` on 2 cores.
%% Cell type:code id: tags:
``` python
%%bash
mpirun -n 2 wfreq.x -i wfreq.in > wfreq.out
```
%% Cell type:markdown id: tags:
The output file ``wfreq.out`` contains information about the calculation of the GW self-energy, and the corrected electronic structure can be found in the file ``<west_prefix>.wfreq.save/wfreq.json``.
Below we show how to load, print, and plot the quasiparticle corrections.
%% Cell type:code id: tags:
``` python
import json
import numpy as np
# Load the output data
with open('silane.wfreq.save/wfreq.json') as json_file:
data = json.load(json_file)
# Extract converged quasiparticle (QP) corrections
k=1
kindex = f"K{k:06d}"
bandmap = data["output"]["Q"]["bandmap"]
eqp = data["output"]["Q"][kindex]
```
%% Cell type:code id: tags:
``` python
# Print QP corrections
print (f"{'k':^10} | {'band':^10} | {'eks [eV]':^15} | {'eqpLin [eV]':^15} | {'eqpSec [eV]':^15}")
print(77*"-")
for i, b in enumerate(bandmap) :
print(f"{k:^10} | {b:^10} | {eqp['eks'][i]:^15.3f} | {eqp['eqpLin'][i]:^15.3f} | {eqp['eqpSec'][i]:^15.3f}")
```
%%%% Output: stream
k | band | eks [eV] | eqpLin [eV] | eqpSec [eV]
-----------------------------------------------------------------------------
1 | 4 | -8.230 | -12.150 | -12.044
1 | 5 | -0.466 | 0.666 | 0.665
%% Cell type:markdown id: tags:
Explanation of keys:
- `eks` : Kohn-Sham energy (obtained in Step 1)
- `eqpLin` : Quasiparticle energy ($G_0W_0 @ PBE$), obtained by approximating the self-energy to first order in the frequency
- `eqpSec` : Quasiparticle energy ($G_0W_0 @ PBE$)
%% Cell type:code id: tags:
``` python
```
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment