Bethe-Salpeter: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
No edit summary
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
===UNDER CONSTRUCTION (MP)===
UNDER CONSTRUCTION (MP)


In this tutorial you will learn how to:
In this tutorial you will learn how to:
* generate input files to run a BSE calculation for a two-dimensional material
* generate input files to run a BSE calculation for a two-dimensional material  
* run the code and control inputs and outputs
* run the code and control inputs and outputs
* understand the content of the outputs  
* understand the content of the outputs  


== Prerequisites ==
== Prerequisites ==
[[File:HBN-2D.png|thumb|Atomic structure of two-dimensional hBN]]
[[File:HBN-2D.png|thumb|Atomic structure of two-dimensional hBN]]


'''Material properties''':
'''Material: two-dimensional hexagonal BN''':
*  exagonal lattice
*  exagonal lattice
* 2 atoms per cell, B and N (16 electrons, )
* 2 atoms per cell, B and N (8 electrons)
[[File:HBN-2D.png|thumb|Atomic structure of two-dimensional hBN]]
 
* Lattice constants: ''a'' = 4.716 [a.u.]
* Lattice constants: ''a'' = 4.716 [a.u.]
* Plane wave cutoff 40 Ry  
* Plane wave cutoff 40 Ry  


'''You will need''':
To do the Tutorial you have two options:
* PWSCF input files and pseudopotentials for hBN-2D (Download here)
 
    Option A): Start from the beginning (from the DFT runs)
    Option B): Read directly a prepared SAVE database to do only the BScalculation
 
'''TIP''': If you choose Option B) look below for ''Option B): Read directly a prepared SAVE database'' and start from there.
Please note that in this case you do not need to run the initialization, cutoff generation, calculation of screening W
and quasi-particle energies.
All the pre-required databases ndb.gops ndb,kindx ndb.RIM ndb.cutoff ndb.pp ndb.QP have been already generated for you
and are in the SAVE directory
 
== Option A: Start from the beginning (DFT runs also) ==
 
In this case you will need:
 
* PWSCF input files and pseudopotentials for hBN-2D
* <code>pw.x</code> executable, version 5.0 or later
* <code>pw.x</code> executable, version 5.0 or later
* <code>p2y</code> executable
* <code>p2y</code> and <code>yambo</code> executables
   
   
Unpack the TARFILE:
Unpack the TARFILE:
  $ tar -xcvf hBN-2D.tar
  $ tar -xcvf hBN-2D.tar
Go in the PWSCF directory and list the files.
  $ cd hBN-2D/PWSCF
  $ cd hBN-2D/PWSCF
  $ ls
  $ ls
  hbn-2D_bands.in hbn-2D_nscf.in hbn-2D_scf.in hbn-2D_scf_b.in REFERENCES
  Inputs  Pseudos  tmp


== Prerequisites ==
Have a look at the main variables in the two inputs ./Inputs/hbn-2D_scf.in and  ./Inputs/hbn-2D_nscf.in
* Complete the [[Generating the Yambo databases|Generating the Yambo databases]] tutorial for 2D-hBN
(Such as cutoff, vacuum size of the supercell, k-points, bands etc.)
* <code>SAVE</code> folder for hBN-2D.  
 
* <code>yambo</code> executable
Run the DFT self-consistent (scf) input and then the non-self-consistent (nscf) input.
$ pw.x < ./Inputs/hbn_2d_scf.in > hbn_2d_scf.out
$ pw.x < ./Inputs/hbn_2d_scf.in > hbn_2d_nscf.out
 
Generate the SAVE database
$ cd ./tmp/hbn_2d.save
$ p2y


== Initialization ==
Move the SAVE database in the YAMBO directory to start the calculations with yambo


Every Yambo run must start with this step. Go to the folder ''containing'' the hBN-2D <code>SAVE</code> directory:
$ mv  SAVE ../../../YAMBO
  $ cd TUTORIALS/hBN-2D/YAMBO
  $ cd ../../../YAMBO
  $ ls
  $ ls
  SAVE
  SAVE
and simply launch the code
yambo
This will run the initialization (setup) ''runlevel''. <br>
'''TIP''': do not run yambo from ''inside'' the <code>SAVE</code> folder! It will complain that "databases not found".


===Initialization===
As you should know any Yambo run must start with the Initialization step. Simply launch the code
  $ yambo


'''TIP''': Remeber to not run yambo from ''inside'' the <code>SAVE</code> folder! It will complain that "databases not found".


Open the report file r_setup and look at the variable A3. This is the vertical size in bohr of the supercell for the 2D-hBN.
It should be A3 = 33.01200
Remember this value. You will need  it to properly setup the cutoff in the Coulomb Potential.


[[File:Example.jpg]]
===Generation of a truncated Coulomb Potential for a 2D material===


BSE Tutorials at present:
To simulate a real isolated 2D-layer convergence with vacuum size should be required.
The use of a truncated Coulomb potential allows to achieve faster convergence in the vacuum size, eliminating the interaction between the repeated
images. (see ref. Varsano)


*SiH_4
Create the input file:


*Fantastic dimension
$ yambo -F 01_wcut.in  -r
Open the input file 01_cutoff.in


*LiF
Change the variables inside as:


*you Hydrogen
RandQpts= 1000000          # [RIM] Number of random q-points in the BZ
RandGvec= 100        RL    # [RIM] Coulomb interaction RS components
CUTGeo= "box z"            # [CUT] Coulomb Cutoff geometry: box/cylinder/sphere X/Y/Z/XY..
% CUTBox
  0.00    | 0.00    | 32.00    |        # [CUT] [au] Box sides
%


*GaSb (SOC)
Close the input file and run yambo
$ yambo -F 01_wcut.in


* hexagonal BN (on slides only)
===Calculation of the static screening W needed in the BS sex Kernel===
==== The material ====
The h-BN is a layered material similar to graphite.
It is an indirect wide band-gap material. Its optical spectrum is characterized by large excitonic effects.
5.95 eV is the minimum electronic indirect gap. 6.47 eV is the minimum direct gap. 
See the literature [http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.96.026402]
{|
|width="50%"|
'''Bulk hexagonal BN'''
* [https://en.wikipedia.org/wiki/Boron_nitride#Hexagonal_form_.28h-BN.29] hexagonal lattice
* Two atoms per cell (16 electrons)
* Lattice parameters  a = 4.72 [a.u.]  c/a= 2.58 
* Plane waves cutoff 40 Rydberg
|width="50%"| [[File:|Band Structure]]
|}


==== Calculate the screening ====
Open the input file 02_Ws_wcut.in
$ yambo -F 02_Ws_wcut.in -b -r


A key ingredient to construct the BS kernel in the Screeened EXchange approximation (sex)
Change the G-space size of dielectric screening matrix to a value different from 1 RL i.e.
is the screened electron-electron dielectric matrix W which is normally evaluated in the static approximation.  
NGsBlkXs= 2          Ry    # [Xs] Response block size


You have two main options to generate the input :
To speed up  the calculation decrease the Polarization function bands
% BndsRnXs
  1 |  40 |                # [Xs] Polarization function bands
%


  1) yambo -b -F yambo_Ws.in  
Close the file and run yambo
$ yambo -F 02_Ws_wcut.in


This will create the input to calculate W (database ndb.em1s)  
===Calculation of QP transition energies (within GoWo Perturbative approach plus PPA)===


  2) yambo -p p -F yambo_Wp.in  
===Calculation of the BS kernel in the Screened EXchange approximation (sex)===
Create the input
$ yambo -F 03_bse_wcut.in -o b -k sex -r -V QP


This will create the input to calculate (or read) W in the PPA approximation (database ndb.pp)
Open the input file C03_bse_wcut.in  and change the following variables
This second option is useful if you want to read the static part of W from a previous database ndb.pp generated in a GW-PPA run
 
Run the code
$ yambo -F 03_bse_wcut.in
 
== Option B): Read directly a prepared SAVE database ==
Note that in this case in the SAVE directory you have already the following databases
ndb.gops ndb.kindx  ndb.RIM ndb.cutoff ndb.pp ndb.QP databases
$ tar -xcvf hBN-2D.tar
$ cd hBN-2D/YAMBO
$ mv ./References/SAVE SAVE
 
==== Read the static part of screening from a previously generated ndb.pp database ====


==== Calculate the BS kernel in the SEX (Screened Exchange approximation) in the transitions space ====
==== Calculate the BS kernel in the SEX (Screened Exchange approximation) in the transitions space ====
Line 100: Line 143:


Generate the input file for solving the BSE using the Haydock solver:  
Generate the input file for solving the BSE using the Haydock solver:  
 
  $ yambo  -o -y h
  yambo  -o-y h


==== Solve the BSE by diagonalizing the excitonic matrix and calculate spectrum  ====
==== Solve the BSE by diagonalizing the excitonic matrix and calculate spectrum  ====


Runlevel to be used yambo -y d  
Runlevel to be used yambo -y d  
 
 


Steps:
Steps:

Latest revision as of 17:19, 4 January 2022

UNDER CONSTRUCTION (MP)

In this tutorial you will learn how to:

  • generate input files to run a BSE calculation for a two-dimensional material
  • run the code and control inputs and outputs
  • understand the content of the outputs

Prerequisites

File:HBN-2D.png
Atomic structure of two-dimensional hBN

Material: two-dimensional hexagonal BN:

  • exagonal lattice
  • 2 atoms per cell, B and N (8 electrons)
File:HBN-2D.png
Atomic structure of two-dimensional hBN
  • Lattice constants: a = 4.716 [a.u.]
  • Plane wave cutoff 40 Ry

To do the Tutorial you have two options:

   Option A): Start from the beginning (from the DFT runs)
   Option B): Read directly a prepared SAVE database to do only the BScalculation

TIP: If you choose Option B) look below for Option B): Read directly a prepared SAVE database and start from there. Please note that in this case you do not need to run the initialization, cutoff generation, calculation of screening W and quasi-particle energies. All the pre-required databases ndb.gops ndb,kindx ndb.RIM ndb.cutoff ndb.pp ndb.QP have been already generated for you and are in the SAVE directory

Option A: Start from the beginning (DFT runs also)

In this case you will need:

  • PWSCF input files and pseudopotentials for hBN-2D
  • pw.x executable, version 5.0 or later
  • p2y and yambo executables

Unpack the TARFILE:

$ tar -xcvf hBN-2D.tar

Go in the PWSCF directory and list the files.

$ cd hBN-2D/PWSCF
$ ls
Inputs  Pseudos  tmp

Have a look at the main variables in the two inputs ./Inputs/hbn-2D_scf.in and ./Inputs/hbn-2D_nscf.in (Such as cutoff, vacuum size of the supercell, k-points, bands etc.)

Run the DFT self-consistent (scf) input and then the non-self-consistent (nscf) input.

$ pw.x < ./Inputs/hbn_2d_scf.in > hbn_2d_scf.out
$ pw.x < ./Inputs/hbn_2d_scf.in > hbn_2d_nscf.out

Generate the SAVE database

$ cd ./tmp/hbn_2d.save
$ p2y 

Move the SAVE database in the YAMBO directory to start the calculations with yambo

$ mv  SAVE ../../../YAMBO
$ cd ../../../YAMBO
$ ls
SAVE

Initialization

As you should know any Yambo run must start with the Initialization step. Simply launch the code

 $ yambo 

TIP: Remeber to not run yambo from inside the SAVE folder! It will complain that "databases not found".

Open the report file r_setup and look at the variable A3. This is the vertical size in bohr of the supercell for the 2D-hBN. It should be A3 = 33.01200 Remember this value. You will need it to properly setup the cutoff in the Coulomb Potential.

Generation of a truncated Coulomb Potential for a 2D material

To simulate a real isolated 2D-layer convergence with vacuum size should be required. The use of a truncated Coulomb potential allows to achieve faster convergence in the vacuum size, eliminating the interaction between the repeated images. (see ref. Varsano)

Create the input file:

$ yambo -F 01_wcut.in  -r

Open the input file 01_cutoff.in

Change the variables inside as:

RandQpts= 1000000          # [RIM] Number of random q-points in the BZ
RandGvec= 100        RL    # [RIM] Coulomb interaction RS components
CUTGeo= "box z"            # [CUT] Coulomb Cutoff geometry: box/cylinder/sphere X/Y/Z/XY..
% CUTBox
 0.00     | 0.00     | 32.00     |        # [CUT] [au] Box sides
%

Close the input file and run yambo

$ yambo -F 01_wcut.in

Calculation of the static screening W needed in the BS sex Kernel

Open the input file 02_Ws_wcut.in

$ yambo -F 02_Ws_wcut.in -b -r

Change the G-space size of dielectric screening matrix to a value different from 1 RL i.e.

NGsBlkXs= 2           Ry    # [Xs] Response block size

To speed up the calculation decrease the Polarization function bands

% BndsRnXs
  1 |  40 |                 # [Xs] Polarization function bands
%

Close the file and run yambo

$ yambo -F 02_Ws_wcut.in

Calculation of QP transition energies (within GoWo Perturbative approach plus PPA)

Calculation of the BS kernel in the Screened EXchange approximation (sex)

Create the input

$ yambo -F 03_bse_wcut.in -o b -k sex -r -V QP 

Open the input file C03_bse_wcut.in and change the following variables

Run the code

$ yambo -F 03_bse_wcut.in

Option B): Read directly a prepared SAVE database

Note that in this case in the SAVE directory you have already the following databases

ndb.gops ndb.kindx  ndb.RIM ndb.cutoff ndb.pp ndb.QP databases 
$ tar -xcvf hBN-2D.tar
$ cd hBN-2D/YAMBO
$ mv ./References/SAVE SAVE

Read the static part of screening from a previously generated ndb.pp database

Calculate the BS kernel in the SEX (Screened Exchange approximation) in the transitions space

Here we learn how to create the BS kernel in the screened exchange (SEX) approximation which includes both exchange (V) and correlation (-W) terms Runlevel to be used yambo -o b -k sex

Solve the BSE by haydock solver and and calculate spectrum

Generate the input file for solving the BSE using the Haydock solver:

$ yambo  -o -y h

Solve the BSE by diagonalizing the excitonic matrix and calculate spectrum

Runlevel to be used yambo -y d

Steps:

-Calculate screening

-Calculate the BS Kernel

-Diagonalize the BS Matrix and calculate spectrum

-Visualize/Analyze excitons (with ypp)

-How to Converge

-How to work with SOC