Local fields: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
 
(35 intermediate revisions by 4 users not shown)
Line 1: Line 1:
In this tutorial you will learn how to calculate the macroscopic dielectric function in 2D hBN.
In this module you will learn how to calculate the macroscopic dielectric function in 2D hBN.
== Background ==
== Background ==
The macroscopic dielectric function is obtained by including the so-called local field effects (LFE) in the calculation of the response function. Within the time-dependent DFT formalism this is achieved by solving the Dyson equation for ''X''. In reciprocal space this is given by:
[[File:Yambo-handbook-v4.1.2-p-4.png|thumb|Cheatsheet on LFE|150px]]
The macroscopic dielectric function is obtained by including the so-called local field effects (LFE) in the calculation of the response function. Within the time-dependent DFT formalism this is achieved by solving the Dyson equation for the susceptibility ''X''. In reciprocal space this is given by:
[[File:Yambo-CH7.png|none|x50px|Yambo tutorial image]]
[[File:Yambo-CH7.png|none|x50px|Yambo tutorial image]]
The microscopic dielectric function is related to ''X'' by:
The microscopic dielectric function is related to ''X'' by:
Line 10: Line 11:
[[File:Yambo-CH8.png|none|x60px|Yambo tutorial image]]
[[File:Yambo-CH8.png|none|x60px|Yambo tutorial image]]


In the following we will neglect the ''f <sup> xc</sup>'' term: we perform the calculation at the RPA level and consider just the Hartree term in the TDDFT kernel.
In the following we will neglect the ''f <sup> xc</sup>'' term: we perform the calculation at the RPA level and consider just the Hartree term (from ''v<sub>G</sub>'') in the kernel. If we also neglect the Hartree term, we arrive back at the independent particle approximation, since there is no kernel and ''X = X<sub>0</sub>''.


== Prerequisites ==
== Prerequisites ==


* You must first complete the "How to use Yambo" tutorial
* You must first complete the [[Tutorials#How to use Yambo|How to use Yambo]] modules


'''You will need''':
'''You will need''':
Line 22: Line 23:


== Choosing input parameters ==
== Choosing input parameters ==
Enter the folder for 2D hBN that contains the SAVE directory, and generate the input file. From <code>yambo -H</code> you should understand that the correct option is <code>yambo -o c -k hartree</code>. Let's start by running the calculation for light polarization ''q'' in the plane of the BN sheet:
Enter the folder for 2D hBN that contains the SAVE directory, and generate the input file. From <code>yambo -h</code> you should understand that the correct option is <code>yambo -optics c -kernel hartree</code> (or <code>yambo -o c -k hartree</code>). Let's start by running the calculation for light polarization ''q'' in the plane of the BN sheet:
  $ cd YAMBO_TUTORIALS/hBN-2D/YAMBO
  $ cd YAMBO_TUTORIALS/hBN-2D/YAMBO
$ yambo        ''(Initialization)''
  $ yambo -F yambo.in_RPA -V RL -J q100 -o c -k hartree
  $ yambo -F yambo.in_RPA -V RL -J q100 -o c -k hartree
and make sure to set/modify all of the following variables to:
We thus use a new input file ''yambo.in_RPA'', switch on the <code>FFTGvecs</code> variable, and label all outputs/databases with a ''q100'' tag. Make sure to set/modify all of the following variables to:
  FFTGvecs=    '''6        Ry'''    # [FFT] Plane-waves
  [[Variables#FFTGvecs|FFTGvecs]]=    '''6        Ry'''    # [FFT] Plane-waves
  Chimod= "Hartree"            # [X] IP/Hartree/ALDA/LRC/BSfxc
  [[Variables#Chimod|Chimod]]= "Hartree"            # [X] IP/Hartree/ALDA/LRC/BSfxc
  NGsBlkXd= '''    3        Ry'''    # [Xd] Response block size
  [[Variables#NGsBlkXd|NGsBlkXd]]= '''    3        Ry'''    # [Xd] Response block size
  % QpntsRXd
  % [[Variables#QpntsRXd|QpntsRXd]]
   1 |  1 |                  # [Xd] Transferred momenta
   1 |  1 |                  # [Xd] Transferred momenta
  %
  %
  % EnRngeXd
  % [[Variables#EnRngeXd|EnRngeXd]]
   0.00000 | 20.00000 | eV    # [Xd] Energy range
   0.00000 | 20.00000 | eV    # [Xd] Energy range
  %
  %
  % DmRngeXd
  % BndsRnXd
  1 |  20 |                        # [Xd] Polarization function bands
%
% [[Variables#DmRngeXd|DmRngeXd]]
  0.200000 | 0.200000 | eV    # [Xd] Damping range
  0.200000 | 0.200000 | eV    # [Xd] Damping range
  %
  %
  ETStpsXd= 2001              # [Xd] Total Energy steps
  [[Variables#ETStpsXd|ETStpsXd]]= 2001              # [Xd] Total Energy steps
  % LongDrXd
  % [[Variables#LongDrXd|LongDrXd]]
  1.000000 | 0.000000 | 0.000000 |        # [Xd] [cc] Electric Field
  1.000000 | 0.000000 | 0.000000 |        # [Xd] [cc] Electric Field
  %
  %
In this input file, we have:
In this input file, we have:
* A ''q'' parallel to the sheet  
* We evaluate the q-->0 response function choosing the direction for the limit parallel in the plane of the hBN sheet  
* A wider energy range than before, and more broadening
* A wider energy range than before, and more broadening
* Selected the Hartree kernel, and expanding G-vectors up to 3 Ry (about 85 G-vectors)
* Selected the Hartree kernel, and expanded G-vectors in the screening up to 3 Ry (about 85 G-vectors)


==LFEs in periodic direction==
==LFEs in periodic direction==
Now let's run the code with this new input file:
Now let's run the code with this new input file (CECAM in serial: about 2mins; parallel 4 tasks: 50s)
  $ yambo -F yambo.in_RPA -V RL -J q100  
  $ yambo -F yambo.in_RPA -J q100  
and let's compare the absorption with and without the local fields included. By inspecting the ''o-q100.eps_q1_inv_rpa_dyson'' file we find
and let's compare the absorption with and without the local fields included. By inspecting the ''o-q100.eps_q1_inv_rpa_dyson'' file we find
that this information is given in the 2nd and 4th columns, respectively:
that this information is given in the 2nd and 4th columns, respectively:
$ head -n30 o-q100.eps_q1_inv_rpa_dyson
# Absorption @ Q(1) [q->0 direction] : 1.0000000  0.0000000  0.0000000
  #  E/ev[1]    EPS-Im[2]  EPS-Re[3]  EPSo-Im[4]  EPSo-Re[5]
  #  E/ev[1]    EPS-Im[2]  EPS-Re[3]  EPSo-Im[4]  EPSo-Re[5]
Plot the result:
Plot the result:
  $ gnuplot
  $ gnuplot
  gnuplot > plot "o-q100.eps_q1_inv_rpa_dyson" u 1:2 w l,"o-q100.eps_q1_inv_rpa_dyson" u 1:4 w l
  gnuplot> plot "o-q100.eps_q1_inv_rpa_dyson" u 1:2 w l t "RPA-LFA","o-q100.eps_q1_inv_rpa_dyson" u 1:4 w l t "noLFE", "o-q100.eel_q1_inv_rpa_dyson" u 1:4 w l ls 7 dt 2 t "EELS"
[[File:CH-LFE4.png|none|600px|Yambo tutorial image]]
[[File:CH-LFE4.png|none|600px|Yambo tutorial image]]
It is clear that there is little influence of local fields in this case. We have also shown the EELS spectrum (''o-q100.eel_q1_inv_rpa_dyson'') for comparison.
It is clear that there is little influence of local fields in this case. This is generally the case for semiconductors or materials with a smoothly varying electronic density. We have also shown the EELS spectrum (''o-q100.eel_q1_inv_rpa_dyson'') for comparison.


==LFEs in non-periodic direction==
==LFEs in non-periodic direction==
Now let's switch to ''q'' perpendicular to the BN plane:
Now let's switch to ''q'' perpendicular to the BN plane:
  $ yambo -F yambo.in_RPA -V RL -J '''q001''' -o c -k hartree        ''and set''
  $ yambo -F yambo.in_RPA -V RL -o c -k hartree        ''and set''
  ...
  ...
  % LongDrXd
  % [[Variables#LongDrXd|LongDrXd]]
  0.000000 | 0.000000 | '''1.000000''' |        # [Xd] [cc] Electric Field
  0.000000 | 0.000000 | '''1.000000''' |        # [Xd] [cc] Electric Field
  %
  %
  ...
   
  $ yambo -F yambo.in_RPA -V RL -J '''q001'''
You can try out the default parallel usage now, or run again in serial, i.e.
  $ yambo -F yambo.in_RPA -V RL -J '''q001'''       ''(serial)''
$ mpirun -np 4 yambo -F yambo.in_RPA -J '''q001''' &      ''(parallel, MPI only, 4 tasks)''
As noted previously, the ''log'' files in parallel appear in the LOG folder, you can follow the execution with <code>tail -F LOG/l-q001_optics_chi_CPU_1</code> .
 
Plotting the output file:
Plotting the output file:
  $ gnuplot
  $ gnuplot
  gnuplot> plot "o-q001.eps_q1_inv_rpa_dyson" u 1:2 w l,"o-q001.eps_q1_inv_rpa_dyson" u 1:4 w l
  gnuplot> plot "o-q001.eps_q1_inv_rpa_dyson" u 1:2 w l,"o-q001.eps_q1_inv_rpa_dyson" u 1:4 w l
[[File:CH-LFE6.png|none|600px|Yambo tutorial image]]
[[File:CH-LFE6.png|none|600px|Yambo tutorial image]]
In this case, the absorption is strongly blueshifted. Furthermore, the influence of local fields is striking, and quenches the spectrum strongly.
In this case, the absorption is strongly blueshifted with respect to the in-plane absorption. Furthermore, the influence of local fields is striking, and quenches the spectrum strongly. This is the well known depolarization effect. Local field effects are much stronger in the perpendicular direction because the charge inhomogeneity is dramatic. Many G-vectors are needed to account for the sharp change in the potential across the BN-vacuum interface.


==Absorption versus EELS==
==Absorption versus EELS==
In order to understand this, we plot the electron energy loss spectrum for this component and compare with the absorption:
In order to understand this further, we plot the electron energy loss spectrum for this component and compare with the absorption:
  $ gnuplot
  $ gnuplot
  gnuplot > plot "o-q001.eps_q1_inv_rpa_dyson" w l,"o-q001.eel_q1_inv_rpa_dyson" w l
  gnuplot > plot "o-q001.eps_q1_inv_rpa_dyson" w l,"o-q001.eel_q1_inv_rpa_dyson" w l
[[File:CH-LFE5.png|none|600px|Yambo tutorial image]]
[[File:CH-LFE5.png|none|600px|Yambo tutorial image]]
The conclusion is that the dielectric function and EELS coincide for isolated systems, while this is not the case for periodic systems.
The conclusion is that the absorption and EELS coincide for isolated systems.
<!--You should verify that this is not the case for the periodic (in-plane) direction. This is not true, for large cell it also end up to give the same Abs/EELS-->
To understand why this is, you need to consider the role of the ''macroscopic'' screening in the response function and the long-range part of the Coulomb potential.
See e.g.<ref>TDDFT from molecules to solids: The role of long‐range interactions, F. Sottile et al, International journal of quantum chemistry 102 (5), 684-701 (2005)</ref>


===Summary===
==Summary==
From this tutorial you've learned:
From this tutorial you've learned:
* How to compute the macroscopic dielectric function by solving the Dyson equation for ''X'' in G-space
* How to compute the macroscopic dielectric function by solving the Dyson equation for ''X'' in G-space
* The connection between absorption and EELS in low-dimensional systems
* The connection between absorption and EELS in low-dimensional systems


== Links ==
<br>
* [[Tutorials|Back to tutorials menu]]
{| style="width:100%" border="1"
|style="width:15%; text-align:left"|Prev: Back to [[First_steps:_a_walk_through_from_DFT_to_optical_properties|First steps]]
|style="width:70%; text-align:center"|Now: [[Tutorials|Tutorials Home]] --> [[First_steps:_a_walk_through_from_DFT_to_optical_properties|First steps]] --> [[2D_material:_h-BN_sheet|2D hBN]] --> [[Local_fields|RPA with Local Fields]]
|style="width:15%; text-align:right"|Next: Back to [[First_steps:_a_walk_through_from_DFT_to_optical_properties|First steps]]
|-
|}

Latest revision as of 08:22, 16 October 2024

In this module you will learn how to calculate the macroscopic dielectric function in 2D hBN.

Background

Cheatsheet on LFE

The macroscopic dielectric function is obtained by including the so-called local field effects (LFE) in the calculation of the response function. Within the time-dependent DFT formalism this is achieved by solving the Dyson equation for the susceptibility X. In reciprocal space this is given by:

Yambo tutorial image

The microscopic dielectric function is related to X by:

Yambo tutorial image

and the macroscopic dielectric function is obtained by taking the (0,0) component of the inverse microscopic one:

Yambo tutorial image

Experimental observables like the optical absorption and the electron energy loss can be obtained from the macroscopic dielectric function:

Yambo tutorial image

In the following we will neglect the f xc term: we perform the calculation at the RPA level and consider just the Hartree term (from vG) in the kernel. If we also neglect the Hartree term, we arrive back at the independent particle approximation, since there is no kernel and X = X0.

Prerequisites

You will need:

  • The SAVE databases for 2D hBN
  • The yambo executable
  • gnuplot for plotting spectra

Choosing input parameters

Enter the folder for 2D hBN that contains the SAVE directory, and generate the input file. From yambo -h you should understand that the correct option is yambo -optics c -kernel hartree (or yambo -o c -k hartree). Let's start by running the calculation for light polarization q in the plane of the BN sheet:

$ cd YAMBO_TUTORIALS/hBN-2D/YAMBO
$ yambo        (Initialization)
$ yambo -F yambo.in_RPA -V RL -J q100 -o c -k hartree

We thus use a new input file yambo.in_RPA, switch on the FFTGvecs variable, and label all outputs/databases with a q100 tag. Make sure to set/modify all of the following variables to:

FFTGvecs=     6        Ry    # [FFT] Plane-waves
Chimod= "Hartree"            # [X] IP/Hartree/ALDA/LRC/BSfxc
NGsBlkXd=     3        Ry    # [Xd] Response block size
% QpntsRXd
 1 |  1 |                   # [Xd] Transferred momenta
%
% EnRngeXd
 0.00000 | 20.00000 | eV    # [Xd] Energy range
%
% BndsRnXd
  1 |  20 |                         # [Xd] Polarization function bands
%
% DmRngeXd
0.200000 | 0.200000 | eV    # [Xd] Damping range
%
ETStpsXd= 2001               # [Xd] Total Energy steps
% LongDrXd
1.000000 | 0.000000 | 0.000000 |        # [Xd] [cc] Electric Field
%

In this input file, we have:

  • We evaluate the q-->0 response function choosing the direction for the limit parallel in the plane of the hBN sheet
  • A wider energy range than before, and more broadening
  • Selected the Hartree kernel, and expanded G-vectors in the screening up to 3 Ry (about 85 G-vectors)

LFEs in periodic direction

Now let's run the code with this new input file (CECAM in serial: about 2mins; parallel 4 tasks: 50s)

$ yambo -F yambo.in_RPA -J q100 

and let's compare the absorption with and without the local fields included. By inspecting the o-q100.eps_q1_inv_rpa_dyson file we find that this information is given in the 2nd and 4th columns, respectively:

$ head -n30 o-q100.eps_q1_inv_rpa_dyson
# Absorption @ Q(1) [q->0 direction] : 1.0000000  0.0000000  0.0000000
#  E/ev[1]     EPS-Im[2]   EPS-Re[3]   EPSo-Im[4]  EPSo-Re[5]

Plot the result:

$ gnuplot
gnuplot> plot "o-q100.eps_q1_inv_rpa_dyson" u 1:2 w l t "RPA-LFA","o-q100.eps_q1_inv_rpa_dyson" u 1:4 w l t "noLFE", "o-q100.eel_q1_inv_rpa_dyson" u 1:4 w l ls 7 dt 2 t "EELS"
Yambo tutorial image

It is clear that there is little influence of local fields in this case. This is generally the case for semiconductors or materials with a smoothly varying electronic density. We have also shown the EELS spectrum (o-q100.eel_q1_inv_rpa_dyson) for comparison.

LFEs in non-periodic direction

Now let's switch to q perpendicular to the BN plane:

$ yambo -F yambo.in_RPA -V RL -o c -k hartree        and set
...
% LongDrXd
0.000000 | 0.000000 | 1.000000 |        # [Xd] [cc] Electric Field
%

You can try out the default parallel usage now, or run again in serial, i.e.

$ yambo -F yambo.in_RPA -V RL -J q001       (serial)
$ mpirun -np 4 yambo -F yambo.in_RPA -J q001 &      (parallel, MPI only, 4 tasks)

As noted previously, the log files in parallel appear in the LOG folder, you can follow the execution with tail -F LOG/l-q001_optics_chi_CPU_1 .

Plotting the output file:

$ gnuplot
gnuplot> plot "o-q001.eps_q1_inv_rpa_dyson" u 1:2 w l,"o-q001.eps_q1_inv_rpa_dyson" u 1:4 w l
Yambo tutorial image

In this case, the absorption is strongly blueshifted with respect to the in-plane absorption. Furthermore, the influence of local fields is striking, and quenches the spectrum strongly. This is the well known depolarization effect. Local field effects are much stronger in the perpendicular direction because the charge inhomogeneity is dramatic. Many G-vectors are needed to account for the sharp change in the potential across the BN-vacuum interface.

Absorption versus EELS

In order to understand this further, we plot the electron energy loss spectrum for this component and compare with the absorption:

$ gnuplot
gnuplot > plot "o-q001.eps_q1_inv_rpa_dyson" w l,"o-q001.eel_q1_inv_rpa_dyson" w l
Yambo tutorial image

The conclusion is that the absorption and EELS coincide for isolated systems. To understand why this is, you need to consider the role of the macroscopic screening in the response function and the long-range part of the Coulomb potential. See e.g.[1]

Summary

From this tutorial you've learned:

  • How to compute the macroscopic dielectric function by solving the Dyson equation for X in G-space
  • The connection between absorption and EELS in low-dimensional systems


Prev: Back to First steps Now: Tutorials Home --> First steps --> 2D hBN --> RPA with Local Fields Next: Back to First steps
  1. TDDFT from molecules to solids: The role of long‐range interactions, F. Sottile et al, International journal of quantum chemistry 102 (5), 684-701 (2005)