RPA in Yambo: local field effects¶
In this tutorial you will learn how to calculate the macroscopic dielectric function with Yambo using two-dimensional (2D) hBN as an example.
Requirements
SAVEfolder of 2D hBN: download and extracthBN-2D.tar.gzfrom the Tutorial files pageyamboexecutablegnuplotfor plotting spectra
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 \(\chi\). In reciprocal space this is given by:
The microscopic dielectric function is related to \(\chi\) by
and the macroscopic dielectric function is obtained by taking the \(\mathbf{G}=\mathbf{G^{\prime}}=0\) component of the inverse microscopic one
Experimental observables like the optical absorption and the electron energy loss are obtained from the macroscopic dielectric function:
In the following we will neglect the \(f_{\mathbf{G}_1,\mathbf{G}_2}^{xc}\) term in the kernel: we perform the calculation at the RPA level including just the Hartree term (from \(v_G\)).
If we also neglect the Hartree term we go back to the independent particle approximation since we effectively remove the kernel and set \(\chi = \chi_0\).
Before starting go to the hBN-2D/YAMBO directory and initialize the SAVE folder:
$ cd hBN-2D/YAMBO
$ ls
SAVE
$ yambo
Input file and parameters¶
After the initialization we can generate the input file.
To include the local fields variables use -o c -k hartree.
Check the meaning of the options with the command-line interface
if you are not familiar with them.
Let’s start doing a calculation with the light polarization \(\mathbf{q}\) in the plane of the BN sheet. Generate the input like this
$ yambo -F yambo.in_RPA -V RL -o c -k hartree
(thus naming it yambo.in_RPA) and
then set the following variables to these values:
FFTGvecs= 3951 RL # [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
%
% DmRngeXd
0.20000 | 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 evaluate the \(\mathbf q \to 0\) response function choosing the direction in the limit parallel to the plane of the hBN sheet;
We set the energy range for the spectrum to \(0-20\) eV;
We set the broadening through the variable
DmRngeXd;We select the Hartree kernel;
We included G-vectors in the screening up to 3 Ry (about 85 G-vectors for this system[1]).
Note
While FFTGvecs controls the cutoff for the plane wave expansion of the wavefuntions
(hidden in dipole matrix elements appearing in the expression of \(\chi_0\)),
NGsBlkXd determines the size of the dielectric matrix in G-space (or equivalently
the cutoff on the sum over \(\mathbf{G}_1, \mathbf{G}_2\) in Eq. (1)).
Remember that NGsBlkXd is a typical parameter to be converged while it is better to
not modify FFTGvecs and leave it at its default (maximum) value.
LFE in the periodic direction¶
Atomic structure of 2D hBN (\(z \parallel c\) is the non-periodic direction).¶
Let’s now run the calculation specifying the electric field direction in the job string label:
$ yambo -F yambo.in_RPA -J q100
This calculation should take about 4 minutes in serial.
yambo -F yambo.in_RPA -J q100 (v5.3 log)
___ __ _____ __ __ _____ _____
| Y || _ || Y || _ \ | _ |
| | ||. | ||. ||. | / |. | |
\_ _/ |. _ ||.\_/ ||. _ \ |. | |
|: | |: | ||: | ||: | \|: | |
|::| |:.|:.||:.|:.||::. /|::. |
`--" `-- --"`-- --"`-----" `-----"
<---> [01] MPI/OPENMP structure, Files & I/O Directories
<---> MPI Cores-Threads : 1(CPU)-48(threads)
<---> [02] CORE Variables Setup
<---> [02.01] Unit cells
<---> [02.02] Symmetries
<---> [02.03] Reciprocal space
<---> [WARNING] wf_ng > maxval(wf_igk), probably because FFTGvecs in input. Reducing it
<---> [02.04] K-grid lattice
<---> Grid dimensions : 6 6
<---> [02.05] Energies & Occupations
<---> [03] Transferred momenta grid and indexing
<---> [04] Dipoles
<---> [04.01] Setup: observables and procedures
<---> [DIP] Database not correct or missing. To be computed
<---> [x,Vnl] computed using 2 projectors
<---> R V P [g-space] |########################################| [100%] --(E) --(X)
<---> [WARNING] [r,Vnl^pseudo] included in position and velocity dipoles.
<---> [WARNING] In case H contains other non local terms, these are neglected
<---> [05] Optics
<---> [LA] SERIAL linear algebra
<---> [MEMORY] Alloc X_par%blc( 225.8940 [Mb]) TOTAL: 231.1780 [Mb] (traced) 241.4480 [Mb] (memstat)
<---> [MEMORY] Alloc WF%c( 70.87500 [Mb]) TOTAL: 303.6860 [Mb] (traced) 312.3240 [Mb] (memstat)
<---> [FFT-X] Mesh size: 12 12 75
<---> [X-CG] R(p) Tot o/o(of R): 1464 8064 100
<02m-07s> Xo@q[1] |########################################| [100%] 02m-06s(E) 02m-06s(X)
<04m-33s> X@q[1] |########################################| [100%] 02m-24s(E) 02m-24s(X)1800 [Mb] (memstat)
<04m-33s> [MEMORY] Free M_par%blc( 225.8940 [Mb]) TOTAL: 305.6910 [Mb] (traced) 570.1800 [Mb] (memstat)
<04m-34s> [MEMORY] Free M_par%blc( 225.8940 [Mb]) TOTAL: 79.54800 [Mb] (traced) 344.2840 [Mb] (memstat)
<04m-34s> [MEMORY] Free WF%c( 70.87500 [Mb]) TOTAL: 8.673000 [Mb] (traced) 118.3880 [Mb] (memstat)
<04m-34s> [06] Timing Overview
<04m-34s> [07] Memory Overview
<04m-34s> [08] Game Over & Game summary
Let’s now look at the results. We want to compare the absorption with
and without the local fields: by inspecting the output file o-q100.eps_q1_inv_rpa_dyson
we find that this information is given in the 2\(^{nd}\) and 4\(^{th}\)
columns, respectively:
$ head -n 50 o-q100.eps_q1_inv_rpa_dyson | grep '#' | tail -n 3
#
# E[1] [eV] Im(eps) Re(eps) Im(eps_o) Re(eps_o)
#
Plot the RPA and the IPA response:
$ gnuplot
$ gnuplot> plot "o-q100.eps_q1_inv_rpa_dyson" u 1:2 w l t "RPA-LFE","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"
Absorption and EELS spectra from the macroscopic dielectric function (Eq. (4)) with the electric field in the in-plane direction.¶
There is very little influence of local fields for 2D hBN. This is generally the case for semiconductors or materials with a smoothly varying electronic density.
In the same figure, we have also shown the EELS spectrum (o-q100.eel_q1_inv_rpa_dyson) for comparison.
LFE in the non-periodic direction¶
Now let’s orientate \(\mathbf{q}\) in the direction perpendicular to the BN plane.
Open the input file yambo.in_RPA and change LongDrXd to:
% LongDrXd
0.000000 | 0.000000 | 1.000000 | # [Xd] [cc] Electric Field
%
Run the calculation (don’t forget to change the -J label):
$ yambo -F yambo.in_RPA -J q001 >& /dev/null &
The >& /dev/null & makes Yambo run in the background and print the log into a file.
You can follow the progress of the calculation with
$ tail -f l-q001_optics_dipoles_kernel_chi
When the calculation is done we can plot the new output:
$ 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
Absorption spectra from the macroscopic dielectric function (Eq. (4)) with the electric field in the out-of-plane direction.¶
In the out of plane direction, 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. Also keep in mind that many G-vectors are needed to account for the sharp change in the potential across the BN-vacuum interface.
Absorption vs 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
Absorption and EELS spectra from the macroscopic dielectric function (Eq. (4)) with the electric field in the out-of-plane direction.¶
The conclusion is that the absorption and EELS coincide for isolated systems.
To understand this result, 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. this article[2]