<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yambo-code.eu/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ElenaCannuccia</id>
	<title>The Yambo Project - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yambo-code.eu/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ElenaCannuccia"/>
	<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Special:Contributions/ElenaCannuccia"/>
	<updated>2026-04-11T10:47:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Phonon-assisted_luminescence_by_finite_atomic_displacements&amp;diff=6001</id>
		<title>Phonon-assisted luminescence by finite atomic displacements</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Phonon-assisted_luminescence_by_finite_atomic_displacements&amp;diff=6001"/>
		<updated>2022-09-15T12:39:54Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Representative-instantaneous-atomic-configurations-of-H2O-top-and-H3O-bottom-Also.gif|thumb| 200px|Finite atomic displacements]]&lt;br /&gt;
&lt;br /&gt;
In recent years, several articles have been published with Yambo, who calculated the phonon-assisted luminescence by means of finite atomic displacements&amp;lt;ref name=&#039;cann&#039;&amp;gt;[https://arxiv.org/abs/1807.11797 Theory of phonon-assisted luminescence in solids: Application to hexagonal boron nitride], E. Cannuccia, B. Monserrat and C. Attaccalite, Phys. Rev. B &#039;&#039;&#039;99&#039;&#039;&#039;, 081109(R) (2019)&amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;fprl&#039;&amp;gt;[https://arxiv.org/abs/1810.08976 Exciton-Phonon Coupling in the Ultraviolet Absorption and Emission Spectra of Bulk Hexagonal Boron Nitride], F. Paleari et al. PRL &#039;&#039;&#039;122&#039;&#039;&#039;, 187401(2019) &amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;[https://scipost.org/SciPostPhys.12.5.145 Excitons under strain: light absorption and emission in strained hexagonal boron nitride], P. Lechifflart, F. Paleari and C. Attaccalite, SciPost Phys. &#039;&#039;&#039;12&#039;&#039;&#039;, 145(2022). &amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;mprl&#039;&amp;gt;[https://arxiv.org/abs/2111.03518  Phonon-Assisted Luminescence in Defect Centers from Many-Body Perturbation Theory], F. Libbi, P. M. M. C. de Melo, Z. Zanolli, M. J. Verstraete, and N. Marzari, Phys. Rev. Lett. &#039;&#039;&#039;128&#039;&#039;&#039;, 167401 (2022) &amp;lt;/ref&amp;gt;.&lt;br /&gt;
In this tutorial, we will show how to use [https://github.com/yambo-code/yambopy YamboPy] in combination with Yambo to perform this kind of calculation. For a general review of finite displacement calculations of vibrational properties we recommend this article&amp;lt;ref&amp;gt;Electron-phonon coupling from finite differences, Bartomeu Monserrat, J. Phys.: Condens. Matter &#039;&#039;&#039;30&#039;&#039;&#039; 083001(2018)&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
Notice that the calculation of phonon-assisted luminescence by finite atomic displacements are quite involved and expensive from a computational point of view, for this reason, they are limited to relatively simple systems.&amp;lt;br&amp;gt;&lt;br /&gt;
In this tutorial, we will follow the approach of Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;, and calculate luminescence using the Roosbroeck–Shockley (RS) relation applied to the excitonic case.&amp;lt;br&amp;gt;&lt;br /&gt;
If you use this approach to calculate luminescence or phonon-assisted absorption please cite references &amp;lt;ref name=cann&amp;gt;&amp;lt;/ref&amp;gt; and &amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; This tutorial requires that you are familiar with Bethe-Salpeter calculations with Yambo, and phonons with Quantum-Espresso, and YamboPy. If it is not the case please study the corresponding tutorial before continuing. &lt;br /&gt;
&lt;br /&gt;
== Locate the lowest indirect exciton (or indirect band gap) ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial as example, we will consider the hexagonal-BN, which is an indirect insulator. The first step to calculate the phonon-assisted luminescence is to locate the lowest indirect exciton. The cleanest strategy to identify the lowest excitation would be to calculate the excitons along the whole Irreducible Brillouin zone(IBZ), then interpolate them as explained in [https://www.yambo-code.org/wiki/index.php?title=How_to_analyse_excitons#Interpolate_exciton_dispersion_(only_in_Yambo_5.x) Interpolate exciton dispersion] and find the &#039;&#039;&#039;q&#039;&#039;&#039; point that corresponds to the minimum.&amp;lt;br&amp;gt;&lt;br /&gt;
A simpler approach is to use the GW (or Kohn-Sham) band structure to find the momentum responsible for the indirect band gap, in the major part of cases this corresponds to the lowest exciton.&amp;lt;br&amp;gt;&lt;br /&gt;
In the h-BN case we have:&lt;br /&gt;
[[File:Bn band structure.png|1000px|center| Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
The indirect gap is between a point close to &#039;&#039;&#039;K&#039;&#039;&#039; and the &#039;&#039;&#039;M&#039;&#039;&#039; point, see panel (a) of the figure above. We will approximate the momentum responsible for the indirect emission with &#039;&#039;&#039;q=K-M&#039;&#039;&#039;. Notice that then we should build supercells that contain this moment, so it is good to approximate it with fractions of integers that are not too large so as not to have giant supercells. In this case we get &#039;&#039;&#039;q=(1/3,-1/6, 0)&#039;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
Notice that if you have a direct band gap material, the momentum &#039;&#039;&#039;q&#039;&#039;&#039; corresponding to the lowest transition is &#039;&#039;&#039;q=0&#039;&#039;&#039; and you do not need to construct special supercells to sample the corresponding vibration, it will be sufficient to displace atoms in the primitive cell.&lt;br /&gt;
&lt;br /&gt;
== Calculate phonons at momentum &#039;&#039;&#039;q&#039;&#039;&#039; of the indirect transition ==&lt;br /&gt;
&lt;br /&gt;
Now we need to calculate all atomic vibrations compatible with the momentum of the lowest indirect transition. In order to do so, we first calculate the phonons with QE, here the inputs [https://www.yambo-code.org/educational/tutorials/files/hBN_phonons.tgz hBN_phonons.tgz], then we calculate the force constants with q2r.x and now we can interpolate phonons along all the BZ as shown in panel (b) of Figure 1. Then we use matdyn.x to calculate phonons at momentum &#039;&#039;&#039;q=K-M = (1/3, -1/6, 0)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;input&lt;br /&gt;
    asr=&#039;crystal&#039;,&lt;br /&gt;
    flfrc=&#039;bn.fc&#039;,&lt;br /&gt;
    flfrq=&#039;bn.freq&#039;,&lt;br /&gt;
    deltaE=1.d0,&lt;br /&gt;
    q_in_cryst_coord=.true.&lt;br /&gt;
    fleig=&#039;bn.eig&#039;&lt;br /&gt;
 /&lt;br /&gt;
 2&lt;br /&gt;
 0 0 0&lt;br /&gt;
 0.3333333333333333 -0.16666666666666666666 0.0&lt;br /&gt;
&lt;br /&gt;
The obtained phonon modes correspond to phonons at the vertical red line in panel(b) of Fig. 1. They are written in the &#039;&#039;matdyn.modes&#039;&#039; file with the corresponding eigenvectors and will be later used to displace atoms along the phonon modes.&lt;br /&gt;
If you open the &#039;matdyn.modes&#039; file you will find phonon modes for the &#039;&#039;&#039;q=0&#039;&#039;&#039; and &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039;  that in cartesian coordinates is (1/3,0,0). We copy the modes corresponding to the second &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039; in a separate file, called &#039;&#039;Q2.modes&#039;&#039; that will look like:&lt;br /&gt;
&lt;br /&gt;
      diagonalizing the dynamical matrix ...&lt;br /&gt;
 &lt;br /&gt;
 q =       0.3333      0.0000      0.0000&lt;br /&gt;
 **************************************************************************&lt;br /&gt;
     freq (    1) =       5.194139 [THz] =     173.257815 [cm-1]&lt;br /&gt;
 (  0.000000  -0.000000    -0.000000  -0.000000    -0.274372  -0.475224   )&lt;br /&gt;
 ( -0.000000   0.000000    -0.000000  -0.000000    -0.445962   0.000001   )&lt;br /&gt;
 ( -0.000000  -0.000000    -0.000000  -0.000000    -0.222981  -0.386214   )&lt;br /&gt;
 (  0.000000   0.000000    -0.000000   0.000000    -0.548742   0.000000   )&lt;br /&gt;
 ...........................&lt;br /&gt;
&lt;br /&gt;
== Generate the supercell==&lt;br /&gt;
&lt;br /&gt;
Now we use YamboPy to generate the supercell corresponding to the momentum &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039;.  A tutorial is already present in the file &#039;&#039;tutorial/supercell/generate_supercells.py&#039;&#039;.&lt;br /&gt;
You can edit the file to specify the momentum &#039;&#039;&#039;q&#039;&#039;&#039;, the name of the SCF initial file (uc_filnm), and the name of the phonon mode file (mode_file).&lt;br /&gt;
&lt;br /&gt;
    .....&lt;br /&gt;
    uc_filnm = &#039;hBN.scf.in&#039; #pw input&lt;br /&gt;
    Q = [[1,-1,0],[3,6,0]] #qpoint to fold in nondiagonal supercell: Q=(1/3,-1/6,0)&lt;br /&gt;
    kpoints = [12,12,4]    #NB: these fractional crystal coordinates must exactly divide the kpoint mesh!&lt;br /&gt;
    modes_file = &#039;Q2.modes&#039; #file with phonon eigenmodes&lt;br /&gt;
    .....&lt;br /&gt;
&lt;br /&gt;
run the script to generate the supercell without displacing atoms &#039;&#039;python generate_supercells.py -N&#039;&#039;. The script will generate a non-diagonal supercell&amp;lt;ref&amp;gt;[https://arxiv.org/abs/1510.04418 Lattice dynamics and electron-phonon coupling calculations using nondiagonal supercells], J. H. Lloyd-Williams and B. Monserrat, Phys. Rev. B &#039;&#039;&#039;92&#039;&#039;&#039;, 184301(2015) &amp;lt;/ref&amp;gt; in the file &amp;quot;sc_nondiagonal.bn.scf&#039; that is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Supercell.png|500px|center| Supercell for the momentum q=(1/3, -1/6, 0) and the corresponding reciprocal space]]&lt;br /&gt;
&lt;br /&gt;
The YamboPy script automatically reduces the number of k-point in such a way to have the same sampling of the corresponding primitive cell, however we advise you to check if the new k-point grid is what you expect, and modify it in case of the incorrect grid.&amp;lt;br&amp;gt;&lt;br /&gt;
In the same way, you can generate the input file for non-self-consistent calculation in the supercell.&lt;br /&gt;
&lt;br /&gt;
==Calculate the optical spectra in the supercell==&lt;br /&gt;
&lt;br /&gt;
Now you have to calculate the optical spectra and exciton in the new supercell. Do not forget to increase the number of conduction bands in both the screening and the Bethe-Salpeter equation. For example in the supercell shown above, there are 24 atoms, 6 times more than in the original cell, so you will have to multiply the number of bands by 6, if in the base cell you have used 40 bands here you will have to put 240 to have the same convergence parameters. Then print exciton according to their energy with the command ypp -e s.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;N. B. &#039;&#039;&#039;: in order to not recalculate W for each atomic displacement you can perform calculations without symmetries in the pristine supercell and then copy the corresponding dielectric constant in the calculations with displaced atoms, this is usually a safe approximation described in Ref.&amp;lt;ref name=&amp;quot;cann&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After solving the BSE in the supercell you will find the excitons that were already present in the primary cell (within the numerical noise) and new lower energy excitons, with zero dipole matrix elements, that correspond to the indirect excitons that have now been  mapped at &#039;&#039;&#039;q=0&#039;&#039;&#039;, something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #    Maximum Residual Value =  0.38659E+01&lt;br /&gt;
 #   &lt;br /&gt;
 #    E [ev]             Strength           Index&lt;br /&gt;
 #&lt;br /&gt;
     5.7165937         0.47290171E-11      1.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7166047         0.58239158E-09      2.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7367945         0.31830746E-09      3.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7368207         0.33674005E-10      4.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.80542803        0.100763231E-6      5.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.80598068        0.384604526E-8      6.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.88944197         1.00000000         7.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.88967037        0.102969212E-1      8.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     ................&lt;br /&gt;
&lt;br /&gt;
This result shows that indirect exciton without the coupling with phonon does not contribute to the optical response.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Displace atoms and calculate dipoles derivatives==&lt;br /&gt;
Now you can generate the displaced supercell for all the phonon modes compatible with the indirect band gap &#039;&#039;&#039;q&#039;&#039;&#039; point by doing:  &#039;&#039;python generate_supercells.py -S&#039;&#039;. The script will produce a set of input files for each of the 12 phonon modes at &#039;&#039;&#039;q=(1/3,-1/6,0)&#039;&#039;&#039;. You have to perform BSE calculation for each one of these modes and get exciton dipoles.&amp;lt;br&amp;gt;&lt;br /&gt;
For each phonon mode the atoms are displaced along the corresponding eigenvector read from the &amp;quot;Q2.modes&amp;quot; file multiplied for 0.1 Bohr (the variable Temp=0.1), see the following line in &amp;quot;generate_supercell.py&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  ...  &lt;br /&gt;
  sc.displace(eivs,nd_atom_positions,Temp=0.1) # Generate list of displaced supercells as PwIn objects called &#039;modes_qe&#039;&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
this is usually a good value to get correct derivatives. In principle, it is possible to test different displacement lengths to get good second derivatives. The general rule is that the displacement should not be too small to avoid numerical noise and not too large to avoid contribution from third or forth order derivatives.&amp;lt;br&amp;gt;&lt;br /&gt;
Once you get dipoles for a given phonon mode you can calculate the second order dipole derivatives using a finite difference formula and the fact the first order derivatives are zero by construction as:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;  \frac{\partial^2 | T^S |^2}{\partial R_{\lambda,q}^2 } = 2 \frac{| T^S (R=\Delta R) |^2 - | T (R=0) |^2}{\Delta R^2} = 2 \frac{| T^S (R=\Delta R) |^2}{\Delta R^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In the Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt; we found that a single point formula above is enough to get good second derivatives, taking into account that the first derivative is zero, however you can test higher-order formulas to be sure that the result is correct, see for example [https://en.wikipedia.org/wiki/Finite_difference#Higher-order_differences higher-order differences]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: in the file produced by &#039;&#039;ypp&#039;&#039; the oscillator strengths are normalized to have the maximum equal to one, before calculating the derivatives remember to remove this normalization by multiplying all Oscillator Strengths for the maximum residual value, in the previous example:&lt;br /&gt;
&lt;br /&gt;
 #    Maximum Residual Value =  0.38659E+01&lt;br /&gt;
&lt;br /&gt;
==Luminescence==&lt;br /&gt;
&lt;br /&gt;
Now you have all the information necessary to construct the emission spectra. &amp;lt;br&amp;gt;Using the formula, derived in Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt; you obtain the phonon-assisted luminescence as: &lt;br /&gt;
[[File:Light emission.png|center|Light emission formula]]&lt;br /&gt;
&lt;br /&gt;
in this formula:&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt; n&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt;(ω)&amp;lt;/span&amp;gt; is the refractive index, that usually can be approximated with a constant in the luminescence energy range.&lt;br /&gt;
* E&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt; are the excitonic energies in the undistorted supercell, including indirect excitons&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt; B(E&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;,T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt;)&amp;lt;/span&amp;gt; is the Bose occupation of excitons, that can be approximated with a Boltzman function, see Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; is the excitonic temperature that should be obtained from experimental measurements or used as a parameters, for a discussion see Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt; d&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;|T&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;|&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;/dR&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;λ&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; are the derivatives of the exciton dipole matrix elements for a given phonon mode&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:violet&amp;quot;&amp;gt;Ω&amp;lt;sub&amp;gt;λ,&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; are the phonon frequencies and the sum on &#039;&#039;&#039;q&#039;&#039;&#039; is on the different supercells obtained from phonon modes responsible for the luminescence, in this tutorial there is just a single &#039;&#039;&#039;q&#039;&#039;&#039; point.&lt;br /&gt;
*  &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt; η &amp;lt;/span&amp;gt;  is the exciton line-width that is given as input parameter to define the broadening of the spectra&lt;br /&gt;
&lt;br /&gt;
In the h-BN example shown here, the T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt; was obtained from experimental measurements, only the lowest two excitons were included in the sum and the Bose function was replaced by a Boltzmann distribution with the energy zero fixed at the lowest excitonic energy. An appropriate scissor operator independent of the atomic displacements was added in the calculation. The final result is shown in the figure above and compared with the experimental measurement at 10 Kelvin&lt;br /&gt;
[[File:Lum spectra.png|center|800px|Luminescence spectra]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Some additional considerations on luminescence calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In general due to the &#039;&#039;&#039;Bose&#039;&#039;&#039; (or &#039;&#039;&#039;Boltzmann&#039;&#039;&#039;) factor only the lower excitons (often only the lowest one) contribute to the luminescence signal&lt;br /&gt;
* The lowest excitons are  &#039;&#039;&#039;degenerate&#039;&#039;&#039; all of them have to be included in the sum, as in the h-BN example&lt;br /&gt;
* In the present formulation of luminescence spectra excitons are treated  as Bosons (or Boltzman particles), in principle it is possible to define a &#039;&#039;&#039;excitonic occupation&#039;&#039;&#039; starting from a quasi-equilibrium distribution of excited electron-hole, but this requires a rotation of the electron-hole occupations in the excitonic base for a discussion see Ref.&amp;lt;ref name=&#039;cann&#039;&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;mprl&#039;&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* In order to &#039;&#039;&#039;speed up calculations&#039;&#039;&#039; you can perform all calculations without symmetries and copy the dielectric constant (&#039;&#039;ndb.em1s*&#039;&#039; or &#039;&#039;ndb.pp*&#039;&#039; files) from the undistorted supercell to the displaced ones. In this case, if you do not need to calculate GW correction, for example using a scissor, you can also reduce the number of bands in the non-self-consistent calculation to the one required by the BSE, for a discussion see Ref&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Notice that the &#039;&#039;&#039;dipole matrix elements&#039;&#039;&#039; that will enter in optical absorption and luminescence depend form the direction of the electric field. In this example shown before the luminescence has been averaged in &#039;&#039;x&#039;&#039; and &#039;&#039;y&#039;&#039; directions because we were interested in the in-place luminescence. In general is it possible to select specific directions to reproduce particular experimental setups&amp;lt;ref name=cann&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some example input files for h-BN==&lt;br /&gt;
&lt;br /&gt;
In this section, I will provide some input files to repeat calculations in h-BN. Luminescence spectra were calculated using a 12x12x4 k-point grid and 200 bands for the dielectric constant in the primitive cell and 3000 mHa block size. In the supercell used to generate the luminescence spectra, there are 24 atoms, this means that the total number of bands has to be increased to 1200 and the corresponding k-point sampling reduced approximately to 12x2x4, this is automatically done by the Yambopy.&lt;br /&gt;
Here are the input files:&lt;br /&gt;
* Primitive cell SCF and NSCF files and inputs for phonon calculations: [https://www.yambo-code.org/educational/tutorials/files/Luminescence/hBN_scf_nscf_phonons.tgz hBN_scf_nscf_phonons.tgz]&lt;br /&gt;
* The Q=(1/3,1/6,0) phonon mode generated by matdyn.x: [https://www.yambo-code.org/educational/tutorials/files/Luminescence/Q_mode.tgz Q_mode.tgz]&lt;br /&gt;
* The non-diagonal supercells for SCF and NSCF calculations (without symmetries) and the Yambo file for the BSE [https://www.yambo-code.org/educational/tutorials/files/Luminescence/BSE_supercell.tgz  BSE_supercell.tgz]&lt;br /&gt;
* The displaced supercells for exciton-phonon calculations [https://www.yambo-code.org/educational/tutorials/files/Luminescence/Displaced_Cells.tgz Displaced_Cells.tgz]&lt;br /&gt;
&lt;br /&gt;
You can the same BSE input file in all the displaced supercells. &amp;lt;br&amp;gt;&lt;br /&gt;
If you did not use symmetries you can avoid recalculating the dielectric constant by copying the SAVE/ndb.em1s* files from the undistributed supercell to the displaced ones.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Phonon-assisted_luminescence_by_finite_atomic_displacements&amp;diff=6000</id>
		<title>Phonon-assisted luminescence by finite atomic displacements</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Phonon-assisted_luminescence_by_finite_atomic_displacements&amp;diff=6000"/>
		<updated>2022-09-15T12:36:37Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* Calculate phonons at momentum q of the indirect transition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Representative-instantaneous-atomic-configurations-of-H2O-top-and-H3O-bottom-Also.gif|thumb| 200px|Finite atomic displacements]]&lt;br /&gt;
&lt;br /&gt;
In recent years, several articles have been published with Yambo, who calculated the phonon-assisted luminescence by means of finite atomic displacements&amp;lt;ref name=&#039;cann&#039;&amp;gt;[https://arxiv.org/abs/1807.11797 Theory of phonon-assisted luminescence in solids: Application to hexagonal boron nitride], E. Cannuccia, B. Monserrat and C. Attaccalite, Phys. Rev. B &#039;&#039;&#039;99&#039;&#039;&#039;, 081109(R) (2019)&amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;fprl&#039;&amp;gt;[https://arxiv.org/abs/1810.08976 Exciton-Phonon Coupling in the Ultraviolet Absorption and Emission Spectra of Bulk Hexagonal Boron Nitride], F. Paleari et al. PRL &#039;&#039;&#039;122&#039;&#039;&#039;, 187401(2019) &amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;[https://scipost.org/SciPostPhys.12.5.145 Excitons under strain: light absorption and emission in strained hexagonal boron nitride], P. Lechifflart, F. Paleari and C. Attaccalite, SciPost Phys. &#039;&#039;&#039;12&#039;&#039;&#039;, 145(2022). &amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;mprl&#039;&amp;gt;[https://arxiv.org/abs/2111.03518  Phonon-Assisted Luminescence in Defect Centers from Many-Body Perturbation Theory], F. Libbi, P. M. M. C. de Melo, Z. Zanolli, M. J. Verstraete, and N. Marzari, Phys. Rev. Lett. &#039;&#039;&#039;128&#039;&#039;&#039;, 167401 (2022) &amp;lt;/ref&amp;gt;.&lt;br /&gt;
In this tutorial we will show how to use [https://github.com/yambo-code/yambopy YamboPy] in combination with Yambo to perform these kind of calculations. For a general review of finite displacements calculations of vibrational properties we recommend this article&amp;lt;ref&amp;gt;Electron-phonon coupling from finite differences, Bartomeu Monserrat, J. Phys.: Condens. Matter &#039;&#039;&#039;30&#039;&#039;&#039; 083001(2018)&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
Notice that calculation of phonon-assisted luminescence by finite atomic displacements are quite involved and expensive from a computational point of view, for this reason they are limited to relatively simple systems.&amp;lt;br&amp;gt;&lt;br /&gt;
In this tutorial we will follow the approach of Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;, and calculate luminescence using the Roosbroeck–Shockley (RS) relation applied to the excitonic case.&amp;lt;br&amp;gt;&lt;br /&gt;
If you use this approach to calculate luminescence or phonon-assisted absorption please cite references &amp;lt;ref name=cann&amp;gt;&amp;lt;/ref&amp;gt; and &amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; This tutorial requires that you are familiar with Bethe-Salpeter calculations with Yambo, and phonons with Quantum-Espresso, and YamboPy. If it is not the case please study the corresponding tutorial before continuing. &lt;br /&gt;
&lt;br /&gt;
== Locate the lowest indirect exciton (or indirect band gap) ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial as example we will consider the hexagonal-BN, that is an indirect insulator. The first step to calculate the phonon-assisted luminescence is to locate the lowest indirect exciton. The cleanest strategy to identify the lowest excitation would be to calculate the excitons along the whole Irreducible Brillouin zone(IBZ), then interpolate them as explained in [https://www.yambo-code.org/wiki/index.php?title=How_to_analyse_excitons#Interpolate_exciton_dispersion_(only_in_Yambo_5.x) Interpolate exciton dispersion] and find the &#039;&#039;&#039;q&#039;&#039;&#039; point that correspond to the minimum.&amp;lt;br&amp;gt;&lt;br /&gt;
A simpler approach is to use the GW (or Kohn-Sham) band structure to find the momentum responsible for the indirect band gap, in the major part of cases this corresponds to the lowest exciton.&amp;lt;br&amp;gt;&lt;br /&gt;
In the h-BN case we have:&lt;br /&gt;
[[File:Bn band structure.png|1000px|center| Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
The indirect gap is between a point close to &#039;&#039;&#039;K&#039;&#039;&#039; and the &#039;&#039;&#039;M&#039;&#039;&#039; point, see panel (a) of the figure above. We will approximate the momentum responsible for the indirect emission with &#039;&#039;&#039;q=K-M&#039;&#039;&#039;. Notice  that then we should build supercells that contain this moment, so it is good to approximate it with fractions of integers that are not too large so as not to have giant supercells. In this case we get &#039;&#039;&#039;q=(1/3,-1/6, 0)&#039;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
Notice that if you have a direct band gap material, the momentum &#039;&#039;&#039;q&#039;&#039;&#039; corresponding to the lowest transition is &#039;&#039;&#039;q=0&#039;&#039;&#039; and you do not need to construct special supercells to sample the corresponding vibration, it will be sufficient to displace atoms in the primitive cell.&lt;br /&gt;
&lt;br /&gt;
== Calculate phonons at momentum &#039;&#039;&#039;q&#039;&#039;&#039; of the indirect transition ==&lt;br /&gt;
&lt;br /&gt;
Now we need to calculate all atomic vibrations compatible with the momentum of the lowest indirect transition. In order to do so, we first calculate the phonons with QE, here the inputs [https://www.yambo-code.org/educational/tutorials/files/hBN_phonons.tgz hBN_phonons.tgz], then we calculate the force constants with q2r.x and now we can interpolate phonons along all the BZ as shown in panel (b) of Figure 1. Then we use matdyn.x to calculate phonons at momentum &#039;&#039;&#039;q=K-M = (1/3, -1/6, 0)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;input&lt;br /&gt;
    asr=&#039;crystal&#039;,&lt;br /&gt;
    flfrc=&#039;bn.fc&#039;,&lt;br /&gt;
    flfrq=&#039;bn.freq&#039;,&lt;br /&gt;
    deltaE=1.d0,&lt;br /&gt;
    q_in_cryst_coord=.true.&lt;br /&gt;
    fleig=&#039;bn.eig&#039;&lt;br /&gt;
 /&lt;br /&gt;
 2&lt;br /&gt;
 0 0 0&lt;br /&gt;
 0.3333333333333333 -0.16666666666666666666 0.0&lt;br /&gt;
&lt;br /&gt;
The obtained phonon modes correspond to phonons at the vertical red line in panel(b) of Fig. 1. They are written in the &#039;&#039;matdyn.modes&#039;&#039; file with the corresponding eigenvectors and will be later used to displace atoms along the phonon modes.&lt;br /&gt;
If you open the &#039;matdyn.modes&#039; file you will find phonon modes for the &#039;&#039;&#039;q=0&#039;&#039;&#039; and &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039;  that in cartesian coordinates is (1/3,0,0). We copy the modes corresponding to the second &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039; in a separate file, called &#039;&#039;Q2.modes&#039;&#039; that will look like:&lt;br /&gt;
&lt;br /&gt;
      diagonalizing the dynamical matrix ...&lt;br /&gt;
 &lt;br /&gt;
 q =       0.3333      0.0000      0.0000&lt;br /&gt;
 **************************************************************************&lt;br /&gt;
     freq (    1) =       5.194139 [THz] =     173.257815 [cm-1]&lt;br /&gt;
 (  0.000000  -0.000000    -0.000000  -0.000000    -0.274372  -0.475224   )&lt;br /&gt;
 ( -0.000000   0.000000    -0.000000  -0.000000    -0.445962   0.000001   )&lt;br /&gt;
 ( -0.000000  -0.000000    -0.000000  -0.000000    -0.222981  -0.386214   )&lt;br /&gt;
 (  0.000000   0.000000    -0.000000   0.000000    -0.548742   0.000000   )&lt;br /&gt;
 ...........................&lt;br /&gt;
&lt;br /&gt;
== Generate the supercell==&lt;br /&gt;
&lt;br /&gt;
Now we use YamboPy to generate the supercell corresponding to the momentum &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039;.  A tutorial is already present in the file &#039;&#039;tutorial/supercell/generate_supercells.py&#039;&#039;.&lt;br /&gt;
You can edit the file to specify the momentum &#039;&#039;&#039;q&#039;&#039;&#039;, the name of the SCF initial file (uc_filnm)  and the name of the phonon mode file (mode_file).&lt;br /&gt;
&lt;br /&gt;
    .....&lt;br /&gt;
    uc_filnm = &#039;hBN.scf.in&#039; #pw input&lt;br /&gt;
    Q = [[1,-1,0],[3,6,0]] #qpoint to fold in nondiagonal supercell: Q=(1/3,-1/6,0)&lt;br /&gt;
    kpoints = [12,12,4]    #NB: these fractional crystal coordinates must exactly divide the kpoint mesh!&lt;br /&gt;
    modes_file = &#039;Q2.modes&#039; #file with phonon eigenmodes&lt;br /&gt;
    .....&lt;br /&gt;
&lt;br /&gt;
run the script to generate the supercell without displace atoms &#039;&#039;python generate_supercells.py -N&#039;&#039;. The script will generate a non-diagonal supercell&amp;lt;ref&amp;gt;[https://arxiv.org/abs/1510.04418 Lattice dynamics and electron-phonon coupling calculations using nondiagonal supercells], J. H. Lloyd-Williams and B. Monserrat, Phys. Rev. B &#039;&#039;&#039;92&#039;&#039;&#039;, 184301(2015) &amp;lt;/ref&amp;gt; in the file &amp;quot;sc_nondiagonal.bn.scf&#039; that is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Supercell.png|500px|center| Supercell for the momentum q=(1/3, -1/6, 0) and the corresponding reciprocal space]]&lt;br /&gt;
&lt;br /&gt;
The YamboPy script automatically reduce the number of k-point in such a way to have the same sampling of the corresponding primitive cell, however we advice you to check if the new k-point grid is what you expect, and modify it in case of incorrect grid.&amp;lt;br&amp;gt;&lt;br /&gt;
In the same way you can generate the input file for non-self-consistent calculation in the supercell.&lt;br /&gt;
&lt;br /&gt;
==Calculate the optical spectra in the supercell==&lt;br /&gt;
&lt;br /&gt;
Now you have to calculate the optical spectra and exciton in the new supercell. Do not forget to increase the number of conduction bands in both the screening the Bethe-Salpeter equation. For example in the supercell shown above there are 24 atoms, 6 times more than in the original cell, so you will have to multiply the number of bands by 6, if in the base cell you have used 40 bands here you will have to put 240 to have the same convergence parameters. Then print exciton according to their energy with the command ypp -e s.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;N. B. &#039;&#039;&#039;: in order to not recalculate W for each atomic displacement you can perform calculations without symmetries in the pristine supercell and then copy the corresponding dielectric constant in the calculations with displaced atoms, this is usually a safe approximation described in Ref.&amp;lt;ref name=&amp;quot;cann&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After solving the BSE in the supecell you will find the excitons that were already present in the primary cell (within the numerical noise) and new lower energy excitons, with zero dipole matrix elements, that correspond to the indirect excitons that have now been  mapped at &#039;&#039;&#039;q=0&#039;&#039;&#039;, something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #    Maximum Residual Value =  0.38659E+01&lt;br /&gt;
 #   &lt;br /&gt;
 #    E [ev]             Strength           Index&lt;br /&gt;
 #&lt;br /&gt;
     5.7165937         0.47290171E-11      1.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7166047         0.58239158E-09      2.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7367945         0.31830746E-09      3.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7368207         0.33674005E-10      4.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.80542803        0.100763231E-6      5.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.80598068        0.384604526E-8      6.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.88944197         1.00000000         7.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.88967037        0.102969212E-1      8.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     ................&lt;br /&gt;
&lt;br /&gt;
This result shows that indirect exciton without the coupling with phonon do not contribute to the optical response.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Displace atoms and calculate dipoles derivatives==&lt;br /&gt;
Now you can generate the displaced supercell for all the phonon modes compatible with the indirect band gap &#039;&#039;&#039;q&#039;&#039;&#039; point by doing:  &#039;&#039;python generate_supercells.py -S&#039;&#039;. The script will produce a set of input files for each of the 12 phonon modes at &#039;&#039;&#039;q=(1/3,-1/6,0)&#039;&#039;&#039;. You have to perform BSE calculation for each one of these modes and get exciton dipoles.&amp;lt;br&amp;gt;&lt;br /&gt;
For each phonon mode the atoms are displaced along the corresponding eigenvector read from the &amp;quot;Q2.modes&amp;quot; file multiplied for 0.1 Bohr (the variable Temp=0.1), see the following line in &amp;quot;generate_supercell.py&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  ...  &lt;br /&gt;
  sc.displace(eivs,nd_atom_positions,Temp=0.1) # Generate list of displaced supercells as PwIn objects called &#039;modes_qe&#039;&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
this is usually a good value to get correct derivatives. In principle, it is possible to test different displacement lengths to get good second derivatives. The general rule is that the displacement should not be too small to avoid numerical noise and not too large to avoid contribution from third or forth order derivatives.&amp;lt;br&amp;gt;&lt;br /&gt;
Once you get dipoles for a given phonon mode you can calculate the second order dipole derivatives using a finite difference formula and the fact the first order derivatives are zero by construction as:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;  \frac{\partial^2 | T^S |^2}{\partial R_{\lambda,q}^2 } = 2 \frac{| T^S (R=\Delta R) |^2 - | T (R=0) |^2}{\Delta R^2} = 2 \frac{| T^S (R=\Delta R) |^2}{\Delta R^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In the Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt; we found that a single point formula above is enough to get good second derivatives, taking into account that the first derivative is zero, however you can test higher-order formulas to be sure that the result is correct, see for example [https://en.wikipedia.org/wiki/Finite_difference#Higher-order_differences higher-order differences]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: in the file produced by &#039;&#039;ypp&#039;&#039; the oscillator strengths are normalized to have the maximum equal to one, before calculating the derivatives remember to remove this normalization by multiplying all Oscillator Strengths for the maximum residual value, in the previous example:&lt;br /&gt;
&lt;br /&gt;
 #    Maximum Residual Value =  0.38659E+01&lt;br /&gt;
&lt;br /&gt;
==Luminescence==&lt;br /&gt;
&lt;br /&gt;
Now you have all the information necessary to construct the emission spectra. &amp;lt;br&amp;gt;Using the formula, derived in Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt; you obtain the phonon-assisted luminescence as: &lt;br /&gt;
[[File:Light emission.png|center|Light emission formula]]&lt;br /&gt;
&lt;br /&gt;
in this formula:&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt; n&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt;(ω)&amp;lt;/span&amp;gt; is the refractive index, that usually can be approximated with a constant in the luminescence energy range.&lt;br /&gt;
* E&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt; are the excitonic energies in the undistorted supercell, including indirect excitons&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt; B(E&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;,T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt;)&amp;lt;/span&amp;gt; is the Bose occupation of excitons, that can be approximated with a Boltzman function, see Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; is the excitonic temperature that should be obtained from experimental measurements or used as a parameters, for a discussion see Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt; d&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;|T&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;|&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;/dR&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;λ&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; are the derivatives of the exciton dipole matrix elements for a given phonon mode&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:violet&amp;quot;&amp;gt;Ω&amp;lt;sub&amp;gt;λ,&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; are the phonon frequencies and the sum on &#039;&#039;&#039;q&#039;&#039;&#039; is on the different supercells obtained from phonon modes responsible for the luminescence, in this tutorial there is just a single &#039;&#039;&#039;q&#039;&#039;&#039; point.&lt;br /&gt;
*  &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt; η &amp;lt;/span&amp;gt;  is the exciton line-width that is given as input parameter to define the broadening of the spectra&lt;br /&gt;
&lt;br /&gt;
In the h-BN example shown here, the T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt; was obtained from experimental measurements, only the lowest two excitons were included in the sum and the Bose function was replaced by a Botlzman distribution with the energy zero was fixed at the lowest excitonic energy. An appropriate scissor operator independent of the atomic displacements was added in the calculation. The final result is shown in the figure above and compared with experimental measurement at 10 Kelvin&lt;br /&gt;
[[File:Lum spectra.png|center|800px|Luminescence spectra]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Some additional considerations on luminescence calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In general due to the &#039;&#039;&#039;Bose&#039;&#039;&#039; (or &#039;&#039;&#039;Boltzmann&#039;&#039;&#039;) factor only the lower excitons (often only the lowest one) contribute to the luminescence signal&lt;br /&gt;
* The lowest excitons are  &#039;&#039;&#039;degenerate&#039;&#039;&#039; all of them have to be included in the sum, as in the h-BN example&lt;br /&gt;
* In the present formulation of luminescence spectra excitons are treated  as Bosons (or Boltzman particles), in principle it is possible to define a &#039;&#039;&#039;excitonic occupation&#039;&#039;&#039; starting from a quasi-equilibrium distribution of excited electron-hole, but this requires a rotation of the electron-hole occupations in the excitonic base for a discussion see Ref.&amp;lt;ref name=&#039;cann&#039;&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;mprl&#039;&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* In order to &#039;&#039;&#039;speed up calculations&#039;&#039;&#039; you can perform all calculation without symmetries and copy the dielectric constant (&#039;&#039;ndb.em1s*&#039;&#039; or &#039;&#039;ndb.pp*&#039;&#039; files) from the undistorted supercell to the displaced ones. In this case if you do not need to calculate GW correction, for example using a scissor, you can also reduce the number of bands in the the non-self-consistent calculation to the one required by the BSE, for a discussion see Ref&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Notice that the &#039;&#039;&#039;dipole matrix elements&#039;&#039;&#039; that will enter in optical absorption and luminescence depend form the direction of the electric field. In this example show before the luminescence has been averaged on &#039;&#039;x&#039;&#039; and &#039;&#039;y&#039;&#039; directions because we were interested in the in-place luminescence. In general is it possible to select specific directions to reproduce particular experimental setups&amp;lt;ref name=cann&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some example input files for h-BN==&lt;br /&gt;
&lt;br /&gt;
In this section I will provide some input files to repeat calculations in h-BN. Luminescence spectra was calculated using a 12x12x4 k-point grid and 200 bands for the dielectric constant in the primitive cell and 3000 mHa block size. In the supercell used to generate the luminescence spectra there are 24 atoms, this means that the to total number of bands has to bee increased to 1200 and the corresponding k-point sampling reduced approximately to 12x2x4, this is automatically done by the Yambopy.&lt;br /&gt;
Here the input files:&lt;br /&gt;
* Primitive cell SCF and NSCF files and inputs for phonon calculations: [https://www.yambo-code.org/educational/tutorials/files/Luminescence/hBN_scf_nscf_phonons.tgz hBN_scf_nscf_phonons.tgz]&lt;br /&gt;
* The Q=(1/3,1/6,0) phonon mode generated by matdyn.x: [https://www.yambo-code.org/educational/tutorials/files/Luminescence/Q_mode.tgz Q_mode.tgz]&lt;br /&gt;
* The non-diagonal supercells for SCF and NSCF calculations (without symmetries) and the Yambo file for the BSE [https://www.yambo-code.org/educational/tutorials/files/Luminescence/BSE_supercell.tgz  BSE_supercell.tgz]&lt;br /&gt;
* The displaced supercells for exciton-phonon calculations [https://www.yambo-code.org/educational/tutorials/files/Luminescence/Displaced_Cells.tgz Displaced_Cells.tgz]&lt;br /&gt;
&lt;br /&gt;
You can the same BSE input file in all the displaced supercells. &amp;lt;br&amp;gt;&lt;br /&gt;
If you did not use symmetries you can avoid to recalculate the dielectric constant by copying the SAVE/ndb.em1s* files from the undistributed supercell to the displaced ones.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Phonon-assisted_luminescence_by_finite_atomic_displacements&amp;diff=5999</id>
		<title>Phonon-assisted luminescence by finite atomic displacements</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Phonon-assisted_luminescence_by_finite_atomic_displacements&amp;diff=5999"/>
		<updated>2022-09-15T12:35:44Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* Displace atoms and calculate dipoles derivatives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Representative-instantaneous-atomic-configurations-of-H2O-top-and-H3O-bottom-Also.gif|thumb| 200px|Finite atomic displacements]]&lt;br /&gt;
&lt;br /&gt;
In recent years, several articles have been published with Yambo, who calculated the phonon-assisted luminescence by means of finite atomic displacements&amp;lt;ref name=&#039;cann&#039;&amp;gt;[https://arxiv.org/abs/1807.11797 Theory of phonon-assisted luminescence in solids: Application to hexagonal boron nitride], E. Cannuccia, B. Monserrat and C. Attaccalite, Phys. Rev. B &#039;&#039;&#039;99&#039;&#039;&#039;, 081109(R) (2019)&amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;fprl&#039;&amp;gt;[https://arxiv.org/abs/1810.08976 Exciton-Phonon Coupling in the Ultraviolet Absorption and Emission Spectra of Bulk Hexagonal Boron Nitride], F. Paleari et al. PRL &#039;&#039;&#039;122&#039;&#039;&#039;, 187401(2019) &amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;[https://scipost.org/SciPostPhys.12.5.145 Excitons under strain: light absorption and emission in strained hexagonal boron nitride], P. Lechifflart, F. Paleari and C. Attaccalite, SciPost Phys. &#039;&#039;&#039;12&#039;&#039;&#039;, 145(2022). &amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;mprl&#039;&amp;gt;[https://arxiv.org/abs/2111.03518  Phonon-Assisted Luminescence in Defect Centers from Many-Body Perturbation Theory], F. Libbi, P. M. M. C. de Melo, Z. Zanolli, M. J. Verstraete, and N. Marzari, Phys. Rev. Lett. &#039;&#039;&#039;128&#039;&#039;&#039;, 167401 (2022) &amp;lt;/ref&amp;gt;.&lt;br /&gt;
In this tutorial we will show how to use [https://github.com/yambo-code/yambopy YamboPy] in combination with Yambo to perform these kind of calculations. For a general review of finite displacements calculations of vibrational properties we recommend this article&amp;lt;ref&amp;gt;Electron-phonon coupling from finite differences, Bartomeu Monserrat, J. Phys.: Condens. Matter &#039;&#039;&#039;30&#039;&#039;&#039; 083001(2018)&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
Notice that calculation of phonon-assisted luminescence by finite atomic displacements are quite involved and expensive from a computational point of view, for this reason they are limited to relatively simple systems.&amp;lt;br&amp;gt;&lt;br /&gt;
In this tutorial we will follow the approach of Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;, and calculate luminescence using the Roosbroeck–Shockley (RS) relation applied to the excitonic case.&amp;lt;br&amp;gt;&lt;br /&gt;
If you use this approach to calculate luminescence or phonon-assisted absorption please cite references &amp;lt;ref name=cann&amp;gt;&amp;lt;/ref&amp;gt; and &amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; This tutorial requires that you are familiar with Bethe-Salpeter calculations with Yambo, and phonons with Quantum-Espresso, and YamboPy. If it is not the case please study the corresponding tutorial before continuing. &lt;br /&gt;
&lt;br /&gt;
== Locate the lowest indirect exciton (or indirect band gap) ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial as example we will consider the hexagonal-BN, that is an indirect insulator. The first step to calculate the phonon-assisted luminescence is to locate the lowest indirect exciton. The cleanest strategy to identify the lowest excitation would be to calculate the excitons along the whole Irreducible Brillouin zone(IBZ), then interpolate them as explained in [https://www.yambo-code.org/wiki/index.php?title=How_to_analyse_excitons#Interpolate_exciton_dispersion_(only_in_Yambo_5.x) Interpolate exciton dispersion] and find the &#039;&#039;&#039;q&#039;&#039;&#039; point that correspond to the minimum.&amp;lt;br&amp;gt;&lt;br /&gt;
A simpler approach is to use the GW (or Kohn-Sham) band structure to find the momentum responsible for the indirect band gap, in the major part of cases this corresponds to the lowest exciton.&amp;lt;br&amp;gt;&lt;br /&gt;
In the h-BN case we have:&lt;br /&gt;
[[File:Bn band structure.png|1000px|center| Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
The indirect gap is between a point close to &#039;&#039;&#039;K&#039;&#039;&#039; and the &#039;&#039;&#039;M&#039;&#039;&#039; point, see panel (a) of the figure above. We will approximate the momentum responsible for the indirect emission with &#039;&#039;&#039;q=K-M&#039;&#039;&#039;. Notice  that then we should build supercells that contain this moment, so it is good to approximate it with fractions of integers that are not too large so as not to have giant supercells. In this case we get &#039;&#039;&#039;q=(1/3,-1/6, 0)&#039;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
Notice that if you have a direct band gap material, the momentum &#039;&#039;&#039;q&#039;&#039;&#039; corresponding to the lowest transition is &#039;&#039;&#039;q=0&#039;&#039;&#039; and you do not need to construct special supercells to sample the corresponding vibration, it will be sufficient to displace atoms in the primitive cell.&lt;br /&gt;
&lt;br /&gt;
== Calculate phonons at momentum &#039;&#039;&#039;q&#039;&#039;&#039; of the indirect transition ==&lt;br /&gt;
&lt;br /&gt;
Now we need to calculate all atomic vibrations compatible with the momentum of the lowest indirect transition. In order to do so we first calculate the phonons with QE, here the inputs [https://www.yambo-code.org/educational/tutorials/files/hBN_phonons.tgz hBN_phonons.tgz], then we calculate the force constants with q2r.x and now we can interpolate phonons along all the BZ as shown in panel (b) of Figure 1. Then we use matdyn.x to calculate phonons at momentum &#039;&#039;&#039;q=K-M = (1/3, -1/6, 0)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;input&lt;br /&gt;
    asr=&#039;crystal&#039;,&lt;br /&gt;
    flfrc=&#039;bn.fc&#039;,&lt;br /&gt;
    flfrq=&#039;bn.freq&#039;,&lt;br /&gt;
    deltaE=1.d0,&lt;br /&gt;
    q_in_cryst_coord=.true.&lt;br /&gt;
    fleig=&#039;bn.eig&#039;&lt;br /&gt;
 /&lt;br /&gt;
 2&lt;br /&gt;
 0 0 0&lt;br /&gt;
 0.3333333333333333 -0.16666666666666666666 0.0&lt;br /&gt;
&lt;br /&gt;
The obtained phonon modes correspond phonons at the vertical red line in panel(b) of Fig. 1. They are written in the &#039;&#039;matdyn.modes&#039;&#039; file with the corresponding eigenvectors and will be later used to displace atoms along the phonon modes.&lt;br /&gt;
If you open the &#039;matdyn.modes&#039; file you will find phonon modes for the &#039;&#039;&#039;q=0&#039;&#039;&#039; and &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039;  that in cartesian coordinates is (1/3,0,0). We copy the modes corresponding to the second &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039; in a separate file, called &#039;&#039;Q2.modes&#039;&#039; that will look like:&lt;br /&gt;
&lt;br /&gt;
      diagonalizing the dynamical matrix ...&lt;br /&gt;
 &lt;br /&gt;
 q =       0.3333      0.0000      0.0000&lt;br /&gt;
 **************************************************************************&lt;br /&gt;
     freq (    1) =       5.194139 [THz] =     173.257815 [cm-1]&lt;br /&gt;
 (  0.000000  -0.000000    -0.000000  -0.000000    -0.274372  -0.475224   )&lt;br /&gt;
 ( -0.000000   0.000000    -0.000000  -0.000000    -0.445962   0.000001   )&lt;br /&gt;
 ( -0.000000  -0.000000    -0.000000  -0.000000    -0.222981  -0.386214   )&lt;br /&gt;
 (  0.000000   0.000000    -0.000000   0.000000    -0.548742   0.000000   )&lt;br /&gt;
 ...........................&lt;br /&gt;
&lt;br /&gt;
== Generate the supercell==&lt;br /&gt;
&lt;br /&gt;
Now we use YamboPy to generate the supercell corresponding to the momentum &#039;&#039;&#039;q=(1/3, -1/6, 0)&#039;&#039;&#039;.  A tutorial is already present in the file &#039;&#039;tutorial/supercell/generate_supercells.py&#039;&#039;.&lt;br /&gt;
You can edit the file to specify the momentum &#039;&#039;&#039;q&#039;&#039;&#039;, the name of the SCF initial file (uc_filnm)  and the name of the phonon mode file (mode_file).&lt;br /&gt;
&lt;br /&gt;
    .....&lt;br /&gt;
    uc_filnm = &#039;hBN.scf.in&#039; #pw input&lt;br /&gt;
    Q = [[1,-1,0],[3,6,0]] #qpoint to fold in nondiagonal supercell: Q=(1/3,-1/6,0)&lt;br /&gt;
    kpoints = [12,12,4]    #NB: these fractional crystal coordinates must exactly divide the kpoint mesh!&lt;br /&gt;
    modes_file = &#039;Q2.modes&#039; #file with phonon eigenmodes&lt;br /&gt;
    .....&lt;br /&gt;
&lt;br /&gt;
run the script to generate the supercell without displace atoms &#039;&#039;python generate_supercells.py -N&#039;&#039;. The script will generate a non-diagonal supercell&amp;lt;ref&amp;gt;[https://arxiv.org/abs/1510.04418 Lattice dynamics and electron-phonon coupling calculations using nondiagonal supercells], J. H. Lloyd-Williams and B. Monserrat, Phys. Rev. B &#039;&#039;&#039;92&#039;&#039;&#039;, 184301(2015) &amp;lt;/ref&amp;gt; in the file &amp;quot;sc_nondiagonal.bn.scf&#039; that is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Supercell.png|500px|center| Supercell for the momentum q=(1/3, -1/6, 0) and the corresponding reciprocal space]]&lt;br /&gt;
&lt;br /&gt;
The YamboPy script automatically reduce the number of k-point in such a way to have the same sampling of the corresponding primitive cell, however we advice you to check if the new k-point grid is what you expect, and modify it in case of incorrect grid.&amp;lt;br&amp;gt;&lt;br /&gt;
In the same way you can generate the input file for non-self-consistent calculation in the supercell.&lt;br /&gt;
&lt;br /&gt;
==Calculate the optical spectra in the supercell==&lt;br /&gt;
&lt;br /&gt;
Now you have to calculate the optical spectra and exciton in the new supercell. Do not forget to increase the number of conduction bands in both the screening the Bethe-Salpeter equation. For example in the supercell shown above there are 24 atoms, 6 times more than in the original cell, so you will have to multiply the number of bands by 6, if in the base cell you have used 40 bands here you will have to put 240 to have the same convergence parameters. Then print exciton according to their energy with the command ypp -e s.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;N. B. &#039;&#039;&#039;: in order to not recalculate W for each atomic displacement you can perform calculations without symmetries in the pristine supercell and then copy the corresponding dielectric constant in the calculations with displaced atoms, this is usually a safe approximation described in Ref.&amp;lt;ref name=&amp;quot;cann&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After solving the BSE in the supecell you will find the excitons that were already present in the primary cell (within the numerical noise) and new lower energy excitons, with zero dipole matrix elements, that correspond to the indirect excitons that have now been  mapped at &#039;&#039;&#039;q=0&#039;&#039;&#039;, something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #    Maximum Residual Value =  0.38659E+01&lt;br /&gt;
 #   &lt;br /&gt;
 #    E [ev]             Strength           Index&lt;br /&gt;
 #&lt;br /&gt;
     5.7165937         0.47290171E-11      1.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7166047         0.58239158E-09      2.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7367945         0.31830746E-09      3.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.7368207         0.33674005E-10      4.0000000         &amp;lt;-- Indirect exciton mapped at q=0&lt;br /&gt;
     5.80542803        0.100763231E-6      5.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.80598068        0.384604526E-8      6.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.88944197         1.00000000         7.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     5.88967037        0.102969212E-1      8.00000000        &amp;lt;-- Direct exciton&lt;br /&gt;
     ................&lt;br /&gt;
&lt;br /&gt;
This result shows that indirect exciton without the coupling with phonon do not contribute to the optical response.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Displace atoms and calculate dipoles derivatives==&lt;br /&gt;
Now you can generate the displaced supercell for all the phonon modes compatible with the indirect band gap &#039;&#039;&#039;q&#039;&#039;&#039; point by doing:  &#039;&#039;python generate_supercells.py -S&#039;&#039;. The script will produce a set of input files for each of the 12 phonon modes at &#039;&#039;&#039;q=(1/3,-1/6,0)&#039;&#039;&#039;. You have to perform BSE calculation for each one of these modes and get exciton dipoles.&amp;lt;br&amp;gt;&lt;br /&gt;
For each phonon mode the atoms are displaced along the corresponding eigenvector read from the &amp;quot;Q2.modes&amp;quot; file multiplied for 0.1 Bohr (the variable Temp=0.1), see the following line in &amp;quot;generate_supercell.py&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  ...  &lt;br /&gt;
  sc.displace(eivs,nd_atom_positions,Temp=0.1) # Generate list of displaced supercells as PwIn objects called &#039;modes_qe&#039;&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
this is usually a good value to get correct derivatives. In principle, it is possible to test different displacement lengths to get good second derivatives. The general rule is that the displacement should not be too small to avoid numerical noise and not too large to avoid contribution from third or forth order derivatives.&amp;lt;br&amp;gt;&lt;br /&gt;
Once you get dipoles for a given phonon mode you can calculate the second order dipole derivatives using a finite difference formula and the fact the first order derivatives are zero by construction as:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;  \frac{\partial^2 | T^S |^2}{\partial R_{\lambda,q}^2 } = 2 \frac{| T^S (R=\Delta R) |^2 - | T (R=0) |^2}{\Delta R^2} = 2 \frac{| T^S (R=\Delta R) |^2}{\Delta R^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In the Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt; we found that a single point formula above is enough to get good second derivatives, taking into account that the first derivative is zero, however you can test higher-order formulas to be sure that the result is correct, see for example [https://en.wikipedia.org/wiki/Finite_difference#Higher-order_differences higher-order differences]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: in the file produced by &#039;&#039;ypp&#039;&#039; the oscillator strengths are normalized to have the maximum equal to one, before calculating the derivatives remember to remove this normalization by multiplying all Oscillator Strengths for the maximum residual value, in the previous example:&lt;br /&gt;
&lt;br /&gt;
 #    Maximum Residual Value =  0.38659E+01&lt;br /&gt;
&lt;br /&gt;
==Luminescence==&lt;br /&gt;
&lt;br /&gt;
Now you have all the information necessary to construct the emission spectra. &amp;lt;br&amp;gt;Using the formula, derived in Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt; you obtain the phonon-assisted luminescence as: &lt;br /&gt;
[[File:Light emission.png|center|Light emission formula]]&lt;br /&gt;
&lt;br /&gt;
in this formula:&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt; n&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt;(ω)&amp;lt;/span&amp;gt; is the refractive index, that usually can be approximated with a constant in the luminescence energy range.&lt;br /&gt;
* E&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt; are the excitonic energies in the undistorted supercell, including indirect excitons&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt; B(E&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;,T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt;)&amp;lt;/span&amp;gt; is the Bose occupation of excitons, that can be approximated with a Boltzman function, see Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; is the excitonic temperature that should be obtained from experimental measurements or used as a parameters, for a discussion see Ref.&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt; d&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;|T&amp;lt;sup&amp;gt;S&amp;lt;/sup&amp;gt;|&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;/dR&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;λ&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; are the derivatives of the exciton dipole matrix elements for a given phonon mode&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:violet&amp;quot;&amp;gt;Ω&amp;lt;sub&amp;gt;λ,&#039;&#039;&#039;q&#039;&#039;&#039;&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; are the phonon frequencies and the sum on &#039;&#039;&#039;q&#039;&#039;&#039; is on the different supercells obtained from phonon modes responsible for the luminescence, in this tutorial there is just a single &#039;&#039;&#039;q&#039;&#039;&#039; point.&lt;br /&gt;
*  &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt; η &amp;lt;/span&amp;gt;  is the exciton line-width that is given as input parameter to define the broadening of the spectra&lt;br /&gt;
&lt;br /&gt;
In the h-BN example shown here, the T&amp;lt;sub&amp;gt;exc&amp;lt;/sub&amp;gt; was obtained from experimental measurements, only the lowest two excitons were included in the sum and the Bose function was replaced by a Botlzman distribution with the energy zero was fixed at the lowest excitonic energy. An appropriate scissor operator independent of the atomic displacements was added in the calculation. The final result is shown in the figure above and compared with experimental measurement at 10 Kelvin&lt;br /&gt;
[[File:Lum spectra.png|center|800px|Luminescence spectra]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Some additional considerations on luminescence calculations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In general due to the &#039;&#039;&#039;Bose&#039;&#039;&#039; (or &#039;&#039;&#039;Boltzmann&#039;&#039;&#039;) factor only the lower excitons (often only the lowest one) contribute to the luminescence signal&lt;br /&gt;
* The lowest excitons are  &#039;&#039;&#039;degenerate&#039;&#039;&#039; all of them have to be included in the sum, as in the h-BN example&lt;br /&gt;
* In the present formulation of luminescence spectra excitons are treated  as Bosons (or Boltzman particles), in principle it is possible to define a &#039;&#039;&#039;excitonic occupation&#039;&#039;&#039; starting from a quasi-equilibrium distribution of excited electron-hole, but this requires a rotation of the electron-hole occupations in the excitonic base for a discussion see Ref.&amp;lt;ref name=&#039;cann&#039;&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=&#039;mprl&#039;&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* In order to &#039;&#039;&#039;speed up calculations&#039;&#039;&#039; you can perform all calculation without symmetries and copy the dielectric constant (&#039;&#039;ndb.em1s*&#039;&#039; or &#039;&#039;ndb.pp*&#039;&#039; files) from the undistorted supercell to the displaced ones. In this case if you do not need to calculate GW correction, for example using a scissor, you can also reduce the number of bands in the the non-self-consistent calculation to the one required by the BSE, for a discussion see Ref&amp;lt;ref name=strain&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Notice that the &#039;&#039;&#039;dipole matrix elements&#039;&#039;&#039; that will enter in optical absorption and luminescence depend form the direction of the electric field. In this example show before the luminescence has been averaged on &#039;&#039;x&#039;&#039; and &#039;&#039;y&#039;&#039; directions because we were interested in the in-place luminescence. In general is it possible to select specific directions to reproduce particular experimental setups&amp;lt;ref name=cann&amp;gt;&amp;lt;/ref&amp;gt;&amp;lt;ref name=fprl&amp;gt;&amp;lt;/ref&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some example input files for h-BN==&lt;br /&gt;
&lt;br /&gt;
In this section I will provide some input files to repeat calculations in h-BN. Luminescence spectra was calculated using a 12x12x4 k-point grid and 200 bands for the dielectric constant in the primitive cell and 3000 mHa block size. In the supercell used to generate the luminescence spectra there are 24 atoms, this means that the to total number of bands has to bee increased to 1200 and the corresponding k-point sampling reduced approximately to 12x2x4, this is automatically done by the Yambopy.&lt;br /&gt;
Here the input files:&lt;br /&gt;
* Primitive cell SCF and NSCF files and inputs for phonon calculations: [https://www.yambo-code.org/educational/tutorials/files/Luminescence/hBN_scf_nscf_phonons.tgz hBN_scf_nscf_phonons.tgz]&lt;br /&gt;
* The Q=(1/3,1/6,0) phonon mode generated by matdyn.x: [https://www.yambo-code.org/educational/tutorials/files/Luminescence/Q_mode.tgz Q_mode.tgz]&lt;br /&gt;
* The non-diagonal supercells for SCF and NSCF calculations (without symmetries) and the Yambo file for the BSE [https://www.yambo-code.org/educational/tutorials/files/Luminescence/BSE_supercell.tgz  BSE_supercell.tgz]&lt;br /&gt;
* The displaced supercells for exciton-phonon calculations [https://www.yambo-code.org/educational/tutorials/files/Luminescence/Displaced_Cells.tgz Displaced_Cells.tgz]&lt;br /&gt;
&lt;br /&gt;
You can the same BSE input file in all the displaced supercells. &amp;lt;br&amp;gt;&lt;br /&gt;
If you did not use symmetries you can avoid to recalculate the dielectric constant by copying the SAVE/ndb.em1s* files from the undistributed supercell to the displaced ones.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5375</id>
		<title>Electron Phonon Coupling</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5375"/>
		<updated>2022-02-26T07:59:06Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Electron phonon.png|thumb|200px| Electron-phonon coupling]]&lt;br /&gt;
Here we show step-by-step how to use [https://www.quantum-espresso.org/ Quantum Espresso] to calculate phonons and electron-phonon matrix-elements on a regular q-grid. &lt;br /&gt;
The final aim is to allow Yambo to read them and calculate the temperature-dependent correction to the electronic states.&lt;br /&gt;
This tutorial&amp;lt;ref&amp;gt; This tutorial is based on [http://www.attaccalite.com/elena/news/ Elena Cannuccia blog]&amp;lt;/ref&amp;gt; is quite articulated, take your time to do it patiently.&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon matrix elements ==&lt;br /&gt;
&lt;br /&gt;
In this first section we will explain how to generate electron-phonon matrix elements in Quantum-Espresso, and how to import them in Yambo.&lt;br /&gt;
Calculations will be divided in different folders:&lt;br /&gt;
 &lt;br /&gt;
* &#039;&#039;&#039;pseudo&#039;&#039;&#039; the pseudo potential folder &lt;br /&gt;
* &#039;&#039;&#039;scf&#039;&#039;&#039; for the self-consistent calculation&lt;br /&gt;
* &#039;&#039;&#039;nscf&#039;&#039;&#039; for the non-self-consistent calculation with a larger number of bands&lt;br /&gt;
* &#039;&#039;&#039;phonon&#039;&#039;&#039; for the phonon calculations&lt;br /&gt;
* &#039;&#039;&#039;dvscf&#039;&#039;&#039; for the calculation of the electron-phonon matrix elements&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will show how to calculate electron-phonon induced corrections to the bands and optical properties for bulk silicon.&lt;br /&gt;
All input file are availabe in the following tgz file: [http://www.yambo-code.org/educational/tutorials/files/si.epc.tgz si.epc.tgz]&lt;br /&gt;
&lt;br /&gt;
1. In &#039;&#039;&#039;scf&#039;&#039;&#039; we run a standard scf calculation choosing a large k-grid in such a way to converge density. Do not forget to set  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;force_symmorphic=.true.&#039;&#039;&amp;lt;/span&amp;gt;, because not symmorphic symmetries are not supported yet in Yambo. Notice that:&lt;br /&gt;
&lt;br /&gt;
a) If you are working with 2D systems, not our case, we have to add the flag  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;assume_isolated=&amp;quot;2D&amp;quot;&#039;&#039;&amp;lt;/span&amp;gt; in such a way correct 2D phonons. &lt;br /&gt;
&lt;br /&gt;
b) If the cell is an &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;FCC&amp;lt;/span&amp;gt;, set manually the cell parameters by using the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;ibrav=0&#039;&#039;&amp;lt;/span&amp;gt; in your scf input file. This allows to generate correctly the uniform q grid over which phonons and electron-phonon databases are calculated, for example for Silicon you can use:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;system&lt;br /&gt;
  ......&lt;br /&gt;
  ibrav=  0,&lt;br /&gt;
  celldm(1) =5.09150&lt;br /&gt;
  .....&lt;br /&gt;
 /&lt;br /&gt;
 .....&lt;br /&gt;
 CELL_PARAMETERS alat&lt;br /&gt;
 0.0  1.0  1.0&lt;br /&gt;
 1.0  0.0  1.0&lt;br /&gt;
 1.0  1.0  0.0 &lt;br /&gt;
&lt;br /&gt;
2. Plug into &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, and then copy the ${PREFIX}.save folder from &#039;&#039;&#039;scf&#039;&#039;&#039; to &#039;&#039;&#039;nscf&#039;&#039;&#039;, in the present example just do  &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt;.&lt;br /&gt;
In the nscf input you have to choose the number of k-points and bands you will use for the electron-phonon coupling and Yambo calculations, in our case we will use a 4x4x4 grid and 12 bands.&lt;br /&gt;
&lt;br /&gt;
3. Read the q-points list. In the &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, enter in the ${PREFIX}.save then run &#039;&#039;p2y&#039;&#039; to read the wave-functions.&lt;br /&gt;
&lt;br /&gt;
4. Generate the setup file with the command &#039;&#039;yambo_ph -i -V all&#039;&#039; and uncomment the flag &#039;&#039;&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;BSEscatt&amp;lt;/span&amp;gt;&#039;&#039; then run the setup.&lt;br /&gt;
&lt;br /&gt;
5. Generate the input file to read the electron-phonon matrix elements with the command &#039;&#039;ypp_ph -k q&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 bzgrids                          # [R] BZ Grid generator&lt;br /&gt;
 Q_grid                           # [R] Q-grid analysis&lt;br /&gt;
 OutputAlat= 0.000000             # [a.u.] Lattice constant used for &amp;quot;alat&amp;quot; ouput format&lt;br /&gt;
 #NoWeights                     #  Do not print points weight&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;cooOut= &amp;quot;alat&amp;quot;&amp;lt;/span&amp;gt;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;ListPts                      &amp;lt;/span&amp;gt; #  List the internal q/k points also in the parser format&lt;br /&gt;
 #ExpandPts                     #  Expand the internal q/k points in the BZ&lt;br /&gt;
 #ForceUserPts                  #  Do not check the correcteness of the user points&lt;br /&gt;
 %Qpts                            # Q points list&lt;br /&gt;
  0.000000| 0.000000| 0.000000| &lt;br /&gt;
 %&lt;br /&gt;
and uncomment the flag &#039;&#039;&#039;ListPts&#039;&#039;&#039; and q-point coordinates units in &#039;&#039;&#039;alat&#039;&#039;&#039;, the units used by QuantumEspresso. Now if you run ypp_ph it will generate the list of q-points for the phonon calculations:&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 &amp;lt;---&amp;gt; Q-points (IBZ) PW-formatted&lt;br /&gt;
       0.000000000  0.000000000  0.000000000 1&lt;br /&gt;
       0.124999978  0.124999978 -0.124999993 1&lt;br /&gt;
      -0.249999955 -0.249999955  0.249999985 1&lt;br /&gt;
       0.249999955  0.000000000  0.000000000 1&lt;br /&gt;
       0.375000060  0.125000060 -0.125000060 1&lt;br /&gt;
       0.000000000 -0.249999955  0.249999985 1&lt;br /&gt;
      -0.499999911  0.000000000  0.000000000 1&lt;br /&gt;
      -0.499999911  0.249999985  0.000000000 1&lt;br /&gt;
 &amp;lt;---&amp;gt; [08] Timing Overview&lt;br /&gt;
 ......&lt;br /&gt;
&lt;br /&gt;
4. Plug into &#039;&#039;&#039;phonon&#039;&#039;&#039; directory.  You have to copy the self-consistent calculation in this folder&lt;br /&gt;
with the command &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./ &#039;&#039;&amp;lt;/span&amp;gt;. Then you can prepare an input file for phonons using the q-points list you generated in the previous step mutiplied by -1, &lt;br /&gt;
the final input will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
            verbosity = &#039;high&#039;&lt;br /&gt;
               tr2_ph = 1e-12h&lt;br /&gt;
               prefix = &#039;si&#039;&lt;br /&gt;
             fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
               fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
      electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
                epsil = .true.&lt;br /&gt;
                trans = .true.&lt;br /&gt;
                ldisp = .false.&lt;br /&gt;
                qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Plug into &#039;&#039;&#039;dvscf&#039;&#039;&#039; folder. From the nscf folder copy density and wave-functions (&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../nscf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt;), from the phonon folder copy the dynamical matrices and the dvscf files (&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../phonon/_ph0 ../phonon/*.dyn* ./&#039;&#039;&amp;lt;/span&amp;gt;).  Then  modify the phonon input to generate electron-phonon matrix elements for Yambo, by changing &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;epsil = .false.&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;trans = .false.&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;electron_phonon = yambo&amp;lt;/span&amp;gt;. You do not need to specify the k-point grid because it is read from the nscf wave-functions. In this way we will not recalculate phonons, but only the electron-phonon matrix elements for the number of bands present in the nscf input file, in our case 8 bands:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;&lt;br /&gt;
     electron_phonon = &#039;yambo&#039;,&lt;br /&gt;
               epsil = .false.&lt;br /&gt;
               trans = .false.&lt;br /&gt;
               ldisp = .false.&lt;br /&gt;
               qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
this run will generate a new folder &#039;&#039;elph_dir&#039;&#039; with all electron-phonon matrix elements in a format compatible with Yambo.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene&amp;lt;/span&amp;gt;: use the same parallelization in the &#039;&#039;&#039;phonon&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculation to avoid problem reading wave-functions.&lt;br /&gt;
&lt;br /&gt;
6. Now you have to read the electron-phonon matrix elements. Go in the &#039;&#039;dvscf/si.save&#039;&#039; folder, and use ypp_ph to import electron-phonon coupling, by doing &#039;&#039;ypp_ph -g g&#039;&#039; and the PW el-ph folder:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;DBsPATH= &amp;quot;../elph_dir/&amp;quot; &amp;lt;/span&amp;gt;                    # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 #GkkpExpand                      # Expand the gkkp in the whole BZ&lt;br /&gt;
 #GkkpConvert                     # Convert the gkkp to new I/O format&lt;br /&gt;
&lt;br /&gt;
run ypp_ph, and if everything went well you will get in output&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 -&amp;gt; [06] == Electron-Phonon Interface: PW-&amp;gt;Yambo Databases ==&lt;br /&gt;
 &amp;lt;---&amp;gt; PW(ELPH) databases ...[PHONON] ...found 8 Q-grid compatible&lt;br /&gt;
 &amp;lt;---&amp;gt; ELPH databases (WRITE) |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt;  Modes           :   6&lt;br /&gt;
 &amp;lt;---&amp;gt;  Bands range     :   12&lt;br /&gt;
 .....&lt;br /&gt;
&lt;br /&gt;
== Quasi-particle band structure ==&lt;br /&gt;
The first quantity we will calculate is the correction to the band structure induced by the electron-phonon coupling. In order to generate the corresponding input do &amp;quot;&#039;&#039;&#039;yambo_ph -g n -p fan -c ep -V gen&#039;&#039;&#039;&amp;quot;. In the input we require the correction only at gamma point:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 BoseTemp= 0.000000         eV    # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
If you run yambo_ph -J T0 you will get correction at zero kelvin to the band structure. You can change the temperature to 300 K by doing:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;BoseTemp= 300.0            Kn &amp;lt;/span&amp;gt;   # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
run again &#039;&#039;yambo_ph -J T300&#039;&#039; and compare the two output file o-T0.qp and o-T300.qp, to find how much the gap change with the temperature.&lt;br /&gt;
If you repeat the calculation for different temperature you can obtain the trend of the gap vs temperature. The figure below report the Silicon gap at Gamma Point at different temperature obtained in this tutorial:&lt;br /&gt;
[[File:Si_gap_finite_t.png|600px|center]]&lt;br /&gt;
If you uncomment the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt; the code saves information about the Eliashberg functions that can be plotted using the &#039;&#039;ypp_ph&#039;&#039;, see below.&amp;lt;br&amp;gt;&lt;br /&gt;
Finally if you add &#039;&#039;-V qp&#039;&#039; in the input generation a new flag appears &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;OnMassShell&amp;lt;/span&amp;gt;, if you un-comment this flag calculation will be performed in the &amp;quot;on mass shell&amp;quot; approximation, namely the static limit the Quasi-Particle approximation, for a discussion see reference &amp;lt;ref&amp;gt;H. Kawai et al. [https://arxiv.org/abs/1310.2038 Phys. Rev. B &#039;&#039;&#039;89&#039;&#039;&#039;, 085202 (2014)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the last column in the quasi-particle file &amp;quot;o.QP&amp;quot; contains the &#039;&#039;&#039;quasi-particle width&#039;&#039;&#039;, that is related to their life-time. You can plot the band structure including this width to get quasi-particle spectra&lt;br /&gt;
similar to the one measured in ARPES experiments, see Fig. 2 in ref. &amp;lt;ref&amp;gt; G. Antonius, S. Poncé, E. Lantagne-Hurtubise, G. Auclair, X. Gonze, and M. Côté&lt;br /&gt;
 [https://arxiv.org/abs/1505.07738 Phys. Rev. B 92, 085137 (2015)] &amp;lt;/ref&amp;gt;.&lt;br /&gt;
This parameter will be used in the next tutorial on [http://www.yambo-code.org/wiki/index.php?title=Optical_properties_at_finite_temperature optical properties at finite temperature].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;WARNING:&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; Yambo average the electron-phonon correction on the degenerate states, please &amp;lt;b&amp;gt;include all degenerate states in your calculations&amp;lt;/b&amp;gt;. For example in the silicon case you need correction from the 2nd band to the 8th band.&lt;br /&gt;
&lt;br /&gt;
== Convergence ==&lt;br /&gt;
&lt;br /&gt;
The results of this tutorial are not converged. This is due to the poor parameters used in this tutorial to make the calculations fast. In order to have converged results, first of all you have to be sure to have converged phonons, in order to do that increase  plane-wave cutoff,  number of k-points and if necessary reduce &#039;&#039;tr2_ph&#039;&#039;.&lt;br /&gt;
Then change the parameters for the Yambo calculations, increasing the number of &#039;&#039;&#039;k&#039;&#039;&#039; and &#039;&#039;&#039;q&#039;&#039;&#039; points and the number of bands. If you want to increase only the number of bands, just repeat the &#039;&#039;&#039;nscf&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculations without recalculate  &#039;&#039;&#039;phonons&#039;&#039;&#039;. In the following section we will describe a smart way to accelerate convergence.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene: &amp;lt;/span&amp;gt; At present Yambo neither implements the Fröhlich term at q=0&amp;lt;ref&amp;gt;Carla Verdi and Feliciano Giustino&lt;br /&gt;
[https://arxiv.org/abs/1510.06373 Phys. Rev. Lett. &#039;&#039;&#039;115&#039;&#039;&#039;, 176401 (2015)] &amp;lt;/ref&amp;gt; nor the quadrupolar correction,&amp;lt;ref&amp;gt;G. Brunin et al.  [https://arxiv.org/abs/2002.00628  Phys. Rev. Lett. &#039;&#039;&#039;125&#039;&#039;&#039;, 136601 (2020)]&amp;lt;/ref&amp;gt; therefore convergence in polar material can be very slow with the number of q-points.&lt;br /&gt;
&lt;br /&gt;
== Double-grid method for the electron-phonon coupling (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplifying at most the matrix elements of the electron-phonon self-energy have the structure:&lt;br /&gt;
&lt;br /&gt;
[[File:Self elph.png|center|Yambo tutorial image | 270px ]]&lt;br /&gt;
&lt;br /&gt;
where we omitted the electronic band and the phonon branches indexes. In order to speed up calculation one can average the denominators on an additional fine grid around each &#039;&#039;&#039;q&#039;&#039;&#039; points as:&lt;br /&gt;
&lt;br /&gt;
[[File:Formula dbgrid.png|center|Yambo tutorial image| 500px]]&lt;br /&gt;
&lt;br /&gt;
In order to exploit the double-grid tool we need the phonon energies calculated on a fine grid. For a general tutorial on phonon calculation with Quantum Espresso you can have a look at [https://www.quantum-espresso.org/wp-content/uploads/phonons_tutorial_shanghai1.pdf Hands on phonons].&amp;lt;br&amp;gt;&lt;br /&gt;
Starting from a well converged phonon calculation &#039;&#039;matdyn.x&#039;&#039; can interpolate phonon dispersion on a given q-sampling (for example a regular 14x14x14 grid, as shown in the input file below) and give the desired phonon energies. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;input&lt;br /&gt;
     asr=&#039;simple&#039;,&lt;br /&gt;
     flfrc=&#039;si.fc&#039;,&lt;br /&gt;
     flfrq=&#039;si.freq&#039;,&lt;br /&gt;
     dos=.true.,&lt;br /&gt;
     fldos=&#039;si.dos&#039;,&lt;br /&gt;
     deltaE=1.d0,&lt;br /&gt;
     nk1=14, nk2=14, nk3=14&lt;br /&gt;
 /&lt;br /&gt;
Alternatively you can generate a random q-sampling using Yambo (&#039;&#039;ypp -k r&#039;&#039;) and insert the corresponding q points list into a matdyn file. &lt;br /&gt;
&lt;br /&gt;
Once you generated the phonon energies you can read them with the command &#039;&#039;ypp_ph -g d&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_dg                          # [R] GKKP double grid&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;PHfreqF= &amp;quot;si.freq&amp;quot;&amp;lt;/span&amp;gt;            # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 FineGd_mode= &amp;quot;mixed&amp;quot;             # Fine Grid mode. Symmetry expanded, unexpanded or mixed.&lt;br /&gt;
 #SkipBorderPts                 # Skip points in the Fine Grid that are on the surface of coarse gride smal BZ`s&lt;br /&gt;
 EkplusQmode= &amp;quot;interp&amp;quot;            # E(k+q) energies calculation mode (interp | dftp )&lt;br /&gt;
 #TestPHDGrid                   # Test double-grid: set all values of the fine grid equal to the couse ones&lt;br /&gt;
&lt;br /&gt;
then run &#039;&#039;ypp_ph&#039;&#039; an it will generate a new file &#039;&#039;SAVE/ndb.PH_Double_Grid&#039;&#039;. &amp;lt;br&amp;gt;&lt;br /&gt;
In the calculation the new phonon energies will be expanded &lt;br /&gt;
using the symmetries of the systems, while the electronic energies at &#039;&#039;&#039;k+q&#039;&#039;&#039; will be interpolated using a smooth Fourier interpolation&amp;lt;ref&amp;gt;Warren E. Pickett, Henry Krakauer, and Philip B. Allen, &lt;br /&gt;
Phys. Rev. B &#039;&#039;&#039;38&#039;&#039;&#039;, 2721(1988)&amp;lt;/ref&amp;gt;.&lt;br /&gt;
In order to perform calculation with the double grid remove the &#039;&#039;SAVE/ndb.QP&#039;&#039; file and repeat the calculation. &amp;lt;br&amp;gt;&lt;br /&gt;
The best strategy to converge electron-phonon coupling calculations is to converge the double-grid for a fixed course grid and the increase the second one. Hereafter an example of Silicon band gap correction convergence versus the number of &#039;&#039;&#039;q&#039;&#039;&#039;-points in the course grid, using a double-grid with 4096 random &#039;&#039;&#039;q&#039;&#039;&#039;-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Gap conv.png|center|Yambo tutorial image | 750px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon coupling using different &#039;&#039;&#039;q&#039;&#039;&#039; and &#039;&#039;&#039;k&#039;&#039;&#039; grids (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
NOT WORKING!!!!!&lt;br /&gt;
&lt;br /&gt;
The procedure to create electron-phonon matrix elements and import them in Yambo is quite complicated.&lt;br /&gt;
For this reason in Yambo 5.x we decided to simplify this kind of calculations.&lt;br /&gt;
Now you can generate the &#039;&#039;&#039;q&#039;&#039;&#039; grid independently from the &#039;&#039;&#039;k&#039;&#039;&#039; grid. &lt;br /&gt;
You follow the previous steps to generate EPC matrix elements but in the phonon/dvscf input file&lt;br /&gt;
you specify the standard QE q-grid:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12h&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
     electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
               epsil = .true.&lt;br /&gt;
               trans = .true.&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;              ldisp = .true.&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;         nq1=6, nq2=6, nq3=2&amp;lt;/span&amp;gt;&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
then when you read the electron-phonon matrix elements you need to add the flag&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_db                          # [R] GKKP database&lt;br /&gt;
 #GkkpReadBare                  # Read the bare gkkp&lt;br /&gt;
 DBsPATH= &amp;quot;../elph_dir/&amp;quot;          # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpExpand &amp;lt;/span&amp;gt;                   # Expand the gkkp in the whole BZ&lt;br /&gt;
&lt;br /&gt;
In this way you can converge &#039;&#039;&#039;q&#039;&#039;&#039; grid independently for the &#039;&#039;&#039;k&#039;&#039;&#039; one. This is important because in general a larger set of q-points&lt;br /&gt;
is required to have converged results compared to the k-one. Add the flag &amp;quot;-V ph&amp;quot;  in the input generation for the electron-phonon self-energy and set:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpDB= &amp;quot;gkkp_expanded&amp;quot; &amp;lt;/span&amp;gt;                  # [ELPH] GKKP database (gkkp | gkkp_expanded | genFroh )&lt;br /&gt;
&lt;br /&gt;
Notice that the double-grid works also with k/q different grids.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and post-processing ==&lt;br /&gt;
&#039;&#039;&#039;Automatic generation of electron-phonon matrix elements&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Getting electron-phonon matrix elements from QuantumEspresso to Yambo is a complicated process, &amp;lt;br&amp;gt;&lt;br /&gt;
we advice you to create a script to automatize the procedure, here an example of a bash script for the silicon case: [http://www.yambo-code.org/educational/tutorials/files/SILICON_CONV.tgz SILICON-SCRIPT].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are a list of utilities to analyze electron-phonon coupling results:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Phonon density of states&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot phonon density of states with the command: &#039;&#039;ypp_ph -p d&#039;&#039;. In order to get a nice plot set in the input&lt;br /&gt;
&lt;br /&gt;
 phonons                          # [R] Phononic properties&lt;br /&gt;
 dos                              # [R] DOS&lt;br /&gt;
 PhBroad= 0.0005000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps=1000                      # Energy steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
notice that this is an easy quantity to check for the convergence in q-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Ph_dos.png|600px|center| Phonon Density of States]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Eliashberg Functions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot Eliashberg functions&amp;lt;ref&amp;gt;F. Marsiglio, J.P. Carbotte [https://arxiv.org/abs/cond-mat/0106143 Electron - Phonon Superconductivity]&amp;lt;/ref&amp;gt; for both electrons and excitons. In order to plot Eliashberg functions you must have calculated Quasi-Particle correction with the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt;, see above.&lt;br /&gt;
The command  &#039;&#039;ypp_ph -s e&#039;&#039; generate the input for the electronic Eliashberg functions:&lt;br /&gt;
&lt;br /&gt;
 electrons                        # [R] Electronic properties&lt;br /&gt;
 eliashberg                       # [R] Eliashberg&lt;br /&gt;
 PhBroad= 0.0010000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps= 200                      # Energy steps&lt;br /&gt;
 %QPkrange                        #  generalized Kpoint/Band indices&lt;br /&gt;
  1|1|4|5|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
in this example we plot Eliashberg functions for the top valence and bottom conduction band at Gamma point:&lt;br /&gt;
&lt;br /&gt;
[[File:Eliashberg functions.png|600px|center| Eliashberg functions]]&lt;br /&gt;
&lt;br /&gt;
For a discussion on how to interprete Eliashberg functions  and use them to understand the different phonon contribution you can have a look to ref.&amp;lt;ref&amp;gt;E. Cannuccia and A. Gali&lt;br /&gt;
[https://arxiv.org/abs/1907.06089 Phys. Rev. Materials 4, 014601 (2020)] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic displacement amplitudes&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Running &#039;&#039;ypp_ph -p a&#039;&#039; will plot the atomic displacement for each atom in the cell each direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Other variables in the input files &#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In the input files of the present tutorial there are other variable not used in this tutorial.&lt;br /&gt;
In particular &#039;&#039;GkkpExpand&#039;&#039; is used for other calculations not present in the GPL, while  &#039;&#039;GkkpConvert&#039;&#039; is used to checking purpose the IO for different versions&lt;br /&gt;
of the databases.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5354</id>
		<title>Electron Phonon Coupling</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5354"/>
		<updated>2022-02-21T13:29:44Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Electron phonon.png|thumb|200px| Electron-phonon coupling]]&lt;br /&gt;
Here we show step-by-step how to use [https://www.quantum-espresso.org/ Quantum Espresso] to calculate phonons and electron-phonon matrix-elements on a regular q-grid. &lt;br /&gt;
The final aim is to allow Yambo to read them and calculate the temperature-dependent correction to the electronic states.&lt;br /&gt;
This tutorial&amp;lt;ref&amp;gt; This tutorial is based on [http://www.attaccalite.com/elena/news/ Elena Cannuccia blog]&amp;lt;/ref&amp;gt; is quite articulated, take your time to do it patiently.&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon matrix elements ==&lt;br /&gt;
&lt;br /&gt;
In this first section we will explain how to generate electron-phonon matrix elements in Quantum-Espresso, and how to import them in Yambo.&lt;br /&gt;
Calculations will be divided in different folders:&lt;br /&gt;
 &lt;br /&gt;
* &#039;&#039;&#039;pseudo&#039;&#039;&#039; the pseudo potential folder &lt;br /&gt;
* &#039;&#039;&#039;scf&#039;&#039;&#039; for the self-consistent calculation&lt;br /&gt;
* &#039;&#039;&#039;nscf&#039;&#039;&#039; for the non-self-consistent calculation with a larger number of bands&lt;br /&gt;
* &#039;&#039;&#039;phonon&#039;&#039;&#039; for the phonon calculations&lt;br /&gt;
* &#039;&#039;&#039;dvscf&#039;&#039;&#039; for the calculation of the electron-phonon matrix elements&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will show how to calculate electron-phonon induced corrections to the bands and optical properties for bulk silicon.&lt;br /&gt;
All input file are availabe in the following tgz file: [http://www.yambo-code.org/educational/tutorials/files/si.epc.tgz si.epc.tgz]&lt;br /&gt;
&lt;br /&gt;
1. In &#039;&#039;&#039;scf&#039;&#039;&#039; we run a standard scf calculation choosing a large k-grid in such a way to converge density. Do not forget to set  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;force_symmorphic=.true.&#039;&#039;&amp;lt;/span&amp;gt;, because not symmorphic symmetries are not supported yet in Yambo. Notice that:&lt;br /&gt;
&lt;br /&gt;
a) If you are working with 2D systems, not our case, we have to add the flag  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;assume_isolated=&amp;quot;2D&amp;quot;&#039;&#039;&amp;lt;/span&amp;gt; in such a way correct 2D phonons. &lt;br /&gt;
&lt;br /&gt;
b) If the cell is an &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;FCC&amp;lt;/span&amp;gt;, set manually the cell parameters by using the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;ibrav=0&#039;&#039;&amp;lt;/span&amp;gt; in your scf input file. This allows to generate correctly the uniform q grid over which phonons and electron-phonon databases are calculated, for example for Silicon you can use:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;system&lt;br /&gt;
  ......&lt;br /&gt;
  ibrav=  0,&lt;br /&gt;
  celldm(1) =5.09150&lt;br /&gt;
  .....&lt;br /&gt;
 /&lt;br /&gt;
 .....&lt;br /&gt;
 CELL_PARAMETERS alat&lt;br /&gt;
 0.0  1.0  1.0&lt;br /&gt;
 1.0  0.0  1.0&lt;br /&gt;
 1.0  1.0  0.0 &lt;br /&gt;
&lt;br /&gt;
2. Plug into &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, and then copy the ${PREFIX}.save folder from &#039;&#039;&#039;scf&#039;&#039;&#039; to &#039;&#039;&#039;nscf&#039;&#039;&#039;, in the present example just do  &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt;.&lt;br /&gt;
In the nscf input you have to choose the number of k-points and bands you will use for the electron-phonon coupling and Yambo calculations, in our case we will use a 4x4x4 grid and 12 bands.&lt;br /&gt;
&lt;br /&gt;
3. Read the q-points list. In the &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, enter in the ${PREFIX}.save then run &#039;&#039;p2y&#039;&#039; to read the wave-functions.&lt;br /&gt;
&lt;br /&gt;
4. Generate the setup file with the command &#039;&#039;yambo_ph -i -V all&#039;&#039; and uncomment the flag &#039;&#039;&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;BSEscatt&amp;lt;/span&amp;gt;&#039;&#039; then run the setup.&lt;br /&gt;
&lt;br /&gt;
5. Generate the input file to read the electron-phonon matrix elements with the command &#039;&#039;ypp_ph -k q&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 bzgrids                          # [R] BZ Grid generator&lt;br /&gt;
 Q_grid                           # [R] Q-grid analysis&lt;br /&gt;
 OutputAlat= 0.000000             # [a.u.] Lattice constant used for &amp;quot;alat&amp;quot; ouput format&lt;br /&gt;
 #NoWeights                     #  Do not print points weight&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;cooOut= &amp;quot;alat&amp;quot;&amp;lt;/span&amp;gt;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;ListPts                      &amp;lt;/span&amp;gt; #  List the internal q/k points also in the parser format&lt;br /&gt;
 #ExpandPts                     #  Expand the internal q/k points in the BZ&lt;br /&gt;
 #ForceUserPts                  #  Do not check the correcteness of the user points&lt;br /&gt;
 %Qpts                            # Q points list&lt;br /&gt;
  0.000000| 0.000000| 0.000000| &lt;br /&gt;
 %&lt;br /&gt;
and uncomment the flag &#039;&#039;&#039;ListPts&#039;&#039;&#039; and q-point coordinates units in &#039;&#039;&#039;alat&#039;&#039;&#039;, the units used by QuantumEspresso. Now if you run ypp_ph it will generate the list of q-points for the phonon calculations:&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 &amp;lt;---&amp;gt; Q-points (IBZ) PW-formatted&lt;br /&gt;
       0.000000000  0.000000000  0.000000000 1&lt;br /&gt;
       0.124999978  0.124999978 -0.124999993 1&lt;br /&gt;
      -0.249999955 -0.249999955  0.249999985 1&lt;br /&gt;
       0.249999955  0.000000000  0.000000000 1&lt;br /&gt;
       0.375000060  0.125000060 -0.125000060 1&lt;br /&gt;
       0.000000000 -0.249999955  0.249999985 1&lt;br /&gt;
      -0.499999911  0.000000000  0.000000000 1&lt;br /&gt;
      -0.499999911  0.249999985  0.000000000 1&lt;br /&gt;
 &amp;lt;---&amp;gt; [08] Timing Overview&lt;br /&gt;
 ......&lt;br /&gt;
&lt;br /&gt;
4. Plug into &#039;&#039;&#039;phonon&#039;&#039;&#039; directory.  You have to copy the self-consistent calculation in this folder&lt;br /&gt;
with the command &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./ &#039;&#039;&amp;lt;/span&amp;gt;. Then you can prepare an input file for phonons using the q-points list you generated in the previous step mutiplied by -1, &lt;br /&gt;
the final input will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
            verbosity = &#039;high&#039;&lt;br /&gt;
               tr2_ph = 1e-12h&lt;br /&gt;
               prefix = &#039;si&#039;&lt;br /&gt;
             fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
               fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
      electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
                epsil = .true.&lt;br /&gt;
                trans = .true.&lt;br /&gt;
                ldisp = .false.&lt;br /&gt;
                qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Plug into &#039;&#039;&#039;dvscf&#039;&#039;&#039; folder. From the nscf folder copy density and wave-functions (&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../nscf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt;), from the phonon folder copy the dynamical matrices and the dvscf files (&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../phonon/_ph0 ../phonon/*.dyn* ./&#039;&#039;&amp;lt;/span&amp;gt;).  Then  modify the phonon input to generate electron-phonon matrix elements for Yambo, by changing &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;epsil = .false.&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;trans = .false.&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;electron_phonon = yambo&amp;lt;/span&amp;gt;. You do not need to specify the k-point grid because it is read from the nscf wave-functions. In this way we will not recalculate phonons, but only the electron-phonon matrix elements for the number of bands present in the nscf input file, in our case 8 bands:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;&lt;br /&gt;
     electron_phonon = &#039;yambo&#039;,&lt;br /&gt;
               epsil = .false.&lt;br /&gt;
               trans = .false.&lt;br /&gt;
               ldisp = .false.&lt;br /&gt;
               qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
this run will generate a new folder &#039;&#039;elph_dir&#039;&#039; with all electron-phonon matrix elements in a format compatible with Yambo.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene&amp;lt;/span&amp;gt;: use the same parallelization in the &#039;&#039;&#039;phonon&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculation to avoid problem reading wave-functions.&lt;br /&gt;
&lt;br /&gt;
6. Now you have to read the electron-phonon matrix elements. Go in the &#039;&#039;dvscf/si.save&#039;&#039; folder, and use ypp_ph to import electron-phonon coupling, by doing &#039;&#039;ypp_ph -g&#039;&#039; and the PW el-ph folder:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;DBsPATH= &amp;quot;../elph_dir/&amp;quot; &amp;lt;/span&amp;gt;                    # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 #GkkpExpand                      # Expand the gkkp in the whole BZ&lt;br /&gt;
 #GkkpConvert                     # Convert the gkkp to new I/O format&lt;br /&gt;
&lt;br /&gt;
run ypp_ph, and if everything went well you will get in output&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 -&amp;gt; [06] == Electron-Phonon Interface: PW-&amp;gt;Yambo Databases ==&lt;br /&gt;
 &amp;lt;---&amp;gt; PW(ELPH) databases ...[PHONON] ...found 8 Q-grid compatible&lt;br /&gt;
 &amp;lt;---&amp;gt; ELPH databases (WRITE) |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt;  Modes           :   6&lt;br /&gt;
 &amp;lt;---&amp;gt;  Bands range     :   12&lt;br /&gt;
 .....&lt;br /&gt;
&lt;br /&gt;
== Quasi-particle band structure ==&lt;br /&gt;
The first quantity we will calculate is the correction to the band structure induced by the electron-phonon coupling. In order to generate the corresponding input do &amp;quot;&#039;&#039;&#039;yambo_ph -g n -p fan -c ep -V gen&#039;&#039;&#039;&amp;quot;. In the input we require the correction only at gamma point:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 BoseTemp= 0.000000         eV    # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
If you run yambo_ph -J T0 you will get correction at zero kelvin to the band structure. You can change the temperature to 300 K by doing:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;BoseTemp= 300.0            Kn &amp;lt;/span&amp;gt;   # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
run again &#039;&#039;yambo_ph -J T300&#039;&#039; and compare the two output file o-T0.qp and o-T300.qp, to find how much the gap change with the temperature.&lt;br /&gt;
If you repeat the calculation for different temperature you can obtain the trend of the gap vs temperature. The figure below report the Silicon gap at Gamma Point at different temperature obtained in this tutorial:&lt;br /&gt;
[[File:Si_gap_finite_t.png|600px|center]]&lt;br /&gt;
If you uncomment the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt; the code saves information about the Eliashberg functions that can be plotted using the &#039;&#039;ypp_ph&#039;&#039;, see below.&amp;lt;br&amp;gt;&lt;br /&gt;
Finally if you add &#039;&#039;-V qp&#039;&#039; in the input generation a new flag appears &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;OnMassShell&amp;lt;/span&amp;gt;, if you un-comment this flag calculation will be performed in the &amp;quot;on mass shell&amp;quot; approximation, namely the static limit the Quasi-Particle approximation, for a discussion see reference &amp;lt;ref&amp;gt;H. Kawai et al. [https://arxiv.org/abs/1310.2038 Phys. Rev. B &#039;&#039;&#039;89&#039;&#039;&#039;, 085202 (2014)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the last column in the quasi-particle file &amp;quot;o.QP&amp;quot; contains the &#039;&#039;&#039;quasi-particle width&#039;&#039;&#039;, that is related to their life-time. You can plot the band structure including this width to get quasi-particle spectra&lt;br /&gt;
similar to the one measured in ARPES experiments, see Fig. 2 in ref. &amp;lt;ref&amp;gt; G. Antonius, S. Poncé, E. Lantagne-Hurtubise, G. Auclair, X. Gonze, and M. Côté&lt;br /&gt;
 [https://arxiv.org/abs/1505.07738 Phys. Rev. B 92, 085137 (2015)] &amp;lt;/ref&amp;gt;.&lt;br /&gt;
This parameter will be used in the next tutorial on [http://www.yambo-code.org/wiki/index.php?title=Optical_properties_at_finite_temperature optical properties at finite temperature].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;WARNING:&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; Yambo average the electron-phonon correction on the degenerate states, please &amp;lt;b&amp;gt;include all degenerate states in your calculations&amp;lt;/b&amp;gt;. For example in the silicon case you need correction from the 2nd band to the 8th band.&lt;br /&gt;
&lt;br /&gt;
== Convergence ==&lt;br /&gt;
&lt;br /&gt;
The results of this tutorial are not converged. This is due to the poor parameters used in this tutorial to make the calculations fast. In order to have converged results, first of all you have to be sure to have converged phonons, in order to do that increase  plane-wave cutoff,  number of k-points and if necessary reduce &#039;&#039;tr2_ph&#039;&#039;.&lt;br /&gt;
Then change the parameters for the Yambo calculations, increasing the number of &#039;&#039;&#039;k&#039;&#039;&#039; and &#039;&#039;&#039;q&#039;&#039;&#039; points and the number of bands. If you want to increase only the number of bands, just repeat the &#039;&#039;&#039;nscf&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculations without recalculate  &#039;&#039;&#039;phonons&#039;&#039;&#039;. In the following section we will describe a smart way to accelerate convergence.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene: &amp;lt;/span&amp;gt; At present Yambo neither implements the Fröhlich term at q=0&amp;lt;ref&amp;gt;Carla Verdi and Feliciano Giustino&lt;br /&gt;
[https://arxiv.org/abs/1510.06373 Phys. Rev. Lett. &#039;&#039;&#039;115&#039;&#039;&#039;, 176401 (2015)] &amp;lt;/ref&amp;gt; nor the quadrupolar correction,&amp;lt;ref&amp;gt;G. Brunin et al.  [https://arxiv.org/abs/2002.00628  Phys. Rev. Lett. &#039;&#039;&#039;125&#039;&#039;&#039;, 136601 (2020)]&amp;lt;/ref&amp;gt; therefore convergence in polar material can be very slow with the number of q-points.&lt;br /&gt;
&lt;br /&gt;
== Double-grid method for the electron-phonon coupling (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplifying at most the matrix elements of the electron-phonon self-energy have the structure:&lt;br /&gt;
&lt;br /&gt;
[[File:Self elph.png|center|Yambo tutorial image | 270px ]]&lt;br /&gt;
&lt;br /&gt;
where we omitted the electronic band and the phonon branches indexes. In order to speed up calculation one can average the denominators on an additional fine grid around each &#039;&#039;&#039;q&#039;&#039;&#039; points as:&lt;br /&gt;
&lt;br /&gt;
[[File:Formula dbgrid.png|center|Yambo tutorial image| 500px]]&lt;br /&gt;
&lt;br /&gt;
In order to exploit the double-grid tool we need the phonon energies calculated on a fine grid. Starting from a well converged phonon calculation &#039;&#039;matdyn.x&#039;&#039; can interpolate phonon dispersion on a given q-sampling (for example a regular 14x14x14 grid, as shown in the input file below) and give the desired phonon energies. &lt;br /&gt;
&lt;br /&gt;
 &amp;amp;input&lt;br /&gt;
     asr=&#039;simple&#039;,&lt;br /&gt;
     flfrc=&#039;si.fc&#039;,&lt;br /&gt;
     flfrq=&#039;si.freq&#039;,&lt;br /&gt;
     dos=.true.,&lt;br /&gt;
     fldos=&#039;si.dos&#039;,&lt;br /&gt;
     deltaE=1.d0,&lt;br /&gt;
     nk1=14, nk2=14, nk3=14&lt;br /&gt;
 /&lt;br /&gt;
Alternatively you can generate a random q-sampling using Yambo (&#039;&#039;ypp -k r&#039;&#039;) and insert the corresponding q points list into a matdyn file. &lt;br /&gt;
&lt;br /&gt;
Once you generated the phonon energies you can read them with the command &#039;&#039;ypp_ph -g d&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_dg                          # [R] GKKP double grid&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;PHfreqF= &amp;quot;si.freq&amp;quot;&amp;lt;/span&amp;gt;            # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 FineGd_mode= &amp;quot;mixed&amp;quot;             # Fine Grid mode. Symmetry expanded, unexpanded or mixed.&lt;br /&gt;
 #SkipBorderPts                 # Skip points in the Fine Grid that are on the surface of coarse gride smal BZ`s&lt;br /&gt;
 EkplusQmode= &amp;quot;interp&amp;quot;            # E(k+q) energies calculation mode (interp | dftp )&lt;br /&gt;
 #TestPHDGrid                   # Test double-grid: set all values of the fine grid equal to the couse ones&lt;br /&gt;
&lt;br /&gt;
then run &#039;&#039;ypp_ph&#039;&#039; an it will generate a new file &#039;&#039;SAVE/ndb.PH_Double_Grid&#039;&#039;. &amp;lt;br&amp;gt;&lt;br /&gt;
In the calculation the new phonon energies will be expanded &lt;br /&gt;
using the symmetries of the systems, while the electronic energies at &#039;&#039;&#039;k+q&#039;&#039;&#039; will be interpolated using a smooth Fourier interpolation&amp;lt;ref&amp;gt;Warren E. Pickett, Henry Krakauer, and Philip B. Allen, &lt;br /&gt;
Phys. Rev. B &#039;&#039;&#039;38&#039;&#039;&#039;, 2721(1988)&amp;lt;/ref&amp;gt;.&lt;br /&gt;
In order to perform calculation with the double grid remove the &#039;&#039;SAVE/ndb.QP&#039;&#039; file and repeat the calculation. &amp;lt;br&amp;gt;&lt;br /&gt;
The best strategy to converge electron-phonon coupling calculations is to converge the double-grid for a fixed course grid and the increase the second one. Hereafter an example of Silicon band gap correction convergence versus the number of &#039;&#039;&#039;q&#039;&#039;&#039;-points in the course grid, using a double-grid with 4096 random &#039;&#039;&#039;q&#039;&#039;&#039;-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Gap conv.png|center|Yambo tutorial image | 750px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon coupling using different &#039;&#039;&#039;q&#039;&#039;&#039; and &#039;&#039;&#039;k&#039;&#039;&#039; grids (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
NOT WORKING!!!!!&lt;br /&gt;
&lt;br /&gt;
The procedure to create electron-phonon matrix elements and import them in Yambo is quite complicated.&lt;br /&gt;
For this reason in Yambo 5.x we decided to simplify this kind of calculations.&lt;br /&gt;
Now you can generate the &#039;&#039;&#039;q&#039;&#039;&#039; grid independently from the &#039;&#039;&#039;k&#039;&#039;&#039; grid. &lt;br /&gt;
You follow the previous steps to generate EPC matrix elements but in the phonon/dvscf input file&lt;br /&gt;
you specify the standard QE q-grid:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12h&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
     electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
               epsil = .true.&lt;br /&gt;
               trans = .true.&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;              ldisp = .true.&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;         nq1=6, nq2=6, nq3=2&amp;lt;/span&amp;gt;&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
then when you read the electron-phonon matrix elements you need to add the flag&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_db                          # [R] GKKP database&lt;br /&gt;
 #GkkpReadBare                  # Read the bare gkkp&lt;br /&gt;
 DBsPATH= &amp;quot;../elph_dir/&amp;quot;          # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpExpand &amp;lt;/span&amp;gt;                   # Expand the gkkp in the whole BZ&lt;br /&gt;
&lt;br /&gt;
In this way you can converge &#039;&#039;&#039;q&#039;&#039;&#039; grid independently for the &#039;&#039;&#039;k&#039;&#039;&#039; one. This is important because in general a larger set of q-points&lt;br /&gt;
is required to have converged results compared to the k-one. Add the flag &amp;quot;-V ph&amp;quot;  in the input generation for the electron-phonon self-energy and set:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpDB= &amp;quot;gkkp_expanded&amp;quot; &amp;lt;/span&amp;gt;                  # [ELPH] GKKP database (gkkp | gkkp_expanded | genFroh )&lt;br /&gt;
&lt;br /&gt;
Notice that the double-grid works also with k/q different grids.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and post-processing ==&lt;br /&gt;
&#039;&#039;&#039;Automatic generation of electron-phonon matrix elements&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Getting electron-phonon matrix elements from QuantumEspresso to Yambo is a complicated process, &amp;lt;br&amp;gt;&lt;br /&gt;
we advice you to create a script to automatize the procedure, here an example of a bash script for the silicon case: [http://www.yambo-code.org/educational/tutorials/files/SILICON_CONV.tgz SILICON-SCRIPT].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are a list of utilities to analyze electron-phonon coupling results:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Phonon density of states&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot phonon density of states with the command: &#039;&#039;ypp_ph -p d&#039;&#039;. In order to get a nice plot set in the input&lt;br /&gt;
&lt;br /&gt;
 phonons                          # [R] Phononic properties&lt;br /&gt;
 dos                              # [R] DOS&lt;br /&gt;
 PhBroad= 0.0005000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps=1000                      # Energy steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
notice that this is an easy quantity to check for the convergence in q-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Ph_dos.png|600px|center| Phonon Density of States]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Eliashberg Functions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot Eliashberg functions&amp;lt;ref&amp;gt;F. Marsiglio, J.P. Carbotte [https://arxiv.org/abs/cond-mat/0106143 Electron - Phonon Superconductivity]&amp;lt;/ref&amp;gt; for both electrons and excitons. In order to plot Eliashberg functions you must have calculated Quasi-Particle correction with the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt;, see above.&lt;br /&gt;
The command  &#039;&#039;ypp_ph -s e&#039;&#039; generate the input for the electronic Eliashberg functions:&lt;br /&gt;
&lt;br /&gt;
 electrons                        # [R] Electronic properties&lt;br /&gt;
 eliashberg                       # [R] Eliashberg&lt;br /&gt;
 PhBroad= 0.0010000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps= 200                      # Energy steps&lt;br /&gt;
 %QPkrange                        #  generalized Kpoint/Band indices&lt;br /&gt;
  1|1|4|5|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
in this example we plot Eliashberg functions for the top valence and bottom conduction band at Gamma point:&lt;br /&gt;
&lt;br /&gt;
[[File:Eliashberg functions.png|600px|center| Eliashberg functions]]&lt;br /&gt;
&lt;br /&gt;
For a discussion on how to interprete Eliashberg functions  and use them to understand the different phonon contribution you can have a look to ref.&amp;lt;ref&amp;gt;E. Cannuccia and A. Gali&lt;br /&gt;
[https://arxiv.org/abs/1907.06089 Phys. Rev. Materials 4, 014601 (2020)] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic displacement amplitudes&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Running &#039;&#039;ypp_ph -p a&#039;&#039; will plot the atomic displacement for each atom in the cell each direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Other variables in the input files &#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In the input files of the present tutorial there are other variable not used in this tutorial.&lt;br /&gt;
In particular &#039;&#039;GkkpExpand&#039;&#039; is used for other calculations not present in the GPL, while  &#039;&#039;GkkpConvert&#039;&#039; is used to checking purpose the IO for different versions&lt;br /&gt;
of the databases.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5290</id>
		<title>Electron Phonon Coupling</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5290"/>
		<updated>2022-02-15T16:23:42Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Electron phonon.png|thumb|200px| Electron-phonon coupling]]&lt;br /&gt;
Here we show step-by-step how to use [https://www.quantum-espresso.org/ Quantum Espresso] to calculate phonons and electron-phonon matrix-elements on a regular q-grid, &lt;br /&gt;
with the final aim to allow Yambo to read these databases and calculate the temperature-dependent correction to the electronic states.&lt;br /&gt;
This tutorial&amp;lt;ref&amp;gt; This tutorial is based on [http://www.attaccalite.com/elena/news/ Elena Cannuccia blog]&amp;lt;/ref&amp;gt; is quite articulated, take your time to follow all the steps.&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon matrix elements ==&lt;br /&gt;
&lt;br /&gt;
In this first section we will explain how to generate electron-phonon matrix elements in Quantum-Espresso, and how to import them in Yambo.&lt;br /&gt;
Calculations will be divided in different folders:&lt;br /&gt;
 &lt;br /&gt;
* &#039;&#039;&#039;pseudo&#039;&#039;&#039; the pseudo potential folder &lt;br /&gt;
* &#039;&#039;&#039;scf&#039;&#039;&#039; for the self-consistent calculation&lt;br /&gt;
* &#039;&#039;&#039;nscf&#039;&#039;&#039; for the non-self-consistent calculation with a larger number of bands&lt;br /&gt;
* &#039;&#039;&#039;phonon&#039;&#039;&#039; for the phonons calculations&lt;br /&gt;
* &#039;&#039;&#039;dvscf&#039;&#039;&#039; for the calculation of the electron-phonon matrix elements&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will show how to calculate electron-phonon induced corrections to the bands and optical properties for bulk silicon.&lt;br /&gt;
All input file are availabe in the following tgz file: [http://www.yambo-code.org/educational/tutorials/files/si.epc.tgz si.epc.tgz]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. In &#039;&#039;&#039;scf&#039;&#039;&#039; we run a standard scf calculation choosing a large k-grid in such a way to converge density. Do not forget to set  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;force_symmorphic=.true.&#039;&#039;&amp;lt;/span&amp;gt;, because not symmorphic symmetries are not supported yet in Yambo. Notice that:&lt;br /&gt;
&lt;br /&gt;
a) If you are working with 2D systems, not our case, we have to add the flag  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;assume_isolated=&amp;quot;2D&amp;quot;&#039;&#039;&amp;lt;/span&amp;gt; in such a way correct 2D phonons. &lt;br /&gt;
&lt;br /&gt;
b) If the cell is an FCC, set manually the cell parameters by using the flag ibrav=0 in your scf input file. This allows to generate correctly the unform q grid over which phonons and electron-phonon databases are calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go in the &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, and then copy the ${PREFIX}.save folder from &#039;&#039;&#039;scf&#039;&#039;&#039; to &#039;&#039;&#039;nscf&#039;&#039;&#039;, in the present example just do  &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt;.&lt;br /&gt;
In the nscf input you have to choose the number of k-points and bands you will use for the electron-phonon coupling and Yambo calculations, in our case we will a 4x4x4 grid and 12 bands.&lt;br /&gt;
&lt;br /&gt;
3. Read the q-points list. In the &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, enter in the ${PREFIX}.save then run &#039;&#039;p2y&#039;&#039; to read the wave-functions.&lt;br /&gt;
&lt;br /&gt;
4. Generate the setup file with the command &#039;&#039;yambo_ph -i -V all&#039;&#039; and uncomment the flag &#039;&#039;&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;BSEscatt&amp;lt;/span&amp;gt;&#039;&#039; then run the setup.&lt;br /&gt;
&lt;br /&gt;
5. Generate the input file to read the electron-phonon matrix elements with the command &#039;&#039;ypp_ph -k q&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 bzgrids                          # [R] BZ Grid generator&lt;br /&gt;
 Q_grid                           # [R] Q-grid analysis&lt;br /&gt;
 OutputAlat= 0.000000             # [a.u.] Lattice constant used for &amp;quot;alat&amp;quot; ouput format&lt;br /&gt;
 #NoWeights                     #  Do not print points weight&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;cooOut= &amp;quot;alat&amp;quot;&amp;lt;/span&amp;gt;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;ListPts                      &amp;lt;/span&amp;gt; #  List the internal q/k points also in the parser format&lt;br /&gt;
 #ExpandPts                     #  Expand the internal q/k points in the BZ&lt;br /&gt;
 #ForceUserPts                  #  Do not check the correcteness of the user points&lt;br /&gt;
 %Qpts                            # Q points list&lt;br /&gt;
  0.000000| 0.000000| 0.000000| &lt;br /&gt;
 %&lt;br /&gt;
and uncomment the flag &#039;&#039;&#039;ListPts&#039;&#039;&#039; and q-point coordinates units in &#039;&#039;&#039;alat&#039;&#039;&#039;, the units used by QuantumEspresso. Now if you run ypp_ph it will generate the list of q-points for the phonon calculations:&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 &amp;lt;---&amp;gt; Q-points (IBZ) PW-formatted&lt;br /&gt;
       0.000000000  0.000000000  0.000000000 1&lt;br /&gt;
       0.124999978  0.124999978 -0.124999993 1&lt;br /&gt;
      -0.249999955 -0.249999955  0.249999985 1&lt;br /&gt;
       0.249999955  0.000000000  0.000000000 1&lt;br /&gt;
       0.375000060  0.125000060 -0.125000060 1&lt;br /&gt;
       0.000000000 -0.249999955  0.249999985 1&lt;br /&gt;
      -0.499999911  0.000000000  0.000000000 1&lt;br /&gt;
      -0.499999911  0.249999985  0.000000000 1&lt;br /&gt;
 &amp;lt;---&amp;gt; [08] Timing Overview&lt;br /&gt;
 ......&lt;br /&gt;
&lt;br /&gt;
4. Go in the &#039;&#039;&#039;phonon&#039;&#039;&#039; directory.  You have to copy the self-consistent calculation in this folder&lt;br /&gt;
with the command &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./ &#039;&#039;&amp;lt;/span&amp;gt;. Then you can prepare and input file for phonons using the q-points list you generated in the previous step mutiplied by -1, &lt;br /&gt;
the final input will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
            verbosity = &#039;high&#039;&lt;br /&gt;
               tr2_ph = 1e-12h&lt;br /&gt;
               prefix = &#039;si&#039;&lt;br /&gt;
             fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
               fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
      electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
                epsil = .true.&lt;br /&gt;
                trans = .true.&lt;br /&gt;
                ldisp = .false.&lt;br /&gt;
                qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Go in the &#039;&#039;&#039;dvscf&#039;&#039;&#039; folder. From the nscf folder copy density and wave-functions  and from the phonon folder copy the dynamical matrices and the dvscf matrix elements:  &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../nscf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../phonon/_ph0 ../phonon/*.dyn* ./&#039;&#039;&amp;lt;/span&amp;gt;.  Then  modify the phonon input to generate electron-phonon matrix elements for Yambo, by changing  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;trans = .false.&amp;lt;/span&amp;gt; and  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;electron_phonon = yambo&amp;lt;/span&amp;gt;. You do not need to specify the k-point grid because it is read from the nscf wave-functions. In this way we will not recalculate phonons, but only the electron-phonon matrix elements for the number of bands present in the nscf input file, in our case 8 bands:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;&lt;br /&gt;
     electron_phonon = &#039;yambo&#039;,&lt;br /&gt;
               epsil = .false.&lt;br /&gt;
               trans = .false.&lt;br /&gt;
               ldisp = .false.&lt;br /&gt;
               qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
this run will generate a new folder &#039;&#039;elph_dir&#039;&#039; with all electron-phonon matrix elements in a format compatible with Yambo.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene&amp;lt;/span&amp;gt;: use the same parallelization in the &#039;&#039;&#039;phonon&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculation to avoid problem reading wave-functions.&lt;br /&gt;
&lt;br /&gt;
6. Now you have to read the electron-phonon matrix elements. Go in the &#039;&#039;dvscf/si.save&#039;&#039; folder, and use ypp_ph to import electron-phonon coupling, by doing &#039;&#039;ypp_ph -g&#039;&#039; and the the PW el-ph folder:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;DBsPATH= &amp;quot;../elph_dir/&amp;quot; &amp;lt;/span&amp;gt;                    # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 #GkkpExpand                      # Expand the gkkp in the whole BZ&lt;br /&gt;
 #GkkpConvert                     # Convert the gkkp to new I/O format&lt;br /&gt;
&lt;br /&gt;
run ypp_ph, and if everything went well you will get in output&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 -&amp;gt; [06] == Electron-Phonon Interface: PW-&amp;gt;Yambo Databases ==&lt;br /&gt;
 &amp;lt;---&amp;gt; PW(ELPH) databases ...[PHONON] ...found 8 Q-grid compatible&lt;br /&gt;
 &amp;lt;---&amp;gt; ELPH databases (WRITE) |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt;  Modes           :   6&lt;br /&gt;
 &amp;lt;---&amp;gt;  Bands range     :   12&lt;br /&gt;
 .....&lt;br /&gt;
 &amp;lt;---&amp;gt; :: Uniform sampling      :yes&lt;br /&gt;
&lt;br /&gt;
== Quasi-particle band structure ==&lt;br /&gt;
The first quantity we will calculate is the correction to the band structure induced by the electron-phonon coupling. In order to generate the corresponding input do &amp;quot;&#039;&#039;&#039;yambo_ph -g n -p fan -c ep -V gen&#039;&#039;&#039;&amp;quot;. In the input we require the correction only at gamma point:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 BoseTemp= 0.000000         eV    # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
If you run yambo_ph -J T0 you will get correction at zero kelvin to the band structure. You can change the temperature to 300 K by doing:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;BoseTemp= 300.0            Kn &amp;lt;/span&amp;gt;   # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
run again &#039;&#039;yambo_ph -J T300&#039;&#039; and compare the two output file o-T0.qp and o-T300.qp, to find how much the gap change with the temperature.&lt;br /&gt;
If you repeat the calculation for different temperature you can obtain the trend of the gap vs temperature. The figure below report the Silicon gap at Gamma Point at different temperature obtained in this tutorial:&lt;br /&gt;
[[File:Si_gap_finite_t.png|600px|center]]&lt;br /&gt;
If you uncomment the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt; the code saves information about the Eliashberg functions that can be plotted using the &#039;&#039;ypp_ph&#039;&#039;, see below.&amp;lt;br&amp;gt;&lt;br /&gt;
Finally if you add &#039;&#039;-V qp&#039;&#039; in the input generation a new flag appears &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;OnMassShell&amp;lt;/span&amp;gt;, if you un-comment this flag calculation will be performed in the &amp;quot;on mass shell&amp;quot; approximation, namely the static limit the Quasi-Particle approximation, for a discussion see reference &amp;lt;ref&amp;gt;H. Kawai et al. [https://arxiv.org/abs/1310.2038 Phys. Rev. B &#039;&#039;&#039;89&#039;&#039;&#039;, 085202 (2014)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the last column in the quasi-particle file &amp;quot;o.QP&amp;quot; contains the &#039;&#039;&#039;quasi-particle width&#039;&#039;&#039;, that is related to their life-time. You can plot the band structure including this width to get quasi-particle spectra&lt;br /&gt;
similar to the one measured in ARPES experiments, see Fig. 2 in ref. &amp;lt;ref&amp;gt; G. Antonius, S. Poncé, E. Lantagne-Hurtubise, G. Auclair, X. Gonze, and M. Côté&lt;br /&gt;
 [https://arxiv.org/abs/1505.07738 Phys. Rev. B 92, 085137 (2015)] &amp;lt;/ref&amp;gt;.&lt;br /&gt;
This parameter will be used in the next tutorial on [http://www.yambo-code.org/wiki/index.php?title=Optical_properties_at_finite_temperature optical properties at finite temperature].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;WARNING:&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; Yambo average the electron-phonon correction on the degenerate states, please &amp;lt;b&amp;gt;include all degenerate states in your calculations&amp;lt;/b&amp;gt;. For example in the silicon case you need correction from the 2nd band to the 8th band.&lt;br /&gt;
&lt;br /&gt;
== Convergence ==&lt;br /&gt;
&lt;br /&gt;
The results of this tutorial are not converged. This is due to the poor parameters used in this tutorial to make the calculations fast. In order to have converged results, first of all you have to be sure to have converged phonons, in order to do that increase  plane-wave cutoff,  number of k-points and if necessary reduce &#039;&#039;tr2_ph&#039;&#039;.&lt;br /&gt;
Then change the parameters for the Yambo calculations, increasing the number of &#039;&#039;&#039;k&#039;&#039;&#039; and &#039;&#039;&#039;q&#039;&#039;&#039; points and the number of bands. If you want to increase only the number of bands, just repeat the &#039;&#039;&#039;nscf&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculations without recalculate  &#039;&#039;&#039;phonons&#039;&#039;&#039;. In the following section we will describe a smart way to accelerate convergence.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene: &amp;lt;/span&amp;gt; At present Yambo neither implements the Fröhlich term at q=0&amp;lt;ref&amp;gt;Carla Verdi and Feliciano Giustino&lt;br /&gt;
[https://arxiv.org/abs/1510.06373 Phys. Rev. Lett. &#039;&#039;&#039;115&#039;&#039;&#039;, 176401 (2015)] &amp;lt;/ref&amp;gt; nor the quadrupolar correction,&amp;lt;ref&amp;gt;G. Brunin et al.  [https://arxiv.org/abs/2002.00628  Phys. Rev. Lett. &#039;&#039;&#039;125&#039;&#039;&#039;, 136601 (2020)]&amp;lt;/ref&amp;gt; therefore convergence in polar material can be very slow with the number of q-points.&lt;br /&gt;
&lt;br /&gt;
== Double-grid method for the electron-phonon coupling (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general the matrix elements of the electron-phonon self-energy have the structure:&lt;br /&gt;
&lt;br /&gt;
[[File:Self elph.png|center|Yambo tutorial image | 270px ]]&lt;br /&gt;
&lt;br /&gt;
where we omitted the band and phonon indexes. In order to speed up calculation one can average the denominators on an additional fine grid around each &#039;&#039;&#039;q&#039;&#039;&#039; points as:&lt;br /&gt;
&lt;br /&gt;
[[File:Formula dbgrid.png|center|Yambo tutorial image| 500px]]&lt;br /&gt;
&lt;br /&gt;
In order to get the double-grid we need the phonon energies calculated on a fine grid. These energies can be obtained using the &#039;&#039;matdyn.x&#039;&#039; tool in QuantumEspresso.&lt;br /&gt;
Staring from a converged phonon calculation &#039;&#039;matdyn.x&#039;&#039; can interpolate phonon dispersion on a given q-sampling. You can choose to generate a random q-sampling&lt;br /&gt;
using &#039;&#039;ypp -k r&#039;&#039; or a regular double-grid directly generated by &#039;&#039;matdyn.x&#039;&#039; with the input:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;input&lt;br /&gt;
     asr=&#039;simple&#039;,&lt;br /&gt;
     flfrc=&#039;si.fc&#039;,&lt;br /&gt;
     flfrq=&#039;si.freq&#039;,&lt;br /&gt;
     dos=.true.,&lt;br /&gt;
     fldos=&#039;si.dos&#039;,&lt;br /&gt;
     deltaE=1.d0,&lt;br /&gt;
     nk1=14, nk2=14, nk3=14&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
Once you generated the phonon energies you can read them with the command &#039;&#039;ypp_ph -g d&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_dg                          # [R] GKKP double grid&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;PHfreqF= &amp;quot;si.freq&amp;quot;&amp;lt;/span&amp;gt;            # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 FineGd_mode= &amp;quot;mixed&amp;quot;             # Fine Grid mode. Symmetry expanded, unexpanded or mixed.&lt;br /&gt;
 #SkipBorderPts                 # Skip points in the Fine Grid that are on the surface of coarse gride smal BZ`s&lt;br /&gt;
 EkplusQmode= &amp;quot;interp&amp;quot;            # E(k+q) energies calculation mode (interp | dftp )&lt;br /&gt;
 #TestPHDGrid                   # Test double-grid: set all values of the fine grid equal to the couse ones&lt;br /&gt;
&lt;br /&gt;
then run &#039;&#039;ypp_ph&#039;&#039; an it will generate a new file &#039;&#039;SAVE/ndb.PH_Double_Grid&#039;&#039;. &amp;lt;br&amp;gt;&lt;br /&gt;
In the calculation the new phonon energies will be expanded &lt;br /&gt;
using the symmetries of the systems, while the electronic energies at &#039;&#039;&#039;k+q&#039;&#039;&#039; will be interpolated using a smooth Fourier interpolation.&lt;br /&gt;
In order to perform calculation with the double grid remove the &#039;&#039;SAVE/ndb.QP&#039;&#039; file and repeat the calculation. &amp;lt;br&amp;gt;&lt;br /&gt;
The best strategy to converge electron-phonon coupling calculations is to converge the double-grid for a fixed course grid and the increase the second one. Hereafter an example of Silicon band gap correction convergence versus the number of &#039;&#039;&#039;q&#039;&#039;&#039;-points in the course grid, using a double-grid with 4096 random &#039;&#039;&#039;q&#039;&#039;&#039;-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Gap conv.png|center|Yambo tutorial image | 750px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon coupling using different &#039;&#039;&#039;q&#039;&#039;&#039; and &#039;&#039;&#039;k&#039;&#039;&#039; grids (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
NOT WORKING!!!!!&lt;br /&gt;
&lt;br /&gt;
The procedure to create electron-phonon matrix elements and import them in Yambo is quite complicated.&lt;br /&gt;
For this reason in Yambo 5.x we decided to simplify this kind of calculations.&lt;br /&gt;
Now you can generate the &#039;&#039;&#039;q&#039;&#039;&#039; grid independently from the &#039;&#039;&#039;k&#039;&#039;&#039; grid. &lt;br /&gt;
You follow the previous steps to generate EPC matrix elements but in the phonon/dvscf input file&lt;br /&gt;
you specify the standard QE q-grid:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12h&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
     electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
               epsil = .true.&lt;br /&gt;
               trans = .true.&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;              ldisp = .true.&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;         nq1=6, nq2=6, nq3=2&amp;lt;/span&amp;gt;&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
then when you read the electron-phonon matrix elements you need to add the flag&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_db                          # [R] GKKP database&lt;br /&gt;
 #GkkpReadBare                  # Read the bare gkkp&lt;br /&gt;
 DBsPATH= &amp;quot;../elph_dir/&amp;quot;          # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpExpand &amp;lt;/span&amp;gt;                   # Expand the gkkp in the whole BZ&lt;br /&gt;
&lt;br /&gt;
In this way you can converge &#039;&#039;&#039;q&#039;&#039;&#039; grid independently for the &#039;&#039;&#039;k&#039;&#039;&#039; one. This is important because in general a larger set of q-points&lt;br /&gt;
is required to have converged results compared to the k-one. Add the flag &amp;quot;-V ph&amp;quot;  in the input generation for the electron-phonon self-energy and set:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpDB= &amp;quot;gkkp_expanded&amp;quot; &amp;lt;/span&amp;gt;                  # [ELPH] GKKP database (gkkp | gkkp_expanded | genFroh )&lt;br /&gt;
&lt;br /&gt;
Notice that the double-grid works also with k/q different grids.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and post-processing ==&lt;br /&gt;
&#039;&#039;&#039;Automatic generation of electron-phonon matrix elements&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Getting electron-phonon matrix elements from QuantumEspresso to Yambo is a complicated process, &amp;lt;br&amp;gt;&lt;br /&gt;
we advice you to create a script to automatize the procedure, here an example of a bash script for the silicon case: [http://www.yambo-code.org/educational/tutorials/files/SILICON_CONV.tgz SILICON-SCRIPT].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are a list of utilities to analyze electron-phonon coupling results:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Phonon density of states&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot phonon density of states with the command: &#039;&#039;ypp_ph -p d&#039;&#039;. In order to get a nice plot set in the input&lt;br /&gt;
&lt;br /&gt;
 phonons                          # [R] Phononic properties&lt;br /&gt;
 dos                              # [R] DOS&lt;br /&gt;
 PhBroad= 0.0005000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps=1000                      # Energy steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
notice that this is an easy quantity to check for the convergence in q-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Ph_dos.png|600px|center| Phonon Density of States]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Eliashberg Functions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot Eliashberg functions&amp;lt;ref&amp;gt;F. Marsiglio, J.P. Carbotte [https://arxiv.org/abs/cond-mat/0106143 Electron - Phonon Superconductivity]&amp;lt;/ref&amp;gt; for both electrons and excitons. In order to plot Eliashberg functions you must have calculated Quasi-Particle correction with the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt;, see above.&lt;br /&gt;
The command  &#039;&#039;ypp_ph -s e&#039;&#039; generate the input for the electronic Eliashberg functions:&lt;br /&gt;
&lt;br /&gt;
 electrons                        # [R] Electronic properties&lt;br /&gt;
 eliashberg                       # [R] Eliashberg&lt;br /&gt;
 PhBroad= 0.0010000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps= 200                      # Energy steps&lt;br /&gt;
 %QPkrange                        #  generalized Kpoint/Band indices&lt;br /&gt;
  1|1|4|5|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
in this example we plot Eliashberg functions for the top valence and bottom conduction band at Gamma point:&lt;br /&gt;
&lt;br /&gt;
[[File:Eliashberg functions.png|600px|center| Eliashberg functions]]&lt;br /&gt;
&lt;br /&gt;
For a discussion on how to interprete Eliashberg functions  and use them to understand the different phonon contribution you can have a look to ref.&amp;lt;ref&amp;gt;E. Cannuccia and A. Gali&lt;br /&gt;
[https://arxiv.org/abs/1907.06089 Phys. Rev. Materials 4, 014601 (2020)] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic displacement amplitudes&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Running &#039;&#039;ypp_ph -p a&#039;&#039; will plot the atomic displacement for each atom in the cell each direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Other variables in the input files &#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In the input files of the present tutorial there are other variable not used in this tutorial.&lt;br /&gt;
In particular &#039;&#039;GkkpExpand&#039;&#039; is used for other calculations not present in the GPL, while  &#039;&#039;GkkpConvert&#039;&#039; is used to checking purpose the IO for different versions&lt;br /&gt;
of the databases.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5289</id>
		<title>Electron Phonon Coupling</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5289"/>
		<updated>2022-02-15T16:23:14Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Electron phonon.png|thumb|200px| Electron-phonon coupling]]&lt;br /&gt;
Here we show step-by-step how to use [https://www.quantum-espresso.org/ Quantum Espresso] to calculate phonons and electron-phonon matrix-elements on a regular q-grid, &lt;br /&gt;
with the final aim to allow Yambo to read these databases and calculate the temperature-dependent correction to the electronic states.&lt;br /&gt;
This tutorial&amp;lt;ref&amp;gt; This tutorial is based on [http://www.attaccalite.com/elena/news/ Elena Cannuccia blog]&amp;lt;/ref&amp;gt; is quite articulated, take your time to follow all the steps.&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon matrix elements ==&lt;br /&gt;
&lt;br /&gt;
In this first section we will explain how to generate electron-phonon matrix elements in Quantum-Espresso, and how to import them in Yambo.&lt;br /&gt;
Calculations will be divided in different folders:&lt;br /&gt;
 &lt;br /&gt;
* &#039;&#039;&#039;pseudo&#039;&#039;&#039; the pseudo potential folder &lt;br /&gt;
* &#039;&#039;&#039;scf&#039;&#039;&#039; for the self-consistent calculation&lt;br /&gt;
* &#039;&#039;&#039;nscf&#039;&#039;&#039; for the non-self-consistent calculation with a larger number of bands&lt;br /&gt;
* &#039;&#039;&#039;phonon&#039;&#039;&#039; for the phonons calculations&lt;br /&gt;
* &#039;&#039;&#039;dvscf&#039;&#039;&#039; for the calculation of the electron-phonon matrix elements&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will show how to calculate electron-phonon induced corrections to the bands and optical properties for bulk silicon.&lt;br /&gt;
All input file are availabe in the following tgz file: [http://www.yambo-code.org/educational/tutorials/files/si.epc.tgz si.epc.tgz]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. In &#039;&#039;&#039;scf&#039;&#039;&#039; we run a standard scf calculation choosing a large k-grid in such a way to converge density. Do not forget to set  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;force_symmorphic=.true.&#039;&#039;&amp;lt;/span&amp;gt;, because not symmorphic symmetries are not supported yet in Yambo. Notice that:&lt;br /&gt;
&lt;br /&gt;
a) If you are working with 2D systems, not our case, we have to add the flag  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;assume_isolated=&amp;quot;2D&amp;quot;&#039;&#039;&amp;lt;/span&amp;gt; in such a way correct 2D phonons. &lt;br /&gt;
&lt;br /&gt;
b) If the cell is an FCC, set manually the cell parameters by using the flag ibrav=0 in your scf input file. This allows to generate correctly the unform q grid over which phonons and electron-phonon databasis are calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go in the &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, and then copy the ${PREFIX}.save folder from &#039;&#039;&#039;scf&#039;&#039;&#039; to &#039;&#039;&#039;nscf&#039;&#039;&#039;, in the present example just do  &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt;.&lt;br /&gt;
In the nscf input you have to choose the number of k-points and bands you will use for the electron-phonon coupling and Yambo calculations, in our case we will a 4x4x4 grid and 12 bands.&lt;br /&gt;
&lt;br /&gt;
3. Read the q-points list. In the &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, enter in the ${PREFIX}.save then run &#039;&#039;p2y&#039;&#039; to read the wave-functions.&lt;br /&gt;
&lt;br /&gt;
4. Generate the setup file with the command &#039;&#039;yambo_ph -i -V all&#039;&#039; and uncomment the flag &#039;&#039;&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;BSEscatt&amp;lt;/span&amp;gt;&#039;&#039; then run the setup.&lt;br /&gt;
&lt;br /&gt;
5. Generate the input file to read the electron-phonon matrix elements with the command &#039;&#039;ypp_ph -k q&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 bzgrids                          # [R] BZ Grid generator&lt;br /&gt;
 Q_grid                           # [R] Q-grid analysis&lt;br /&gt;
 OutputAlat= 0.000000             # [a.u.] Lattice constant used for &amp;quot;alat&amp;quot; ouput format&lt;br /&gt;
 #NoWeights                     #  Do not print points weight&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;cooOut= &amp;quot;alat&amp;quot;&amp;lt;/span&amp;gt;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;ListPts                      &amp;lt;/span&amp;gt; #  List the internal q/k points also in the parser format&lt;br /&gt;
 #ExpandPts                     #  Expand the internal q/k points in the BZ&lt;br /&gt;
 #ForceUserPts                  #  Do not check the correcteness of the user points&lt;br /&gt;
 %Qpts                            # Q points list&lt;br /&gt;
  0.000000| 0.000000| 0.000000| &lt;br /&gt;
 %&lt;br /&gt;
and uncomment the flag &#039;&#039;&#039;ListPts&#039;&#039;&#039; and q-point coordinates units in &#039;&#039;&#039;alat&#039;&#039;&#039;, the units used by QuantumEspresso. Now if you run ypp_ph it will generate the list of q-points for the phonon calculations:&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 &amp;lt;---&amp;gt; Q-points (IBZ) PW-formatted&lt;br /&gt;
       0.000000000  0.000000000  0.000000000 1&lt;br /&gt;
       0.124999978  0.124999978 -0.124999993 1&lt;br /&gt;
      -0.249999955 -0.249999955  0.249999985 1&lt;br /&gt;
       0.249999955  0.000000000  0.000000000 1&lt;br /&gt;
       0.375000060  0.125000060 -0.125000060 1&lt;br /&gt;
       0.000000000 -0.249999955  0.249999985 1&lt;br /&gt;
      -0.499999911  0.000000000  0.000000000 1&lt;br /&gt;
      -0.499999911  0.249999985  0.000000000 1&lt;br /&gt;
 &amp;lt;---&amp;gt; [08] Timing Overview&lt;br /&gt;
 ......&lt;br /&gt;
&lt;br /&gt;
4. Go in the &#039;&#039;&#039;phonon&#039;&#039;&#039; directory.  You have to copy the self-consistent calculation in this folder&lt;br /&gt;
with the command &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./ &#039;&#039;&amp;lt;/span&amp;gt;. Then you can prepare and input file for phonons using the q-points list you generated in the previous step mutiplied by -1, &lt;br /&gt;
the final input will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
            verbosity = &#039;high&#039;&lt;br /&gt;
               tr2_ph = 1e-12h&lt;br /&gt;
               prefix = &#039;si&#039;&lt;br /&gt;
             fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
               fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
      electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
                epsil = .true.&lt;br /&gt;
                trans = .true.&lt;br /&gt;
                ldisp = .false.&lt;br /&gt;
                qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Go in the &#039;&#039;&#039;dvscf&#039;&#039;&#039; folder. From the nscf folder copy density and wave-functions  and from the phonon folder copy the dynamical matrices and the dvscf matrix elements:  &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../nscf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../phonon/_ph0 ../phonon/*.dyn* ./&#039;&#039;&amp;lt;/span&amp;gt;.  Then  modify the phonon input to generate electron-phonon matrix elements for Yambo, by changing  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;trans = .false.&amp;lt;/span&amp;gt; and  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;electron_phonon = yambo&amp;lt;/span&amp;gt;. You do not need to specify the k-point grid because it is read from the nscf wave-functions. In this way we will not recalculate phonons, but only the electron-phonon matrix elements for the number of bands present in the nscf input file, in our case 8 bands:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;&lt;br /&gt;
     electron_phonon = &#039;yambo&#039;,&lt;br /&gt;
               epsil = .false.&lt;br /&gt;
               trans = .false.&lt;br /&gt;
               ldisp = .false.&lt;br /&gt;
               qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
this run will generate a new folder &#039;&#039;elph_dir&#039;&#039; with all electron-phonon matrix elements in a format compatible with Yambo.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene&amp;lt;/span&amp;gt;: use the same parallelization in the &#039;&#039;&#039;phonon&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculation to avoid problem reading wave-functions.&lt;br /&gt;
&lt;br /&gt;
6. Now you have to read the electron-phonon matrix elements. Go in the &#039;&#039;dvscf/si.save&#039;&#039; folder, and use ypp_ph to import electron-phonon coupling, by doing &#039;&#039;ypp_ph -g&#039;&#039; and the the PW el-ph folder:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;DBsPATH= &amp;quot;../elph_dir/&amp;quot; &amp;lt;/span&amp;gt;                    # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 #GkkpExpand                      # Expand the gkkp in the whole BZ&lt;br /&gt;
 #GkkpConvert                     # Convert the gkkp to new I/O format&lt;br /&gt;
&lt;br /&gt;
run ypp_ph, and if everything went well you will get in output&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 -&amp;gt; [06] == Electron-Phonon Interface: PW-&amp;gt;Yambo Databases ==&lt;br /&gt;
 &amp;lt;---&amp;gt; PW(ELPH) databases ...[PHONON] ...found 8 Q-grid compatible&lt;br /&gt;
 &amp;lt;---&amp;gt; ELPH databases (WRITE) |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt;  Modes           :   6&lt;br /&gt;
 &amp;lt;---&amp;gt;  Bands range     :   12&lt;br /&gt;
 .....&lt;br /&gt;
 &amp;lt;---&amp;gt; :: Uniform sampling      :yes&lt;br /&gt;
&lt;br /&gt;
== Quasi-particle band structure ==&lt;br /&gt;
The first quantity we will calculate is the correction to the band structure induced by the electron-phonon coupling. In order to generate the corresponding input do &amp;quot;&#039;&#039;&#039;yambo_ph -g n -p fan -c ep -V gen&#039;&#039;&#039;&amp;quot;. In the input we require the correction only at gamma point:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 BoseTemp= 0.000000         eV    # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
If you run yambo_ph -J T0 you will get correction at zero kelvin to the band structure. You can change the temperature to 300 K by doing:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;BoseTemp= 300.0            Kn &amp;lt;/span&amp;gt;   # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
run again &#039;&#039;yambo_ph -J T300&#039;&#039; and compare the two output file o-T0.qp and o-T300.qp, to find how much the gap change with the temperature.&lt;br /&gt;
If you repeat the calculation for different temperature you can obtain the trend of the gap vs temperature. The figure below report the Silicon gap at Gamma Point at different temperature obtained in this tutorial:&lt;br /&gt;
[[File:Si_gap_finite_t.png|600px|center]]&lt;br /&gt;
If you uncomment the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt; the code saves information about the Eliashberg functions that can be plotted using the &#039;&#039;ypp_ph&#039;&#039;, see below.&amp;lt;br&amp;gt;&lt;br /&gt;
Finally if you add &#039;&#039;-V qp&#039;&#039; in the input generation a new flag appears &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;OnMassShell&amp;lt;/span&amp;gt;, if you un-comment this flag calculation will be performed in the &amp;quot;on mass shell&amp;quot; approximation, namely the static limit the Quasi-Particle approximation, for a discussion see reference &amp;lt;ref&amp;gt;H. Kawai et al. [https://arxiv.org/abs/1310.2038 Phys. Rev. B &#039;&#039;&#039;89&#039;&#039;&#039;, 085202 (2014)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the last column in the quasi-particle file &amp;quot;o.QP&amp;quot; contains the &#039;&#039;&#039;quasi-particle width&#039;&#039;&#039;, that is related to their life-time. You can plot the band structure including this width to get quasi-particle spectra&lt;br /&gt;
similar to the one measured in ARPES experiments, see Fig. 2 in ref. &amp;lt;ref&amp;gt; G. Antonius, S. Poncé, E. Lantagne-Hurtubise, G. Auclair, X. Gonze, and M. Côté&lt;br /&gt;
 [https://arxiv.org/abs/1505.07738 Phys. Rev. B 92, 085137 (2015)] &amp;lt;/ref&amp;gt;.&lt;br /&gt;
This parameter will be used in the next tutorial on [http://www.yambo-code.org/wiki/index.php?title=Optical_properties_at_finite_temperature optical properties at finite temperature].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;WARNING:&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; Yambo average the electron-phonon correction on the degenerate states, please &amp;lt;b&amp;gt;include all degenerate states in your calculations&amp;lt;/b&amp;gt;. For example in the silicon case you need correction from the 2nd band to the 8th band.&lt;br /&gt;
&lt;br /&gt;
== Convergence ==&lt;br /&gt;
&lt;br /&gt;
The results of this tutorial are not converged. This is due to the poor parameters used in this tutorial to make the calculations fast. In order to have converged results, first of all you have to be sure to have converged phonons, in order to do that increase  plane-wave cutoff,  number of k-points and if necessary reduce &#039;&#039;tr2_ph&#039;&#039;.&lt;br /&gt;
Then change the parameters for the Yambo calculations, increasing the number of &#039;&#039;&#039;k&#039;&#039;&#039; and &#039;&#039;&#039;q&#039;&#039;&#039; points and the number of bands. If you want to increase only the number of bands, just repeat the &#039;&#039;&#039;nscf&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculations without recalculate  &#039;&#039;&#039;phonons&#039;&#039;&#039;. In the following section we will describe a smart way to accelerate convergence.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene: &amp;lt;/span&amp;gt; At present Yambo neither implements the Fröhlich term at q=0&amp;lt;ref&amp;gt;Carla Verdi and Feliciano Giustino&lt;br /&gt;
[https://arxiv.org/abs/1510.06373 Phys. Rev. Lett. &#039;&#039;&#039;115&#039;&#039;&#039;, 176401 (2015)] &amp;lt;/ref&amp;gt; nor the quadrupolar correction,&amp;lt;ref&amp;gt;G. Brunin et al.  [https://arxiv.org/abs/2002.00628  Phys. Rev. Lett. &#039;&#039;&#039;125&#039;&#039;&#039;, 136601 (2020)]&amp;lt;/ref&amp;gt; therefore convergence in polar material can be very slow with the number of q-points.&lt;br /&gt;
&lt;br /&gt;
== Double-grid method for the electron-phonon coupling (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general the matrix elements of the electron-phonon self-energy have the structure:&lt;br /&gt;
&lt;br /&gt;
[[File:Self elph.png|center|Yambo tutorial image | 270px ]]&lt;br /&gt;
&lt;br /&gt;
where we omitted the band and phonon indexes. In order to speed up calculation one can average the denominators on an additional fine grid around each &#039;&#039;&#039;q&#039;&#039;&#039; points as:&lt;br /&gt;
&lt;br /&gt;
[[File:Formula dbgrid.png|center|Yambo tutorial image| 500px]]&lt;br /&gt;
&lt;br /&gt;
In order to get the double-grid we need the phonon energies calculated on a fine grid. These energies can be obtained using the &#039;&#039;matdyn.x&#039;&#039; tool in QuantumEspresso.&lt;br /&gt;
Staring from a converged phonon calculation &#039;&#039;matdyn.x&#039;&#039; can interpolate phonon dispersion on a given q-sampling. You can choose to generate a random q-sampling&lt;br /&gt;
using &#039;&#039;ypp -k r&#039;&#039; or a regular double-grid directly generated by &#039;&#039;matdyn.x&#039;&#039; with the input:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;input&lt;br /&gt;
     asr=&#039;simple&#039;,&lt;br /&gt;
     flfrc=&#039;si.fc&#039;,&lt;br /&gt;
     flfrq=&#039;si.freq&#039;,&lt;br /&gt;
     dos=.true.,&lt;br /&gt;
     fldos=&#039;si.dos&#039;,&lt;br /&gt;
     deltaE=1.d0,&lt;br /&gt;
     nk1=14, nk2=14, nk3=14&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
Once you generated the phonon energies you can read them with the command &#039;&#039;ypp_ph -g d&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_dg                          # [R] GKKP double grid&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;PHfreqF= &amp;quot;si.freq&amp;quot;&amp;lt;/span&amp;gt;            # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 FineGd_mode= &amp;quot;mixed&amp;quot;             # Fine Grid mode. Symmetry expanded, unexpanded or mixed.&lt;br /&gt;
 #SkipBorderPts                 # Skip points in the Fine Grid that are on the surface of coarse gride smal BZ`s&lt;br /&gt;
 EkplusQmode= &amp;quot;interp&amp;quot;            # E(k+q) energies calculation mode (interp | dftp )&lt;br /&gt;
 #TestPHDGrid                   # Test double-grid: set all values of the fine grid equal to the couse ones&lt;br /&gt;
&lt;br /&gt;
then run &#039;&#039;ypp_ph&#039;&#039; an it will generate a new file &#039;&#039;SAVE/ndb.PH_Double_Grid&#039;&#039;. &amp;lt;br&amp;gt;&lt;br /&gt;
In the calculation the new phonon energies will be expanded &lt;br /&gt;
using the symmetries of the systems, while the electronic energies at &#039;&#039;&#039;k+q&#039;&#039;&#039; will be interpolated using a smooth Fourier interpolation.&lt;br /&gt;
In order to perform calculation with the double grid remove the &#039;&#039;SAVE/ndb.QP&#039;&#039; file and repeat the calculation. &amp;lt;br&amp;gt;&lt;br /&gt;
The best strategy to converge electron-phonon coupling calculations is to converge the double-grid for a fixed course grid and the increase the second one. Hereafter an example of Silicon band gap correction convergence versus the number of &#039;&#039;&#039;q&#039;&#039;&#039;-points in the course grid, using a double-grid with 4096 random &#039;&#039;&#039;q&#039;&#039;&#039;-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Gap conv.png|center|Yambo tutorial image | 750px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon coupling using different &#039;&#039;&#039;q&#039;&#039;&#039; and &#039;&#039;&#039;k&#039;&#039;&#039; grids (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
NOT WORKING!!!!!&lt;br /&gt;
&lt;br /&gt;
The procedure to create electron-phonon matrix elements and import them in Yambo is quite complicated.&lt;br /&gt;
For this reason in Yambo 5.x we decided to simplify this kind of calculations.&lt;br /&gt;
Now you can generate the &#039;&#039;&#039;q&#039;&#039;&#039; grid independently from the &#039;&#039;&#039;k&#039;&#039;&#039; grid. &lt;br /&gt;
You follow the previous steps to generate EPC matrix elements but in the phonon/dvscf input file&lt;br /&gt;
you specify the standard QE q-grid:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12h&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
     electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
               epsil = .true.&lt;br /&gt;
               trans = .true.&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;              ldisp = .true.&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;         nq1=6, nq2=6, nq3=2&amp;lt;/span&amp;gt;&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
then when you read the electron-phonon matrix elements you need to add the flag&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_db                          # [R] GKKP database&lt;br /&gt;
 #GkkpReadBare                  # Read the bare gkkp&lt;br /&gt;
 DBsPATH= &amp;quot;../elph_dir/&amp;quot;          # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpExpand &amp;lt;/span&amp;gt;                   # Expand the gkkp in the whole BZ&lt;br /&gt;
&lt;br /&gt;
In this way you can converge &#039;&#039;&#039;q&#039;&#039;&#039; grid independently for the &#039;&#039;&#039;k&#039;&#039;&#039; one. This is important because in general a larger set of q-points&lt;br /&gt;
is required to have converged results compared to the k-one. Add the flag &amp;quot;-V ph&amp;quot;  in the input generation for the electron-phonon self-energy and set:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpDB= &amp;quot;gkkp_expanded&amp;quot; &amp;lt;/span&amp;gt;                  # [ELPH] GKKP database (gkkp | gkkp_expanded | genFroh )&lt;br /&gt;
&lt;br /&gt;
Notice that the double-grid works also with k/q different grids.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and post-processing ==&lt;br /&gt;
&#039;&#039;&#039;Automatic generation of electron-phonon matrix elements&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Getting electron-phonon matrix elements from QuantumEspresso to Yambo is a complicated process, &amp;lt;br&amp;gt;&lt;br /&gt;
we advice you to create a script to automatize the procedure, here an example of a bash script for the silicon case: [http://www.yambo-code.org/educational/tutorials/files/SILICON_CONV.tgz SILICON-SCRIPT].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are a list of utilities to analyze electron-phonon coupling results:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Phonon density of states&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot phonon density of states with the command: &#039;&#039;ypp_ph -p d&#039;&#039;. In order to get a nice plot set in the input&lt;br /&gt;
&lt;br /&gt;
 phonons                          # [R] Phononic properties&lt;br /&gt;
 dos                              # [R] DOS&lt;br /&gt;
 PhBroad= 0.0005000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps=1000                      # Energy steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
notice that this is an easy quantity to check for the convergence in q-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Ph_dos.png|600px|center| Phonon Density of States]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Eliashberg Functions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot Eliashberg functions&amp;lt;ref&amp;gt;F. Marsiglio, J.P. Carbotte [https://arxiv.org/abs/cond-mat/0106143 Electron - Phonon Superconductivity]&amp;lt;/ref&amp;gt; for both electrons and excitons. In order to plot Eliashberg functions you must have calculated Quasi-Particle correction with the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt;, see above.&lt;br /&gt;
The command  &#039;&#039;ypp_ph -s e&#039;&#039; generate the input for the electronic Eliashberg functions:&lt;br /&gt;
&lt;br /&gt;
 electrons                        # [R] Electronic properties&lt;br /&gt;
 eliashberg                       # [R] Eliashberg&lt;br /&gt;
 PhBroad= 0.0010000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps= 200                      # Energy steps&lt;br /&gt;
 %QPkrange                        #  generalized Kpoint/Band indices&lt;br /&gt;
  1|1|4|5|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
in this example we plot Eliashberg functions for the top valence and bottom conduction band at Gamma point:&lt;br /&gt;
&lt;br /&gt;
[[File:Eliashberg functions.png|600px|center| Eliashberg functions]]&lt;br /&gt;
&lt;br /&gt;
For a discussion on how to interprete Eliashberg functions  and use them to understand the different phonon contribution you can have a look to ref.&amp;lt;ref&amp;gt;E. Cannuccia and A. Gali&lt;br /&gt;
[https://arxiv.org/abs/1907.06089 Phys. Rev. Materials 4, 014601 (2020)] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic displacement amplitudes&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Running &#039;&#039;ypp_ph -p a&#039;&#039; will plot the atomic displacement for each atom in the cell each direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Other variables in the input files &#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In the input files of the present tutorial there are other variable not used in this tutorial.&lt;br /&gt;
In particular &#039;&#039;GkkpExpand&#039;&#039; is used for other calculations not present in the GPL, while  &#039;&#039;GkkpConvert&#039;&#039; is used to checking purpose the IO for different versions&lt;br /&gt;
of the databases.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5288</id>
		<title>Electron Phonon Coupling</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Electron_Phonon_Coupling&amp;diff=5288"/>
		<updated>2022-02-15T16:22:33Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Electron phonon.png|thumb|200px| Electron-phonon coupling]]&lt;br /&gt;
Here we show step-by-step how to use [https://www.quantum-espresso.org/ Quantum Espresso] to calculate phonons and electron-phonon matrix-elements on a regular q-grid, &lt;br /&gt;
with the final aim to allow Yambo to read these databases and calculate the temperature-dependent correction to the electronic states.&lt;br /&gt;
This tutorial&amp;lt;ref&amp;gt; This tutorial is based on [http://www.attaccalite.com/elena/news/ Elena Cannuccia blog]&amp;lt;/ref&amp;gt; is quite articulated, take your time to follow all the steps.&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon matrix elements ==&lt;br /&gt;
&lt;br /&gt;
In this first section we will explain how to generate electron-phonon matrix elements in Quantum-Espresso, and how to import them in Yambo.&lt;br /&gt;
Calculations will be divided in different folders:&lt;br /&gt;
 &lt;br /&gt;
* &#039;&#039;&#039;pseudo&#039;&#039;&#039; the pseudo potential folder &lt;br /&gt;
* &#039;&#039;&#039;scf&#039;&#039;&#039; for the self-consistent calculation&lt;br /&gt;
* &#039;&#039;&#039;nscf&#039;&#039;&#039; for the non-self-consistent calculation with a larger number of bands&lt;br /&gt;
* &#039;&#039;&#039;phonon&#039;&#039;&#039; for the phonons calculations&lt;br /&gt;
* &#039;&#039;&#039;dvscf&#039;&#039;&#039; for the calculation of the electron-phonon matrix elements&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will show how to calculate electron-phonon induced corrections to the bands and optical properties for bulk silicon.&lt;br /&gt;
All input file are availabe in the following tgz file: [http://www.yambo-code.org/educational/tutorials/files/si.epc.tgz si.epc.tgz]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. In &#039;&#039;&#039;scf&#039;&#039;&#039; we run a standard scf calculation choosing a large k-grid in such a way to converge density. Do not forget to set  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;force_symmorphic=.true.&#039;&#039;&amp;lt;/span&amp;gt;, because not symmorphic symmetries are not supported yet in Yambo. Notice that:&lt;br /&gt;
a) If you are working with 2D systems, not our case, we have to add the flag  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;&#039;&#039;assume_isolated=&amp;quot;2D&amp;quot;&#039;&#039;&amp;lt;/span&amp;gt; in such a way correct 2D phonons. &lt;br /&gt;
b) If the cell is an FCC, set manually the cell parameters by using the flag ibrav=0 in your scf input file. This allows to generate correctly the unform q grid over which phonons and electron-phonon databasis are calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go in the &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, and then copy the ${PREFIX}.save folder from &#039;&#039;&#039;scf&#039;&#039;&#039; to &#039;&#039;&#039;nscf&#039;&#039;&#039;, in the present example just do  &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt;.&lt;br /&gt;
In the nscf input you have to choose the number of k-points and bands you will use for the electron-phonon coupling and Yambo calculations, in our case we will a 4x4x4 grid and 12 bands.&lt;br /&gt;
&lt;br /&gt;
3. Read the q-points list. In the &#039;&#039;&#039;nscf&#039;&#039;&#039; folder, enter in the ${PREFIX}.save then run &#039;&#039;p2y&#039;&#039; to read the wave-functions.&lt;br /&gt;
&lt;br /&gt;
4. Generate the setup file with the command &#039;&#039;yambo_ph -i -V all&#039;&#039; and uncomment the flag &#039;&#039;&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;BSEscatt&amp;lt;/span&amp;gt;&#039;&#039; then run the setup.&lt;br /&gt;
&lt;br /&gt;
5. Generate the input file to read the electron-phonon matrix elements with the command &#039;&#039;ypp_ph -k q&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 bzgrids                          # [R] BZ Grid generator&lt;br /&gt;
 Q_grid                           # [R] Q-grid analysis&lt;br /&gt;
 OutputAlat= 0.000000             # [a.u.] Lattice constant used for &amp;quot;alat&amp;quot; ouput format&lt;br /&gt;
 #NoWeights                     #  Do not print points weight&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;cooOut= &amp;quot;alat&amp;quot;&amp;lt;/span&amp;gt;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;ListPts                      &amp;lt;/span&amp;gt; #  List the internal q/k points also in the parser format&lt;br /&gt;
 #ExpandPts                     #  Expand the internal q/k points in the BZ&lt;br /&gt;
 #ForceUserPts                  #  Do not check the correcteness of the user points&lt;br /&gt;
 %Qpts                            # Q points list&lt;br /&gt;
  0.000000| 0.000000| 0.000000| &lt;br /&gt;
 %&lt;br /&gt;
and uncomment the flag &#039;&#039;&#039;ListPts&#039;&#039;&#039; and q-point coordinates units in &#039;&#039;&#039;alat&#039;&#039;&#039;, the units used by QuantumEspresso. Now if you run ypp_ph it will generate the list of q-points for the phonon calculations:&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 &amp;lt;---&amp;gt; Q-points (IBZ) PW-formatted&lt;br /&gt;
       0.000000000  0.000000000  0.000000000 1&lt;br /&gt;
       0.124999978  0.124999978 -0.124999993 1&lt;br /&gt;
      -0.249999955 -0.249999955  0.249999985 1&lt;br /&gt;
       0.249999955  0.000000000  0.000000000 1&lt;br /&gt;
       0.375000060  0.125000060 -0.125000060 1&lt;br /&gt;
       0.000000000 -0.249999955  0.249999985 1&lt;br /&gt;
      -0.499999911  0.000000000  0.000000000 1&lt;br /&gt;
      -0.499999911  0.249999985  0.000000000 1&lt;br /&gt;
 &amp;lt;---&amp;gt; [08] Timing Overview&lt;br /&gt;
 ......&lt;br /&gt;
&lt;br /&gt;
4. Go in the &#039;&#039;&#039;phonon&#039;&#039;&#039; directory.  You have to copy the self-consistent calculation in this folder&lt;br /&gt;
with the command &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../scf/si.save ./ &#039;&#039;&amp;lt;/span&amp;gt;. Then you can prepare and input file for phonons using the q-points list you generated in the previous step mutiplied by -1, &lt;br /&gt;
the final input will be:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
            verbosity = &#039;high&#039;&lt;br /&gt;
               tr2_ph = 1e-12h&lt;br /&gt;
               prefix = &#039;si&#039;&lt;br /&gt;
             fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
               fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
      electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
                epsil = .true.&lt;br /&gt;
                trans = .true.&lt;br /&gt;
                ldisp = .false.&lt;br /&gt;
                qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Go in the &#039;&#039;&#039;dvscf&#039;&#039;&#039; folder. From the nscf folder copy density and wave-functions  and from the phonon folder copy the dynamical matrices and the dvscf matrix elements:  &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../nscf/si.save ./&#039;&#039;&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;&#039;&#039;cp -r ../phonon/_ph0 ../phonon/*.dyn* ./&#039;&#039;&amp;lt;/span&amp;gt;.  Then  modify the phonon input to generate electron-phonon matrix elements for Yambo, by changing  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;trans = .false.&amp;lt;/span&amp;gt; and  &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;electron_phonon = yambo&amp;lt;/span&amp;gt;. You do not need to specify the k-point grid because it is read from the nscf wave-functions. In this way we will not recalculate phonons, but only the electron-phonon matrix elements for the number of bands present in the nscf input file, in our case 8 bands:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;&lt;br /&gt;
     electron_phonon = &#039;yambo&#039;,&lt;br /&gt;
               epsil = .false.&lt;br /&gt;
               trans = .false.&lt;br /&gt;
               ldisp = .false.&lt;br /&gt;
               qplot = .true.&lt;br /&gt;
 /&lt;br /&gt;
 8&lt;br /&gt;
 -0.0  -0.0  -0.0  1&lt;br /&gt;
 -0.124999978  -0.124999978  0.124999993  1&lt;br /&gt;
 0.249999955  0.249999955  -0.249999985  1&lt;br /&gt;
 -0.249999955  -0.0  -0.0  1&lt;br /&gt;
 -0.37500006  -0.12500006  0.12500006  1&lt;br /&gt;
 -0.0  0.249999955  -0.249999985  1&lt;br /&gt;
 0.499999911  -0.0  -0.0  1&lt;br /&gt;
 0.499999911  -0.249999985  -0.0  1&lt;br /&gt;
&lt;br /&gt;
this run will generate a new folder &#039;&#039;elph_dir&#039;&#039; with all electron-phonon matrix elements in a format compatible with Yambo.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene&amp;lt;/span&amp;gt;: use the same parallelization in the &#039;&#039;&#039;phonon&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculation to avoid problem reading wave-functions.&lt;br /&gt;
&lt;br /&gt;
6. Now you have to read the electron-phonon matrix elements. Go in the &#039;&#039;dvscf/si.save&#039;&#039; folder, and use ypp_ph to import electron-phonon coupling, by doing &#039;&#039;ypp_ph -g&#039;&#039; and the the PW el-ph folder:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;DBsPATH= &amp;quot;../elph_dir/&amp;quot; &amp;lt;/span&amp;gt;                    # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 #GkkpExpand                      # Expand the gkkp in the whole BZ&lt;br /&gt;
 #GkkpConvert                     # Convert the gkkp to new I/O format&lt;br /&gt;
&lt;br /&gt;
run ypp_ph, and if everything went well you will get in output&lt;br /&gt;
&lt;br /&gt;
 .....&lt;br /&gt;
 -&amp;gt; [06] == Electron-Phonon Interface: PW-&amp;gt;Yambo Databases ==&lt;br /&gt;
 &amp;lt;---&amp;gt; PW(ELPH) databases ...[PHONON] ...found 8 Q-grid compatible&lt;br /&gt;
 &amp;lt;---&amp;gt; ELPH databases (WRITE) |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt;  Modes           :   6&lt;br /&gt;
 &amp;lt;---&amp;gt;  Bands range     :   12&lt;br /&gt;
 .....&lt;br /&gt;
 &amp;lt;---&amp;gt; :: Uniform sampling      :yes&lt;br /&gt;
&lt;br /&gt;
== Quasi-particle band structure ==&lt;br /&gt;
The first quantity we will calculate is the correction to the band structure induced by the electron-phonon coupling. In order to generate the corresponding input do &amp;quot;&#039;&#039;&#039;yambo_ph -g n -p fan -c ep -V gen&#039;&#039;&#039;&amp;quot;. In the input we require the correction only at gamma point:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 BoseTemp= 0.000000         eV    # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
If you run yambo_ph -J T0 you will get correction at zero kelvin to the band structure. You can change the temperature to 300 K by doing:&lt;br /&gt;
&lt;br /&gt;
 dyson                            # [R] Dyson Equation solver&lt;br /&gt;
 gw0                              # [R] GW approximation&lt;br /&gt;
 el_ph_corr                       # [R] Electron-Phonon Correlation&lt;br /&gt;
 Nelectro= 8.000000               # Electrons number&lt;br /&gt;
 ElecTemp= 0.000000         eV    # Electronic Temperature&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;BoseTemp= 300.0            Kn &amp;lt;/span&amp;gt;   # Bosonic Temperature&lt;br /&gt;
 OccTresh= 0.100000E-4            # Occupation treshold (metallic bands)&lt;br /&gt;
 SE_Threads=0                     # [OPENMP/GW] Number of threads for self-energy&lt;br /&gt;
 DysSolver= &amp;quot;n&amp;quot;                   # [GW] Dyson Equation solver (&amp;quot;n&amp;quot;,&amp;quot;s&amp;quot;,&amp;quot;g&amp;quot;)&lt;br /&gt;
 % GphBRnge&lt;br /&gt;
  1 | 12 |                           # [ELPH] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 |  6 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 GDamping= 0.0100000         eV   # [GW] G[W] damping&lt;br /&gt;
 RandQpts=0                       # [RIM] Number of random q-points in the BZ&lt;br /&gt;
 #WRgFsq                        # [ELPH] Dump on file gFsq coefficients&lt;br /&gt;
 %QPkrange                        # [GW] QP generalized Kpoint/Band indices&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1|1|2|8|&amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
run again &#039;&#039;yambo_ph -J T300&#039;&#039; and compare the two output file o-T0.qp and o-T300.qp, to find how much the gap change with the temperature.&lt;br /&gt;
If you repeat the calculation for different temperature you can obtain the trend of the gap vs temperature. The figure below report the Silicon gap at Gamma Point at different temperature obtained in this tutorial:&lt;br /&gt;
[[File:Si_gap_finite_t.png|600px|center]]&lt;br /&gt;
If you uncomment the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt; the code saves information about the Eliashberg functions that can be plotted using the &#039;&#039;ypp_ph&#039;&#039;, see below.&amp;lt;br&amp;gt;&lt;br /&gt;
Finally if you add &#039;&#039;-V qp&#039;&#039; in the input generation a new flag appears &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;OnMassShell&amp;lt;/span&amp;gt;, if you un-comment this flag calculation will be performed in the &amp;quot;on mass shell&amp;quot; approximation, namely the static limit the Quasi-Particle approximation, for a discussion see reference &amp;lt;ref&amp;gt;H. Kawai et al. [https://arxiv.org/abs/1310.2038 Phys. Rev. B &#039;&#039;&#039;89&#039;&#039;&#039;, 085202 (2014)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the last column in the quasi-particle file &amp;quot;o.QP&amp;quot; contains the &#039;&#039;&#039;quasi-particle width&#039;&#039;&#039;, that is related to their life-time. You can plot the band structure including this width to get quasi-particle spectra&lt;br /&gt;
similar to the one measured in ARPES experiments, see Fig. 2 in ref. &amp;lt;ref&amp;gt; G. Antonius, S. Poncé, E. Lantagne-Hurtubise, G. Auclair, X. Gonze, and M. Côté&lt;br /&gt;
 [https://arxiv.org/abs/1505.07738 Phys. Rev. B 92, 085137 (2015)] &amp;lt;/ref&amp;gt;.&lt;br /&gt;
This parameter will be used in the next tutorial on [http://www.yambo-code.org/wiki/index.php?title=Optical_properties_at_finite_temperature optical properties at finite temperature].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;WARNING:&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; Yambo average the electron-phonon correction on the degenerate states, please &amp;lt;b&amp;gt;include all degenerate states in your calculations&amp;lt;/b&amp;gt;. For example in the silicon case you need correction from the 2nd band to the 8th band.&lt;br /&gt;
&lt;br /&gt;
== Convergence ==&lt;br /&gt;
&lt;br /&gt;
The results of this tutorial are not converged. This is due to the poor parameters used in this tutorial to make the calculations fast. In order to have converged results, first of all you have to be sure to have converged phonons, in order to do that increase  plane-wave cutoff,  number of k-points and if necessary reduce &#039;&#039;tr2_ph&#039;&#039;.&lt;br /&gt;
Then change the parameters for the Yambo calculations, increasing the number of &#039;&#039;&#039;k&#039;&#039;&#039; and &#039;&#039;&#039;q&#039;&#039;&#039; points and the number of bands. If you want to increase only the number of bands, just repeat the &#039;&#039;&#039;nscf&#039;&#039;&#039; and &#039;&#039;&#039;dvscf&#039;&#039;&#039; calculations without recalculate  &#039;&#039;&#039;phonons&#039;&#039;&#039;. In the following section we will describe a smart way to accelerate convergence.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Nota bene: &amp;lt;/span&amp;gt; At present Yambo neither implements the Fröhlich term at q=0&amp;lt;ref&amp;gt;Carla Verdi and Feliciano Giustino&lt;br /&gt;
[https://arxiv.org/abs/1510.06373 Phys. Rev. Lett. &#039;&#039;&#039;115&#039;&#039;&#039;, 176401 (2015)] &amp;lt;/ref&amp;gt; nor the quadrupolar correction,&amp;lt;ref&amp;gt;G. Brunin et al.  [https://arxiv.org/abs/2002.00628  Phys. Rev. Lett. &#039;&#039;&#039;125&#039;&#039;&#039;, 136601 (2020)]&amp;lt;/ref&amp;gt; therefore convergence in polar material can be very slow with the number of q-points.&lt;br /&gt;
&lt;br /&gt;
== Double-grid method for the electron-phonon coupling (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general the matrix elements of the electron-phonon self-energy have the structure:&lt;br /&gt;
&lt;br /&gt;
[[File:Self elph.png|center|Yambo tutorial image | 270px ]]&lt;br /&gt;
&lt;br /&gt;
where we omitted the band and phonon indexes. In order to speed up calculation one can average the denominators on an additional fine grid around each &#039;&#039;&#039;q&#039;&#039;&#039; points as:&lt;br /&gt;
&lt;br /&gt;
[[File:Formula dbgrid.png|center|Yambo tutorial image| 500px]]&lt;br /&gt;
&lt;br /&gt;
In order to get the double-grid we need the phonon energies calculated on a fine grid. These energies can be obtained using the &#039;&#039;matdyn.x&#039;&#039; tool in QuantumEspresso.&lt;br /&gt;
Staring from a converged phonon calculation &#039;&#039;matdyn.x&#039;&#039; can interpolate phonon dispersion on a given q-sampling. You can choose to generate a random q-sampling&lt;br /&gt;
using &#039;&#039;ypp -k r&#039;&#039; or a regular double-grid directly generated by &#039;&#039;matdyn.x&#039;&#039; with the input:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;input&lt;br /&gt;
     asr=&#039;simple&#039;,&lt;br /&gt;
     flfrc=&#039;si.fc&#039;,&lt;br /&gt;
     flfrq=&#039;si.freq&#039;,&lt;br /&gt;
     dos=.true.,&lt;br /&gt;
     fldos=&#039;si.dos&#039;,&lt;br /&gt;
     deltaE=1.d0,&lt;br /&gt;
     nk1=14, nk2=14, nk3=14&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
Once you generated the phonon energies you can read them with the command &#039;&#039;ypp_ph -g d&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_dg                          # [R] GKKP double grid&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;PHfreqF= &amp;quot;si.freq&amp;quot;&amp;lt;/span&amp;gt;            # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 FineGd_mode= &amp;quot;mixed&amp;quot;             # Fine Grid mode. Symmetry expanded, unexpanded or mixed.&lt;br /&gt;
 #SkipBorderPts                 # Skip points in the Fine Grid that are on the surface of coarse gride smal BZ`s&lt;br /&gt;
 EkplusQmode= &amp;quot;interp&amp;quot;            # E(k+q) energies calculation mode (interp | dftp )&lt;br /&gt;
 #TestPHDGrid                   # Test double-grid: set all values of the fine grid equal to the couse ones&lt;br /&gt;
&lt;br /&gt;
then run &#039;&#039;ypp_ph&#039;&#039; an it will generate a new file &#039;&#039;SAVE/ndb.PH_Double_Grid&#039;&#039;. &amp;lt;br&amp;gt;&lt;br /&gt;
In the calculation the new phonon energies will be expanded &lt;br /&gt;
using the symmetries of the systems, while the electronic energies at &#039;&#039;&#039;k+q&#039;&#039;&#039; will be interpolated using a smooth Fourier interpolation.&lt;br /&gt;
In order to perform calculation with the double grid remove the &#039;&#039;SAVE/ndb.QP&#039;&#039; file and repeat the calculation. &amp;lt;br&amp;gt;&lt;br /&gt;
The best strategy to converge electron-phonon coupling calculations is to converge the double-grid for a fixed course grid and the increase the second one. Hereafter an example of Silicon band gap correction convergence versus the number of &#039;&#039;&#039;q&#039;&#039;&#039;-points in the course grid, using a double-grid with 4096 random &#039;&#039;&#039;q&#039;&#039;&#039;-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Gap conv.png|center|Yambo tutorial image | 750px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Electron-phonon coupling using different &#039;&#039;&#039;q&#039;&#039;&#039; and &#039;&#039;&#039;k&#039;&#039;&#039; grids (only in Yambo 5.x) ==&lt;br /&gt;
&lt;br /&gt;
NOT WORKING!!!!!&lt;br /&gt;
&lt;br /&gt;
The procedure to create electron-phonon matrix elements and import them in Yambo is quite complicated.&lt;br /&gt;
For this reason in Yambo 5.x we decided to simplify this kind of calculations.&lt;br /&gt;
Now you can generate the &#039;&#039;&#039;q&#039;&#039;&#039; grid independently from the &#039;&#039;&#039;k&#039;&#039;&#039; grid. &lt;br /&gt;
You follow the previous steps to generate EPC matrix elements but in the phonon/dvscf input file&lt;br /&gt;
you specify the standard QE q-grid:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;inputph&lt;br /&gt;
           verbosity = &#039;high&#039;&lt;br /&gt;
              tr2_ph = 1e-12h&lt;br /&gt;
              prefix = &#039;si&#039;&lt;br /&gt;
            fildvscf = &#039;si-dvscf&#039;&lt;br /&gt;
              fildyn = &#039;si.dyn&#039;,&lt;br /&gt;
     electron_phonon = &#039;dvscf&#039;,&lt;br /&gt;
               epsil = .true.&lt;br /&gt;
               trans = .true.&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;              ldisp = .true.&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;         nq1=6, nq2=6, nq3=2&amp;lt;/span&amp;gt;&lt;br /&gt;
 /&lt;br /&gt;
&lt;br /&gt;
then when you read the electron-phonon matrix elements you need to add the flag&lt;br /&gt;
&lt;br /&gt;
 gkkp                             # [R] gkkp databases&lt;br /&gt;
 gkkp_db                          # [R] GKKP database&lt;br /&gt;
 #GkkpReadBare                  # Read the bare gkkp&lt;br /&gt;
 DBsPATH= &amp;quot;../elph_dir/&amp;quot;          # Path to the PW el-ph databases&lt;br /&gt;
 PHfreqF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon frequencies&lt;br /&gt;
 PHmodeF= &amp;quot;none&amp;quot;                  # PWscf format file containing the phonon modes&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpExpand &amp;lt;/span&amp;gt;                   # Expand the gkkp in the whole BZ&lt;br /&gt;
&lt;br /&gt;
In this way you can converge &#039;&#039;&#039;q&#039;&#039;&#039; grid independently for the &#039;&#039;&#039;k&#039;&#039;&#039; one. This is important because in general a larger set of q-points&lt;br /&gt;
is required to have converged results compared to the k-one. Add the flag &amp;quot;-V ph&amp;quot;  in the input generation for the electron-phonon self-energy and set:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;GkkpDB= &amp;quot;gkkp_expanded&amp;quot; &amp;lt;/span&amp;gt;                  # [ELPH] GKKP database (gkkp | gkkp_expanded | genFroh )&lt;br /&gt;
&lt;br /&gt;
Notice that the double-grid works also with k/q different grids.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and post-processing ==&lt;br /&gt;
&#039;&#039;&#039;Automatic generation of electron-phonon matrix elements&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Getting electron-phonon matrix elements from QuantumEspresso to Yambo is a complicated process, &amp;lt;br&amp;gt;&lt;br /&gt;
we advice you to create a script to automatize the procedure, here an example of a bash script for the silicon case: [http://www.yambo-code.org/educational/tutorials/files/SILICON_CONV.tgz SILICON-SCRIPT].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are a list of utilities to analyze electron-phonon coupling results:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Phonon density of states&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot phonon density of states with the command: &#039;&#039;ypp_ph -p d&#039;&#039;. In order to get a nice plot set in the input&lt;br /&gt;
&lt;br /&gt;
 phonons                          # [R] Phononic properties&lt;br /&gt;
 dos                              # [R] DOS&lt;br /&gt;
 PhBroad= 0.0005000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps=1000                      # Energy steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
notice that this is an easy quantity to check for the convergence in q-points.&lt;br /&gt;
&lt;br /&gt;
[[File:Ph_dos.png|600px|center| Phonon Density of States]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Eliashberg Functions&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
You can plot Eliashberg functions&amp;lt;ref&amp;gt;F. Marsiglio, J.P. Carbotte [https://arxiv.org/abs/cond-mat/0106143 Electron - Phonon Superconductivity]&amp;lt;/ref&amp;gt; for both electrons and excitons. In order to plot Eliashberg functions you must have calculated Quasi-Particle correction with the flag &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;WRgFsq&amp;lt;/span&amp;gt;, see above.&lt;br /&gt;
The command  &#039;&#039;ypp_ph -s e&#039;&#039; generate the input for the electronic Eliashberg functions:&lt;br /&gt;
&lt;br /&gt;
 electrons                        # [R] Electronic properties&lt;br /&gt;
 eliashberg                       # [R] Eliashberg&lt;br /&gt;
 PhBroad= 0.0010000          eV    # Phonon broadening (Eliashberg &amp;amp; DOS)&lt;br /&gt;
 PhStps= 200                      # Energy steps&lt;br /&gt;
 %QPkrange                        #  generalized Kpoint/Band indices&lt;br /&gt;
  1|1|4|5|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
in this example we plot Eliashberg functions for the top valence and bottom conduction band at Gamma point:&lt;br /&gt;
&lt;br /&gt;
[[File:Eliashberg functions.png|600px|center| Eliashberg functions]]&lt;br /&gt;
&lt;br /&gt;
For a discussion on how to interprete Eliashberg functions  and use them to understand the different phonon contribution you can have a look to ref.&amp;lt;ref&amp;gt;E. Cannuccia and A. Gali&lt;br /&gt;
[https://arxiv.org/abs/1907.06089 Phys. Rev. Materials 4, 014601 (2020)] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic displacement amplitudes&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Running &#039;&#039;ypp_ph -p a&#039;&#039; will plot the atomic displacement for each atom in the cell each direction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Other variables in the input files &#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In the input files of the present tutorial there are other variable not used in this tutorial.&lt;br /&gt;
In particular &#039;&#039;GkkpExpand&#039;&#039; is used for other calculations not present in the GPL, while  &#039;&#039;GkkpConvert&#039;&#039; is used to checking purpose the IO for different versions&lt;br /&gt;
of the databases.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5286</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5286"/>
		<updated>2022-02-08T22:42:47Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* COHSEX without empty bands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Basic concepts of the GW approximation =&lt;br /&gt;
&lt;br /&gt;
[[File:GW0.png|x300px|center|]] &lt;br /&gt;
&lt;br /&gt;
In this tutorial you will learn the basic concepts of the [[Hartree-Fock]] and of the GW&amp;lt;ref name=&amp;quot;gw&amp;quot;/&amp;gt; approximation. In particular we will illustrate how to calculate [http://en.wikipedia.org/wiki/Quasiparticle Quasi-Particle] energies with a single shot G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; approximation. Different lecture notes on the GW approach are available in the [[Lectures|Lectures section]].&lt;br /&gt;
&lt;br /&gt;
The tutorial is split in different sections. In the first part we will deal with Hartree-Fock (HF) and the Coulomb-hole and screened-exchange (COHSEX) approximation. Finally in the last section we will discuss dynamical correlation with a Plasmon Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
= The material: Silicon =&lt;br /&gt;
&lt;br /&gt;
* [http://cst-www.nrl.navy.mil/lattice/struk/a1.html FCC] lattice&lt;br /&gt;
* Two atoms per cell (8 electrons)&lt;br /&gt;
* Lattice constant 10.183 [a.u.]&lt;br /&gt;
* Plane waves cutoff 15 Rydberg&lt;br /&gt;
&lt;br /&gt;
===Band gap===&lt;br /&gt;
&lt;br /&gt;
*Direct gap   3.4 eV at Gamma&lt;br /&gt;
*Indirect gap 1.1 eV betweeb Gamma and X&#039;&lt;br /&gt;
*Gamma= (0 0 0)&lt;br /&gt;
*X&#039; is a point close to X=(0 1 0)&lt;br /&gt;
&lt;br /&gt;
[[File:si_banddiagram.gif|thumb|x400px|Silicon Band Structure]]&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;Silicon.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= The Tutorial structure =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the tutorial archive file is unzipped the following folder structure will appear&lt;br /&gt;
&lt;br /&gt;
 COPYING  README  Silicon/&lt;br /&gt;
&lt;br /&gt;
with the Solid_Si folder containing&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls Silicon/ &lt;br /&gt;
 PWSCF/  YAMBO/&lt;br /&gt;
&lt;br /&gt;
In the Pwscf folder  the student will find an input/output directory with input/output files for pw.x. The Silicon pseudopotential file is also provided.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls PWSCF/&lt;br /&gt;
 convergence_scripts  input  output  psps&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;convergence_scripts&amp;lt;/code&amp;gt; you will find some useful shell scripts to run the ground state convergence runs for Silicon.&lt;br /&gt;
&lt;br /&gt;
The YAMBO folder contains the Yambo input/output files and core databases.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls YAMBO/&lt;br /&gt;
 2x2x2/  4x4x4/  6x6x6/  8x8x8/  Convergence_Plots_and_Scripts/  GAMMA/&lt;br /&gt;
&lt;br /&gt;
The core databases are provided for several k-points grids. In addition the folder &amp;lt;code&amp;gt;Convergence_Plots_and_Scripts&amp;lt;/code&amp;gt; contains some scripts to extract informations from the report files useful for the tutorial.&lt;br /&gt;
&lt;br /&gt;
= Hartree-Fock =&lt;br /&gt;
&lt;br /&gt;
Now we will study the convergence of the [http://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method Hartree-Fock] self energy, respect to the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors and &#039;&#039;&#039;k&#039;&#039;&#039;-points. Yambo is a plane-wave code, therefore all the operators and wave-functions are expanded as:&lt;br /&gt;
&lt;br /&gt;
[[File:orbital.png|Orbital in plane wave]]&lt;br /&gt;
&lt;br /&gt;
Before you start any calculations we can decide how many &#039;&#039;&#039;G&#039;&#039;&#039;-vectors you want use to represent your wave-function. By default Yambo will use all of them, and for the present tutorial this is fine, however if you are studying larger systems you would like to reduce them in order to speed-up calculations, you can do it with &amp;lt;code&amp;gt; yambo -i -V RL&amp;lt;/code&amp;gt; and then changing the variable &amp;lt;code&amp;gt;MaxGvecs&amp;lt;/code&amp;gt; that referees to N&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt; in the previous formula.&lt;br /&gt;
&lt;br /&gt;
Now we will proceed in the calculation of the [[Hartree-Fock|Hartree-Fock]] exchange. This is composed of two terms, that Hartree and the Fock (or exchange) one:&lt;br /&gt;
&lt;br /&gt;
[[File:hf.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will calculate only the first order correction to the Kohn-Sham Hamiltonian due to the exchange term. Because of we are working in periodic system, the most appropriate basis to represent the Coulomb potential, appearing in the Fock term, is a plane-wave basis:&lt;br /&gt;
&lt;br /&gt;
[[File:v_q_plus_G.png|Coulomb potential in plane wave]]&lt;br /&gt;
&lt;br /&gt;
In order to generate the input file for the exchange type &amp;lt;code&amp;gt;yambo -x&amp;lt;/code&amp;gt;. The variable that governs the number of &#039;&#039;&#039;G&#039;&#039;&#039; vectors N&amp;lt;sub&amp;gt;ex&amp;lt;/sub&amp;gt; in the Coulomb potential is &amp;lt;code&amp;gt;EXXRLvcs&amp;lt;/code&amp;gt;. In addition notice that in the previous formula for V(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) we have an integral on the &#039;&#039;&#039;q&#039;&#039;&#039; vector, that in the code is discretized on a regular &#039;&#039;&#039;q&#039;&#039;&#039;-grid generated from the &#039;&#039;&#039;k&#039;&#039;&#039;-point one, &#039;&#039;&#039;q&#039;&#039;&#039;=&#039;&#039;&#039;k&#039;&#039;&#039;-&#039;&#039;&#039;k&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== G-vectors convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd 4x4x4&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;code&amp;gt;01HF_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;EXXRLvcs=&amp;lt;/code&amp;gt;3,6,7 and 15 Ry. For each case run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/01HF_corrections -J HF_???Ry&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15&lt;br /&gt;
&lt;br /&gt;
Now plot the HF corrections by using the [[Gnuplot_scripts|hf_vs_cutoff.gnuplot]] script. Launch it via&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 gnuplot&amp;gt;load &amp;quot;hf_vs_cutoff.gnuplot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:HF_parameters.png|Hartree-Fock corrections versus energy cutoff]]&lt;br /&gt;
&lt;br /&gt;
== K-points convergence==&lt;br /&gt;
&lt;br /&gt;
Enter each grid folder (&amp;lt;code&amp;gt;GAMMA,2x2x2,4x4x4,...&amp;lt;/code&amp;gt;) and run &lt;br /&gt;
 &amp;gt; yambo&lt;br /&gt;
without options. Then type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -x -F Inputs/01HF_corrections -J 01HF_corrections&lt;br /&gt;
&lt;br /&gt;
and edit the 01HF_corrections file&lt;br /&gt;
&lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 EXXRLvcs= 15           Ry    # [XX] Exchange RL components &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices   &lt;br /&gt;
 1|  8|  1| 15| &lt;br /&gt;
 % &lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices  &lt;br /&gt;
  1|  8| 0.0|-1.0| &lt;br /&gt;
 % &lt;br /&gt;
&lt;br /&gt;
setting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; EXXRLvcs=15 Ry&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run in each k-point folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &amp;gt; yambo -F Inputs/01HF_corrections -J 01HF_corrections&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after each run Yambo produces three output file, one starting with &amp;lt;code&amp;gt;r_...&amp;lt;/code&amp;gt; , another with &amp;lt;code&amp;gt;l_...&amp;lt;/code&amp;gt; and a third one starting with &amp;lt;code&amp;gt;o_...&amp;lt;/code&amp;gt;. The first one is a &#039;&#039;report&#039;&#039; of the actual calculation with all the details of the system, input, and results, while the second is a &#039;&#039;log&#039;&#039; with the running time of each process.&lt;br /&gt;
&lt;br /&gt;
The file we are most interested in is the output file, &amp;lt;code&amp;gt;o-01HF_corrections.hf&amp;lt;/code&amp;gt;. This file contains several columns. The fourth, labelled with &amp;lt;code&amp;gt;Ehf&amp;lt;/code&amp;gt; represents the Hartree-Fock energy. This is the quantity we have to look at.&lt;br /&gt;
&lt;br /&gt;
Use the [[Bash_scripts|parse_gap_hf.sh]] to parse the output files and adapt the gnuplot script provided earlier to print the values by using gnuplot&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd ../&lt;br /&gt;
 &amp;gt; ./parse_gap.sh o-01HF_corrections.hf hf_direct_gap_vs_kpoints.dat&lt;br /&gt;
&lt;br /&gt;
[[File:Hf gap vs kpts.png|Direct gap vs k-points]]&lt;br /&gt;
&lt;br /&gt;
= COHSEX without empty bands =&lt;br /&gt;
&lt;br /&gt;
The Hartree-Fock self-energy just described in the previous section, although successful on some molecular systems, miserably fails in extended systems. The reason of this failure lies in the fact that electrons can screen the Coulomb potential, and therefore one electron feels a screened potential instead of the bare one. A common approximation for this screened potential is the so-called Random Phase Approximation:&lt;br /&gt;
&lt;br /&gt;
[[File:gw.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
where the bare Coulomb potential V(&#039;&#039;&#039;r&#039;&#039;&#039;) is replaced by a non-local and frequency dependent one W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,ω). Subsequently it is possible to redefine all the perturbation theory in term of this screened potential, and disregarding the additional corrections coming from the vertex part, one obtains the so-called [[GW|GW]] approximation.&lt;br /&gt;
&lt;br /&gt;
However the substantial complexity associated with calculating the non-local, energy dependent Σ=GW operator inspired early efforts to find simplifying approximations as the static COHSEX approximation prosed by Hedin&amp;lt;ref name=&amp;quot;hedin&amp;quot;/&amp;gt;. The Coulomb Hole plus Screened Exchange (COHSEX) approximation[[[#march|2]],[[#fardi|3]]] eliminates the summation over empty states for the self energy operator and has the added benefit of being a static operator, a particular simplification for self consistent calculations. With the COHSEX approximation the self-energy is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
[[File:gw_sex.png|Screened Exchange]]&lt;br /&gt;
&lt;br /&gt;
[[File:gw_coh.png|Cuolomb Hole]]&lt;br /&gt;
&lt;br /&gt;
where W&amp;lt;sub&amp;gt;p&amp;lt;/sub&amp;gt;=W - V.&lt;br /&gt;
&lt;br /&gt;
In order to calculate the COHSEX self-energy with yambo you need first the static screened interaction &amp;lt;code&amp;gt;yambo -X s -k hartree&amp;lt;/code&amp;gt;. As for the V(&#039;&#039;&#039;r&#039;&#039;&#039;) case, also W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,E=0) will depend from the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors, and the &#039;&#039;&#039;k&#039;&#039;&#039;-grid, but this time also the number of conduction bands &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt; will enter in the screening calculation through the polarization function, see [http://www.yambo-code.org/theory/docs/doc_Xd.php The Interacting response function: Many-Body and TDDFT] section. Notice however that there are not any additional dependence of the self-energy operator from the conduction bands. After you obtained the screened interaction you are ready to build the self-energy operator and solve the corresponding Dyson equation, have a look to the [[GW|Dyson Equation solvers]] in Yambo. In order to get the quasi-particle energies, just do &amp;lt;code&amp;gt;yambo -X s -g n -k hartree&amp;lt;/code&amp;gt;. After calculation are completed Yambo will produce an output file &amp;lt;code&amp;gt;o.qp&amp;lt;/code&amp;gt; which contains the values of the bare and re-normalized energy levels.&lt;br /&gt;
&lt;br /&gt;
== K-points convergence ==&lt;br /&gt;
&lt;br /&gt;
Follow the same strategy of the HF case. Enter each k-point folder and type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -X s -k hartree -g n -p c -F Inputs/02Cohsex&lt;br /&gt;
&lt;br /&gt;
edit the input file and change the values of the fields&lt;br /&gt;
&lt;br /&gt;
 EXXRLvcs=7 Ry &lt;br /&gt;
 %BndsRnXs   &lt;br /&gt;
  1 | 10  |                   # [Xs] Polarization function bands &lt;br /&gt;
 %&lt;br /&gt;
 NGsBlkXs= 1            RL    # [Xs] Response block size &lt;br /&gt;
 #UseEbands                   # [GW] Force COHSEX to use empty bands &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
 1|  8|  1| 10| &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
leaving the other parameters unchanged. Now, in each k-point folder, run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X0Ry-nb10&lt;br /&gt;
&lt;br /&gt;
Adapt the shell script provided earlier to plot the direct gap dependence on the k-points grid&lt;br /&gt;
&lt;br /&gt;
[[File:Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints.png]]&lt;br /&gt;
&lt;br /&gt;
== W size convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder and edit the &amp;lt;code&amp;gt;02Cohsex_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;NGsBlkXs=&amp;lt;/code&amp;gt;3,6,7 Ry. Run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X???Ry-nb10 &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_size.png]]&lt;br /&gt;
&lt;br /&gt;
== W bands ==&lt;br /&gt;
&lt;br /&gt;
Open your input file and change only the input variable &amp;lt;code&amp;gt;NGsBlkXs=1 Ry&amp;lt;/code&amp;gt;. Then change&lt;br /&gt;
&lt;br /&gt;
 %BndsRnXs   1 | 20  |        # [Xs] Polarization function bands&lt;br /&gt;
&lt;br /&gt;
and run &amp;lt;code&amp;gt;yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X1Ry-nb20&amp;lt;/code&amp;gt;. &lt;br /&gt;
Repeat the calculations using 30 and 40 bands changing &amp;lt;code&amp;gt;nb???&amp;lt;/code&amp;gt; in the job string identifier. Finally check how the Chosex Direct and Indirect band gap behave as a function of the number of bands in the screening.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_bands.png]]&lt;br /&gt;
&lt;br /&gt;
== COHSEX with empty bands ==&lt;br /&gt;
&lt;br /&gt;
While the Screened Exchange(SEX) part of the COHSEX self-energy has a structure similar to the Hartree-Fock exchange term, the Coulomb Hole(COH) acts as static external potential on the electrons. In the COH part the delta function δ(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) comes from the completeness relation:&lt;br /&gt;
&lt;br /&gt;
[[File:completeness.png|Completeness relation]]&lt;br /&gt;
&lt;br /&gt;
Now we avoid the use of this relation in such a way to have a self-energy that depends from the conduction bands too. This can be done uncommenting flags &amp;lt;code&amp;gt;UseEbands&amp;lt;/code&amp;gt; and setting the number of bands in the Green&#039;s function: &lt;br /&gt;
&lt;br /&gt;
 % GbndRnge   1 | 10 |                   # [GW] G[W] bands range&lt;br /&gt;
&lt;br /&gt;
Repeat the previous calculations with different &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt; for instance, 10 20 30 40, and check how the COHSEX direct and indirect band gap behave as a function of the number of bands in the Green&#039;s function.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_empties_G_bands.png]]&lt;br /&gt;
&lt;br /&gt;
= GW within the plasmon pole approximation (PPA) =&lt;br /&gt;
&lt;br /&gt;
Even the static COHSEX approximation is very appealing, it was clear from the first calculation that dynamical effects cannot be disregarded in solids. This fact motivated the research for approximated way to deal with a frequency dependent interaction, and one of the first proposal was the so-called Plasmon-Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
Now we will proceed to the calculation of the silicon band gap in G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; within PPA. In each section you will be asked to perform several calculations varying the value of the relevant variables involved. More specifically let&#039;s consider a typical Yambo input file to calculate GW corrections in the PPA.&lt;br /&gt;
&lt;br /&gt;
 gw0                          # [R GW] GoWo Quasiparticle energy levels &lt;br /&gt;
 ppa                          # [R Xp] Plasmon Pole Approximation &lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 em1d                         # [R Xd] Dynamical Inverse Dielectric Matrix&lt;br /&gt;
 EXXRLvcs= 7            Ry    # [XX] Exchange RL components &lt;br /&gt;
 % QpntsRXp &lt;br /&gt;
   1 |  8 |                   # [Xp] Transferred momenta&lt;br /&gt;
 %&lt;br /&gt;
 % BndsRnXp  &lt;br /&gt;
  1 | 10 |                 # [Xp] Polarization function bands&lt;br /&gt;
 % &lt;br /&gt;
 NGsBlkXp= 1            RL    # [Xp] Response block size&lt;br /&gt;
 % LongDrXp &lt;br /&gt;
  1.000000 | 0.000000 | 0.000000 |        # [Xp] [cc] Electric Field&lt;br /&gt;
 % &lt;br /&gt;
 PPAPntXp= 27.21138     eV    # [Xp] PPA imaginary energy&lt;br /&gt;
 % GbndRnge  &lt;br /&gt;
  1 |  10 |                 # [GW] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 GDamping=  0.10000     eV    # [GW] G[W] damping&lt;br /&gt;
 dScStep=  0.10000      eV    # [GW] Energy step to evalute Z factors&lt;br /&gt;
 DysSolver= n               # [GW] Dyson Equation solver (`n`,`s`,`g`)&lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
  1|  8|  1| 10|&lt;br /&gt;
 %&lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices &lt;br /&gt;
  1|  8| 0.0|-1.0|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
The variables are the same of the COHSEX case plus a new one &amp;lt;code&amp;gt;PPAPntXp&amp;lt;/code&amp;gt; that describes the imaginary energy used to fit the Plasmon Pole model.&amp;lt;br /&amp;gt;&lt;br /&gt;
Follow the same strategy of the COHSEX case. Enter each k-point folder and type:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -d -k hartree -g n -p p -F Inputs/03GoWo_PPA_corrections&lt;br /&gt;
&lt;br /&gt;
otherwise you can use the existent file &amp;lt;code&amp;gt;Input/03GoWo_PPA_corrections&amp;lt;/code&amp;gt;. Now you have to study the convergence of the G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; gap versus the number of k-points, the number of bands in χ &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt;, the size of the dielectric constant &amp;lt;code&amp;gt;NGsBlkXs&amp;lt;/code&amp;gt; and the number of bands in the Green&#039;s function &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please follow the same strategy of the COHSEX case running yambo using&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/03GoWo_PPA_corrections -J GoWo_PPA_HF7Ry_X???Ry-nb???_nb???&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final convergence plots should look like these (the plots are done using as a basis the above code).&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W size.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA G bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA gap vs kpts.png]]&lt;br /&gt;
&lt;br /&gt;
Final runs!! Now you know how to converge a G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; calculation so you can decide which are the parameters needed for full convergence. First do a COHSEX and then a GoWo (PPA) run at convergence, and you should obtain results similar to the following graph:&lt;br /&gt;
&lt;br /&gt;
[[File:Si_gap.png|Final Gap Silicon]]&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;gw&amp;quot;&amp;gt;H. N. Rojas, R. W. Godby, and R. J. Needs, Phys. Rev. Lett. &#039;&#039;&#039;74&#039;&#039;&#039;, 1827 (1995)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;hedin&amp;quot;&amp;gt; L. Hedin, Phys. Rev. &#039;&#039;&#039;139&#039;&#039;&#039;, A796 (1965)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5285</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5285"/>
		<updated>2022-02-08T12:36:51Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* K-points convergence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Basic concepts of the GW approximation =&lt;br /&gt;
&lt;br /&gt;
[[File:GW0.png|x300px|center|]] &lt;br /&gt;
&lt;br /&gt;
In this tutorial you will learn the basic concepts of the [[Hartree-Fock]] and of the GW&amp;lt;ref name=&amp;quot;gw&amp;quot;/&amp;gt; approximation. In particular we will illustrate how to calculate [http://en.wikipedia.org/wiki/Quasiparticle Quasi-Particle] energies with a single shot G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; approximation. Different lecture notes on the GW approach are available in the [[Lectures|Lectures section]].&lt;br /&gt;
&lt;br /&gt;
The tutorial is split in different sections. In the first part we will deal with Hartree-Fock (HF) and the Coulomb-hole and screened-exchange (COHSEX) approximation. Finally in the last section we will discuss dynamical correlation with a Plasmon Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
= The material: Silicon =&lt;br /&gt;
&lt;br /&gt;
* [http://cst-www.nrl.navy.mil/lattice/struk/a1.html FCC] lattice&lt;br /&gt;
* Two atoms per cell (8 electrons)&lt;br /&gt;
* Lattice constant 10.183 [a.u.]&lt;br /&gt;
* Plane waves cutoff 15 Rydberg&lt;br /&gt;
&lt;br /&gt;
===Band gap===&lt;br /&gt;
&lt;br /&gt;
*Direct gap   3.4 eV at Gamma&lt;br /&gt;
*Indirect gap 1.1 eV betweeb Gamma and X&#039;&lt;br /&gt;
*Gamma= (0 0 0)&lt;br /&gt;
*X&#039; is a point close to X=(0 1 0)&lt;br /&gt;
&lt;br /&gt;
[[File:si_banddiagram.gif|thumb|x400px|Silicon Band Structure]]&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;Silicon.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= The Tutorial structure =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the tutorial archive file is unzipped the following folder structure will appear&lt;br /&gt;
&lt;br /&gt;
 COPYING  README  Silicon/&lt;br /&gt;
&lt;br /&gt;
with the Solid_Si folder containing&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls Silicon/ &lt;br /&gt;
 PWSCF/  YAMBO/&lt;br /&gt;
&lt;br /&gt;
In the Pwscf folder  the student will find an input/output directory with input/output files for pw.x. The Silicon pseudopotential file is also provided.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls PWSCF/&lt;br /&gt;
 convergence_scripts  input  output  psps&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;convergence_scripts&amp;lt;/code&amp;gt; you will find some useful shell scripts to run the ground state convergence runs for Silicon.&lt;br /&gt;
&lt;br /&gt;
The YAMBO folder contains the Yambo input/output files and core databases.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls YAMBO/&lt;br /&gt;
 2x2x2/  4x4x4/  6x6x6/  8x8x8/  Convergence_Plots_and_Scripts/  GAMMA/&lt;br /&gt;
&lt;br /&gt;
The core databases are provided for several k-points grids. In addition the folder &amp;lt;code&amp;gt;Convergence_Plots_and_Scripts&amp;lt;/code&amp;gt; contains some scripts to extract informations from the report files useful for the tutorial.&lt;br /&gt;
&lt;br /&gt;
= Hartree-Fock =&lt;br /&gt;
&lt;br /&gt;
Now we will study the convergence of the [http://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method Hartree-Fock] self energy, respect to the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors and &#039;&#039;&#039;k&#039;&#039;&#039;-points. Yambo is a plane-wave code, therefore all the operators and wave-functions are expanded as:&lt;br /&gt;
&lt;br /&gt;
[[File:orbital.png|Orbital in plane wave]]&lt;br /&gt;
&lt;br /&gt;
Before you start any calculations we can decide how many &#039;&#039;&#039;G&#039;&#039;&#039;-vectors you want use to represent your wave-function. By default Yambo will use all of them, and for the present tutorial this is fine, however if you are studying larger systems you would like to reduce them in order to speed-up calculations, you can do it with &amp;lt;code&amp;gt; yambo -i -V RL&amp;lt;/code&amp;gt; and then changing the variable &amp;lt;code&amp;gt;MaxGvecs&amp;lt;/code&amp;gt; that referees to N&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt; in the previous formula.&lt;br /&gt;
&lt;br /&gt;
Now we will proceed in the calculation of the [[Hartree-Fock|Hartree-Fock]] exchange. This is composed of two terms, that Hartree and the Fock (or exchange) one:&lt;br /&gt;
&lt;br /&gt;
[[File:hf.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will calculate only the first order correction to the Kohn-Sham Hamiltonian due to the exchange term. Because of we are working in periodic system, the most appropriate basis to represent the Coulomb potential, appearing in the Fock term, is a plane-wave basis:&lt;br /&gt;
&lt;br /&gt;
[[File:v_q_plus_G.png|Coulomb potential in plane wave]]&lt;br /&gt;
&lt;br /&gt;
In order to generate the input file for the exchange type &amp;lt;code&amp;gt;yambo -x&amp;lt;/code&amp;gt;. The variable that governs the number of &#039;&#039;&#039;G&#039;&#039;&#039; vectors N&amp;lt;sub&amp;gt;ex&amp;lt;/sub&amp;gt; in the Coulomb potential is &amp;lt;code&amp;gt;EXXRLvcs&amp;lt;/code&amp;gt;. In addition notice that in the previous formula for V(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) we have an integral on the &#039;&#039;&#039;q&#039;&#039;&#039; vector, that in the code is discretized on a regular &#039;&#039;&#039;q&#039;&#039;&#039;-grid generated from the &#039;&#039;&#039;k&#039;&#039;&#039;-point one, &#039;&#039;&#039;q&#039;&#039;&#039;=&#039;&#039;&#039;k&#039;&#039;&#039;-&#039;&#039;&#039;k&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== G-vectors convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd 4x4x4&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;code&amp;gt;01HF_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;EXXRLvcs=&amp;lt;/code&amp;gt;3,6,7 and 15 Ry. For each case run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/01HF_corrections -J HF_???Ry&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15&lt;br /&gt;
&lt;br /&gt;
Now plot the HF corrections by using the [[Gnuplot_scripts|hf_vs_cutoff.gnuplot]] script. Launch it via&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 gnuplot&amp;gt;load &amp;quot;hf_vs_cutoff.gnuplot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:HF_parameters.png|Hartree-Fock corrections versus energy cutoff]]&lt;br /&gt;
&lt;br /&gt;
== K-points convergence==&lt;br /&gt;
&lt;br /&gt;
Enter each grid folder (&amp;lt;code&amp;gt;GAMMA,2x2x2,4x4x4,...&amp;lt;/code&amp;gt;) and run &lt;br /&gt;
 &amp;gt; yambo&lt;br /&gt;
without options. Then type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -x -F Inputs/01HF_corrections -J 01HF_corrections&lt;br /&gt;
&lt;br /&gt;
and edit the 01HF_corrections file&lt;br /&gt;
&lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 EXXRLvcs= 15           Ry    # [XX] Exchange RL components &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices   &lt;br /&gt;
 1|  8|  1| 15| &lt;br /&gt;
 % &lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices  &lt;br /&gt;
  1|  8| 0.0|-1.0| &lt;br /&gt;
 % &lt;br /&gt;
&lt;br /&gt;
setting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; EXXRLvcs=15 Ry&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run in each k-point folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &amp;gt; yambo -F Inputs/01HF_corrections -J 01HF_corrections&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after each run Yambo produces three output file, one starting with &amp;lt;code&amp;gt;r_...&amp;lt;/code&amp;gt; , another with &amp;lt;code&amp;gt;l_...&amp;lt;/code&amp;gt; and a third one starting with &amp;lt;code&amp;gt;o_...&amp;lt;/code&amp;gt;. The first one is a &#039;&#039;report&#039;&#039; of the actual calculation with all the details of the system, input, and results, while the second is a &#039;&#039;log&#039;&#039; with the running time of each process.&lt;br /&gt;
&lt;br /&gt;
The file we are most interested in is the output file, &amp;lt;code&amp;gt;o-01HF_corrections.hf&amp;lt;/code&amp;gt;. This file contains several columns. The fourth, labelled with &amp;lt;code&amp;gt;Ehf&amp;lt;/code&amp;gt; represents the Hartree-Fock energy. This is the quantity we have to look at.&lt;br /&gt;
&lt;br /&gt;
Use the [[Bash_scripts|parse_gap_hf.sh]] to parse the output files and adapt the gnuplot script provided earlier to print the values by using gnuplot&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd ../&lt;br /&gt;
 &amp;gt; ./parse_gap.sh o-01HF_corrections.hf hf_direct_gap_vs_kpoints.dat&lt;br /&gt;
&lt;br /&gt;
[[File:Hf gap vs kpts.png|Direct gap vs k-points]]&lt;br /&gt;
&lt;br /&gt;
= COHSEX without empty bands =&lt;br /&gt;
&lt;br /&gt;
The Hartree-Fock self-energy just described in the previous section, although successful on some molecular systems, miserably fails in extended systems. The reason of this failure lies in the fact that electrons can screen the Coulomb potential, and therefore one electron feels a screened potential instead of the bare one. A common approximation for this screened potential is the so-called Random Phase Approximation:&lt;br /&gt;
&lt;br /&gt;
[[File:gw.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
where the bare Coulomb potential V(&#039;&#039;&#039;r&#039;&#039;&#039;) is replaced by a non-local and frequency dependent one W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,ω). Subsequently it is possible to redefine all the perturbation theory in term of this screened potential, and disregarding the additional corrections coming from the vertex part, one obtains the so-called [[GW|GW]] approximation.&lt;br /&gt;
&lt;br /&gt;
However the substantial complexity associated with calculating the non-local, energy dependent Σ=GW operator inspired early efforts to find simplifying approximations as the static COHSEX approximation prosed by Hedin&amp;lt;ref name=&amp;quot;hedin&amp;quot;/&amp;gt;. The Coulomb Hole plus Screened Exchange (COHSEX) approximation[[[#march|2]],[[#fardi|3]]] eliminates the summation over empty states for the self energy operator and has the added benefit of being a static operator, a particular simplification for self consistent calculations. With the COHSEX approximation the self-energy is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
[[File:gw_sex.png|Screened Exchange]]&lt;br /&gt;
&lt;br /&gt;
[[File:gw_coh.png|Cuolomb Hole]]&lt;br /&gt;
&lt;br /&gt;
where W&amp;lt;sub&amp;gt;p&amp;lt;/sub&amp;gt;=W - V.&lt;br /&gt;
&lt;br /&gt;
In order to calculate the COHSEX self-energy with yambo you need first the static screened interaction &amp;lt;code&amp;gt;yambo -X s -k hartree&amp;lt;/code&amp;gt;. As for the V(&#039;&#039;&#039;r&#039;&#039;&#039;) case, also W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,E=0) will depend from the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors, and the &#039;&#039;&#039;k&#039;&#039;&#039;-grid, but this time also the number of conduction bands &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt; will enter in the screening calculation through the polarization function, see [http://www.yambo-code.org/theory/docs/doc_Xd.php The Interacting response function: Many-Body and TDDFT] section. Notice however that there are not any additional dependence of the self-energy operator from the conduction bands. After you obtained the screened interaction you are ready to build the self-energy operator and solve the corresponding Dyson equation, have a look to the [[GW|Dyson Equation solvers]] in Yambo. In order to get the quasi-particle energies, just do &amp;lt;code&amp;gt;yambo -b -g n -k hartree&amp;lt;/code&amp;gt;. After calculation are completed Yambo will produce an output file &amp;lt;code&amp;gt;o.qp&amp;lt;/code&amp;gt; which contains the values of the bare and re-normalized energy levels.&lt;br /&gt;
&lt;br /&gt;
== K-points convergence ==&lt;br /&gt;
&lt;br /&gt;
Follow the same strategy of the HF case. Enter each k-point folder and type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -b -k hartree -g n -p c -F Inputs/02Cohsex&lt;br /&gt;
&lt;br /&gt;
edit the input file and change the values of the fields&lt;br /&gt;
&lt;br /&gt;
 EXXRLvcs=7 Ry &lt;br /&gt;
 %BndsRnXs   &lt;br /&gt;
  1 | 10  |                   # [Xs] Polarization function bands &lt;br /&gt;
 %&lt;br /&gt;
 NGsBlkXs= 1            RL    # [Xs] Response block size &lt;br /&gt;
 #UseEbands                   # [GW] Force COHSEX to use empty bands &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
 1|  8|  1| 10| &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
leaving the other parameters unchanged. Now, in each k-point folder, run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X0Ry-nb10&lt;br /&gt;
&lt;br /&gt;
Adapt the shell script provided earlier to plot the direct gap dependence on the k-points grid&lt;br /&gt;
&lt;br /&gt;
[[File:Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints.png]]&lt;br /&gt;
&lt;br /&gt;
== W size convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder and edit the &amp;lt;code&amp;gt;02Cohsex_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;NGsBlkXs=&amp;lt;/code&amp;gt;3,6,7 Ry. Run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X???Ry-nb10 &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_size.png]]&lt;br /&gt;
&lt;br /&gt;
== W bands ==&lt;br /&gt;
&lt;br /&gt;
Open your input file and change only the input variable &amp;lt;code&amp;gt;NGsBlkXs=1 Ry&amp;lt;/code&amp;gt;. Then change&lt;br /&gt;
&lt;br /&gt;
 %BndsRnXs   1 | 20  |        # [Xs] Polarization function bands&lt;br /&gt;
&lt;br /&gt;
and run &amp;lt;code&amp;gt;yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X1Ry-nb20&amp;lt;/code&amp;gt;. &lt;br /&gt;
Repeat the calculations using 30 and 40 bands changing &amp;lt;code&amp;gt;nb???&amp;lt;/code&amp;gt; in the job string identifier. Finally check how the Chosex Direct and Indirect band gap behave as a function of the number of bands in the screening.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_bands.png]]&lt;br /&gt;
&lt;br /&gt;
== COHSEX with empty bands ==&lt;br /&gt;
&lt;br /&gt;
While the Screened Exchange(SEX) part of the COHSEX self-energy has a structure similar to the Hartree-Fock exchange term, the Coulomb Hole(COH) acts as static external potential on the electrons. In the COH part the delta function δ(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) comes from the completeness relation:&lt;br /&gt;
&lt;br /&gt;
[[File:completeness.png|Completeness relation]]&lt;br /&gt;
&lt;br /&gt;
Now we avoid the use of this relation in such a way to have a self-energy that depends from the conduction bands too. This can be done uncommenting flags &amp;lt;code&amp;gt;UseEbands&amp;lt;/code&amp;gt; and setting the number of bands in the Green&#039;s function: &lt;br /&gt;
&lt;br /&gt;
 % GbndRnge   1 | 10 |                   # [GW] G[W] bands range&lt;br /&gt;
&lt;br /&gt;
Repeat the previous calculations with different &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt; for instance, 10 20 30 40, and check how the COHSEX direct and indirect band gap behave as a function of the number of bands in the Green&#039;s function.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_empties_G_bands.png]]&lt;br /&gt;
&lt;br /&gt;
= GW within the plasmon pole approximation (PPA) =&lt;br /&gt;
&lt;br /&gt;
Even the static COHSEX approximation is very appealing, it was clear from the first calculation that dynamical effects cannot be disregarded in solids. This fact motivated the research for approximated way to deal with a frequency dependent interaction, and one of the first proposal was the so-called Plasmon-Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
Now we will proceed to the calculation of the silicon band gap in G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; within PPA. In each section you will be asked to perform several calculations varying the value of the relevant variables involved. More specifically let&#039;s consider a typical Yambo input file to calculate GW corrections in the PPA.&lt;br /&gt;
&lt;br /&gt;
 gw0                          # [R GW] GoWo Quasiparticle energy levels &lt;br /&gt;
 ppa                          # [R Xp] Plasmon Pole Approximation &lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 em1d                         # [R Xd] Dynamical Inverse Dielectric Matrix&lt;br /&gt;
 EXXRLvcs= 7            Ry    # [XX] Exchange RL components &lt;br /&gt;
 % QpntsRXp &lt;br /&gt;
   1 |  8 |                   # [Xp] Transferred momenta&lt;br /&gt;
 %&lt;br /&gt;
 % BndsRnXp  &lt;br /&gt;
  1 | 10 |                 # [Xp] Polarization function bands&lt;br /&gt;
 % &lt;br /&gt;
 NGsBlkXp= 1            RL    # [Xp] Response block size&lt;br /&gt;
 % LongDrXp &lt;br /&gt;
  1.000000 | 0.000000 | 0.000000 |        # [Xp] [cc] Electric Field&lt;br /&gt;
 % &lt;br /&gt;
 PPAPntXp= 27.21138     eV    # [Xp] PPA imaginary energy&lt;br /&gt;
 % GbndRnge  &lt;br /&gt;
  1 |  10 |                 # [GW] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 GDamping=  0.10000     eV    # [GW] G[W] damping&lt;br /&gt;
 dScStep=  0.10000      eV    # [GW] Energy step to evalute Z factors&lt;br /&gt;
 DysSolver= n               # [GW] Dyson Equation solver (`n`,`s`,`g`)&lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
  1|  8|  1| 10|&lt;br /&gt;
 %&lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices &lt;br /&gt;
  1|  8| 0.0|-1.0|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
The variables are the same of the COHSEX case plus a new one &amp;lt;code&amp;gt;PPAPntXp&amp;lt;/code&amp;gt; that describes the imaginary energy used to fit the Plasmon Pole model.&amp;lt;br /&amp;gt;&lt;br /&gt;
Follow the same strategy of the COHSEX case. Enter each k-point folder and type:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -d -k hartree -g n -p p -F Inputs/03GoWo_PPA_corrections&lt;br /&gt;
&lt;br /&gt;
otherwise you can use the existent file &amp;lt;code&amp;gt;Input/03GoWo_PPA_corrections&amp;lt;/code&amp;gt;. Now you have to study the convergence of the G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; gap versus the number of k-points, the number of bands in χ &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt;, the size of the dielectric constant &amp;lt;code&amp;gt;NGsBlkXs&amp;lt;/code&amp;gt; and the number of bands in the Green&#039;s function &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please follow the same strategy of the COHSEX case running yambo using&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/03GoWo_PPA_corrections -J GoWo_PPA_HF7Ry_X???Ry-nb???_nb???&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final convergence plots should look like these (the plots are done using as a basis the above code).&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W size.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA G bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA gap vs kpts.png]]&lt;br /&gt;
&lt;br /&gt;
Final runs!! Now you know how to converge a G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; calculation so you can decide which are the parameters needed for full convergence. First do a COHSEX and then a GoWo (PPA) run at convergence, and you should obtain results similar to the following graph:&lt;br /&gt;
&lt;br /&gt;
[[File:Si_gap.png|Final Gap Silicon]]&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;gw&amp;quot;&amp;gt;H. N. Rojas, R. W. Godby, and R. J. Needs, Phys. Rev. Lett. &#039;&#039;&#039;74&#039;&#039;&#039;, 1827 (1995)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;hedin&amp;quot;&amp;gt; L. Hedin, Phys. Rev. &#039;&#039;&#039;139&#039;&#039;&#039;, A796 (1965)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5284</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5284"/>
		<updated>2022-02-08T12:36:11Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* K-points convergence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Basic concepts of the GW approximation =&lt;br /&gt;
&lt;br /&gt;
[[File:GW0.png|x300px|center|]] &lt;br /&gt;
&lt;br /&gt;
In this tutorial you will learn the basic concepts of the [[Hartree-Fock]] and of the GW&amp;lt;ref name=&amp;quot;gw&amp;quot;/&amp;gt; approximation. In particular we will illustrate how to calculate [http://en.wikipedia.org/wiki/Quasiparticle Quasi-Particle] energies with a single shot G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; approximation. Different lecture notes on the GW approach are available in the [[Lectures|Lectures section]].&lt;br /&gt;
&lt;br /&gt;
The tutorial is split in different sections. In the first part we will deal with Hartree-Fock (HF) and the Coulomb-hole and screened-exchange (COHSEX) approximation. Finally in the last section we will discuss dynamical correlation with a Plasmon Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
= The material: Silicon =&lt;br /&gt;
&lt;br /&gt;
* [http://cst-www.nrl.navy.mil/lattice/struk/a1.html FCC] lattice&lt;br /&gt;
* Two atoms per cell (8 electrons)&lt;br /&gt;
* Lattice constant 10.183 [a.u.]&lt;br /&gt;
* Plane waves cutoff 15 Rydberg&lt;br /&gt;
&lt;br /&gt;
===Band gap===&lt;br /&gt;
&lt;br /&gt;
*Direct gap   3.4 eV at Gamma&lt;br /&gt;
*Indirect gap 1.1 eV betweeb Gamma and X&#039;&lt;br /&gt;
*Gamma= (0 0 0)&lt;br /&gt;
*X&#039; is a point close to X=(0 1 0)&lt;br /&gt;
&lt;br /&gt;
[[File:si_banddiagram.gif|thumb|x400px|Silicon Band Structure]]&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;Silicon.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= The Tutorial structure =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the tutorial archive file is unzipped the following folder structure will appear&lt;br /&gt;
&lt;br /&gt;
 COPYING  README  Silicon/&lt;br /&gt;
&lt;br /&gt;
with the Solid_Si folder containing&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls Silicon/ &lt;br /&gt;
 PWSCF/  YAMBO/&lt;br /&gt;
&lt;br /&gt;
In the Pwscf folder  the student will find an input/output directory with input/output files for pw.x. The Silicon pseudopotential file is also provided.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls PWSCF/&lt;br /&gt;
 convergence_scripts  input  output  psps&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;convergence_scripts&amp;lt;/code&amp;gt; you will find some useful shell scripts to run the ground state convergence runs for Silicon.&lt;br /&gt;
&lt;br /&gt;
The YAMBO folder contains the Yambo input/output files and core databases.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls YAMBO/&lt;br /&gt;
 2x2x2/  4x4x4/  6x6x6/  8x8x8/  Convergence_Plots_and_Scripts/  GAMMA/&lt;br /&gt;
&lt;br /&gt;
The core databases are provided for several k-points grids. In addition the folder &amp;lt;code&amp;gt;Convergence_Plots_and_Scripts&amp;lt;/code&amp;gt; contains some scripts to extract informations from the report files useful for the tutorial.&lt;br /&gt;
&lt;br /&gt;
= Hartree-Fock =&lt;br /&gt;
&lt;br /&gt;
Now we will study the convergence of the [http://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method Hartree-Fock] self energy, respect to the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors and &#039;&#039;&#039;k&#039;&#039;&#039;-points. Yambo is a plane-wave code, therefore all the operators and wave-functions are expanded as:&lt;br /&gt;
&lt;br /&gt;
[[File:orbital.png|Orbital in plane wave]]&lt;br /&gt;
&lt;br /&gt;
Before you start any calculations we can decide how many &#039;&#039;&#039;G&#039;&#039;&#039;-vectors you want use to represent your wave-function. By default Yambo will use all of them, and for the present tutorial this is fine, however if you are studying larger systems you would like to reduce them in order to speed-up calculations, you can do it with &amp;lt;code&amp;gt; yambo -i -V RL&amp;lt;/code&amp;gt; and then changing the variable &amp;lt;code&amp;gt;MaxGvecs&amp;lt;/code&amp;gt; that referees to N&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt; in the previous formula.&lt;br /&gt;
&lt;br /&gt;
Now we will proceed in the calculation of the [[Hartree-Fock|Hartree-Fock]] exchange. This is composed of two terms, that Hartree and the Fock (or exchange) one:&lt;br /&gt;
&lt;br /&gt;
[[File:hf.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will calculate only the first order correction to the Kohn-Sham Hamiltonian due to the exchange term. Because of we are working in periodic system, the most appropriate basis to represent the Coulomb potential, appearing in the Fock term, is a plane-wave basis:&lt;br /&gt;
&lt;br /&gt;
[[File:v_q_plus_G.png|Coulomb potential in plane wave]]&lt;br /&gt;
&lt;br /&gt;
In order to generate the input file for the exchange type &amp;lt;code&amp;gt;yambo -x&amp;lt;/code&amp;gt;. The variable that governs the number of &#039;&#039;&#039;G&#039;&#039;&#039; vectors N&amp;lt;sub&amp;gt;ex&amp;lt;/sub&amp;gt; in the Coulomb potential is &amp;lt;code&amp;gt;EXXRLvcs&amp;lt;/code&amp;gt;. In addition notice that in the previous formula for V(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) we have an integral on the &#039;&#039;&#039;q&#039;&#039;&#039; vector, that in the code is discretized on a regular &#039;&#039;&#039;q&#039;&#039;&#039;-grid generated from the &#039;&#039;&#039;k&#039;&#039;&#039;-point one, &#039;&#039;&#039;q&#039;&#039;&#039;=&#039;&#039;&#039;k&#039;&#039;&#039;-&#039;&#039;&#039;k&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== G-vectors convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd 4x4x4&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;code&amp;gt;01HF_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;EXXRLvcs=&amp;lt;/code&amp;gt;3,6,7 and 15 Ry. For each case run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/01HF_corrections -J HF_???Ry&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15&lt;br /&gt;
&lt;br /&gt;
Now plot the HF corrections by using the [[Gnuplot_scripts|hf_vs_cutoff.gnuplot]] script. Launch it via&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 gnuplot&amp;gt;load &amp;quot;hf_vs_cutoff.gnuplot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:HF_parameters.png|Hartree-Fock corrections versus energy cutoff]]&lt;br /&gt;
&lt;br /&gt;
== K-points convergence==&lt;br /&gt;
&lt;br /&gt;
Enter each grid folder (&amp;lt;code&amp;gt;GAMMA,2x2x2,4x4x4,...&amp;lt;/code&amp;gt;) and run &lt;br /&gt;
 &amp;gt; yambo&lt;br /&gt;
without options. Then type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -x -F Inputs/01HF_corrections -J 01HF_corrections&lt;br /&gt;
&lt;br /&gt;
and edit the 01HF_corrections file&lt;br /&gt;
&lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 EXXRLvcs= 15           Ry    # [XX] Exchange RL components &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices   &lt;br /&gt;
 1|  8|  1| 15| &lt;br /&gt;
 % &lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices  &lt;br /&gt;
  1|  8| 0.0|-1.0| &lt;br /&gt;
 % &lt;br /&gt;
&lt;br /&gt;
setting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; EXXRLvcs=15 Ry&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run in each k-point folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &amp;gt; yambo -F Inputs/01HF_corrections -J 01HF_corrections&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after each run Yambo produces three output file, one starting with &amp;lt;code&amp;gt;r_...&amp;lt;/code&amp;gt; , another with &amp;lt;code&amp;gt;l_...&amp;lt;/code&amp;gt; and a third one starting with &amp;lt;code&amp;gt;o_...&amp;lt;/code&amp;gt;. The first one is a &#039;&#039;report&#039;&#039; of the actual calculation with all the details of the system, input, and results, while the second is a &#039;&#039;log&#039;&#039; with the running time of each process.&lt;br /&gt;
&lt;br /&gt;
The file we are most interested in is the output file, &amp;lt;code&amp;gt;o-01HF_corrections.hf&amp;lt;/code&amp;gt;. This file contains several columns. The fourth, labelled with &amp;lt;code&amp;gt;Ehf&amp;lt;/code&amp;gt; represents the Hartree-Fock energy. This is the quantity we have to look at.&lt;br /&gt;
&lt;br /&gt;
Use the [[Bash_scripts|parse_gap_hf.sh]] to parse the output files and adapt the gnuplot script provided earlier to print the values by using gnuplot&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd ../&lt;br /&gt;
 &amp;gt; ./parse_gap.sh o-01HF_corrections.hf hf_direct_gap_vs_kpoints.dat&lt;br /&gt;
&lt;br /&gt;
[[File:Hf gap vs kpts.png|Direct gap vs k-points]]&lt;br /&gt;
&lt;br /&gt;
= COHSEX without empty bands =&lt;br /&gt;
&lt;br /&gt;
The Hartree-Fock self-energy just described in the previous section, although successful on some molecular systems, miserably fails in extended systems. The reason of this failure lies in the fact that electrons can screen the Coulomb potential, and therefore one electron feels a screened potential instead of the bare one. A common approximation for this screened potential is the so-called Random Phase Approximation:&lt;br /&gt;
&lt;br /&gt;
[[File:gw.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
where the bare Coulomb potential V(&#039;&#039;&#039;r&#039;&#039;&#039;) is replaced by a non-local and frequency dependent one W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,ω). Subsequently it is possible to redefine all the perturbation theory in term of this screened potential, and disregarding the additional corrections coming from the vertex part, one obtains the so-called [[GW|GW]] approximation.&lt;br /&gt;
&lt;br /&gt;
However the substantial complexity associated with calculating the non-local, energy dependent Σ=GW operator inspired early efforts to find simplifying approximations as the static COHSEX approximation prosed by Hedin&amp;lt;ref name=&amp;quot;hedin&amp;quot;/&amp;gt;. The Coulomb Hole plus Screened Exchange (COHSEX) approximation[[[#march|2]],[[#fardi|3]]] eliminates the summation over empty states for the self energy operator and has the added benefit of being a static operator, a particular simplification for self consistent calculations. With the COHSEX approximation the self-energy is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
[[File:gw_sex.png|Screened Exchange]]&lt;br /&gt;
&lt;br /&gt;
[[File:gw_coh.png|Cuolomb Hole]]&lt;br /&gt;
&lt;br /&gt;
where W&amp;lt;sub&amp;gt;p&amp;lt;/sub&amp;gt;=W - V.&lt;br /&gt;
&lt;br /&gt;
In order to calculate the COHSEX self-energy with yambo you need first the static screened interaction &amp;lt;code&amp;gt;yambo -X s -k hartree&amp;lt;/code&amp;gt;. As for the V(&#039;&#039;&#039;r&#039;&#039;&#039;) case, also W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,E=0) will depend from the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors, and the &#039;&#039;&#039;k&#039;&#039;&#039;-grid, but this time also the number of conduction bands &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt; will enter in the screening calculation through the polarization function, see [http://www.yambo-code.org/theory/docs/doc_Xd.php The Interacting response function: Many-Body and TDDFT] section. Notice however that there are not any additional dependence of the self-energy operator from the conduction bands. After you obtained the screened interaction you are ready to build the self-energy operator and solve the corresponding Dyson equation, have a look to the [[GW|Dyson Equation solvers]] in Yambo. In order to get the quasi-particle energies, just do &amp;lt;code&amp;gt;yambo -b -g n -k hartree&amp;lt;/code&amp;gt;. After calculation are completed Yambo will produce an output file &amp;lt;code&amp;gt;o.qp&amp;lt;/code&amp;gt; which contains the values of the bare and re-normalized energy levels.&lt;br /&gt;
&lt;br /&gt;
== K-points convergence ==&lt;br /&gt;
&lt;br /&gt;
Follow the same strategy of the HF case. Enter each k-point folder and type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -b -k hartree -g n -p c -F Inputs/02Cohsex&lt;br /&gt;
&lt;br /&gt;
edit the input file and change the values of the fields&lt;br /&gt;
&lt;br /&gt;
 EXXRLvcs=7 Ry &lt;br /&gt;
%BndsRnXs   &lt;br /&gt;
  1 | 10  |                   # [Xs] Polarization function bands &lt;br /&gt;
%&lt;br /&gt;
 NGsBlkXs= 1            RL    # [Xs] Response block size &lt;br /&gt;
 #UseEbands                   # [GW] Force COHSEX to use empty bands &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
 1|  8|  1| 10| &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
leaving the other parameters unchanged. Now, in each k-point folder, run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X0Ry-nb10&lt;br /&gt;
&lt;br /&gt;
Adapt the shell script provided earlier to plot the direct gap dependence on the k-points grid&lt;br /&gt;
&lt;br /&gt;
[[File:Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints.png]]&lt;br /&gt;
&lt;br /&gt;
== W size convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder and edit the &amp;lt;code&amp;gt;02Cohsex_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;NGsBlkXs=&amp;lt;/code&amp;gt;3,6,7 Ry. Run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X???Ry-nb10 &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_size.png]]&lt;br /&gt;
&lt;br /&gt;
== W bands ==&lt;br /&gt;
&lt;br /&gt;
Open your input file and change only the input variable &amp;lt;code&amp;gt;NGsBlkXs=1 Ry&amp;lt;/code&amp;gt;. Then change&lt;br /&gt;
&lt;br /&gt;
 %BndsRnXs   1 | 20  |        # [Xs] Polarization function bands&lt;br /&gt;
&lt;br /&gt;
and run &amp;lt;code&amp;gt;yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X1Ry-nb20&amp;lt;/code&amp;gt;. &lt;br /&gt;
Repeat the calculations using 30 and 40 bands changing &amp;lt;code&amp;gt;nb???&amp;lt;/code&amp;gt; in the job string identifier. Finally check how the Chosex Direct and Indirect band gap behave as a function of the number of bands in the screening.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_bands.png]]&lt;br /&gt;
&lt;br /&gt;
== COHSEX with empty bands ==&lt;br /&gt;
&lt;br /&gt;
While the Screened Exchange(SEX) part of the COHSEX self-energy has a structure similar to the Hartree-Fock exchange term, the Coulomb Hole(COH) acts as static external potential on the electrons. In the COH part the delta function δ(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) comes from the completeness relation:&lt;br /&gt;
&lt;br /&gt;
[[File:completeness.png|Completeness relation]]&lt;br /&gt;
&lt;br /&gt;
Now we avoid the use of this relation in such a way to have a self-energy that depends from the conduction bands too. This can be done uncommenting flags &amp;lt;code&amp;gt;UseEbands&amp;lt;/code&amp;gt; and setting the number of bands in the Green&#039;s function: &lt;br /&gt;
&lt;br /&gt;
 % GbndRnge   1 | 10 |                   # [GW] G[W] bands range&lt;br /&gt;
&lt;br /&gt;
Repeat the previous calculations with different &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt; for instance, 10 20 30 40, and check how the COHSEX direct and indirect band gap behave as a function of the number of bands in the Green&#039;s function.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_empties_G_bands.png]]&lt;br /&gt;
&lt;br /&gt;
= GW within the plasmon pole approximation (PPA) =&lt;br /&gt;
&lt;br /&gt;
Even the static COHSEX approximation is very appealing, it was clear from the first calculation that dynamical effects cannot be disregarded in solids. This fact motivated the research for approximated way to deal with a frequency dependent interaction, and one of the first proposal was the so-called Plasmon-Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
Now we will proceed to the calculation of the silicon band gap in G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; within PPA. In each section you will be asked to perform several calculations varying the value of the relevant variables involved. More specifically let&#039;s consider a typical Yambo input file to calculate GW corrections in the PPA.&lt;br /&gt;
&lt;br /&gt;
 gw0                          # [R GW] GoWo Quasiparticle energy levels &lt;br /&gt;
 ppa                          # [R Xp] Plasmon Pole Approximation &lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 em1d                         # [R Xd] Dynamical Inverse Dielectric Matrix&lt;br /&gt;
 EXXRLvcs= 7            Ry    # [XX] Exchange RL components &lt;br /&gt;
 % QpntsRXp &lt;br /&gt;
   1 |  8 |                   # [Xp] Transferred momenta&lt;br /&gt;
 %&lt;br /&gt;
 % BndsRnXp  &lt;br /&gt;
  1 | 10 |                 # [Xp] Polarization function bands&lt;br /&gt;
 % &lt;br /&gt;
 NGsBlkXp= 1            RL    # [Xp] Response block size&lt;br /&gt;
 % LongDrXp &lt;br /&gt;
  1.000000 | 0.000000 | 0.000000 |        # [Xp] [cc] Electric Field&lt;br /&gt;
 % &lt;br /&gt;
 PPAPntXp= 27.21138     eV    # [Xp] PPA imaginary energy&lt;br /&gt;
 % GbndRnge  &lt;br /&gt;
  1 |  10 |                 # [GW] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 GDamping=  0.10000     eV    # [GW] G[W] damping&lt;br /&gt;
 dScStep=  0.10000      eV    # [GW] Energy step to evalute Z factors&lt;br /&gt;
 DysSolver= n               # [GW] Dyson Equation solver (`n`,`s`,`g`)&lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
  1|  8|  1| 10|&lt;br /&gt;
 %&lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices &lt;br /&gt;
  1|  8| 0.0|-1.0|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
The variables are the same of the COHSEX case plus a new one &amp;lt;code&amp;gt;PPAPntXp&amp;lt;/code&amp;gt; that describes the imaginary energy used to fit the Plasmon Pole model.&amp;lt;br /&amp;gt;&lt;br /&gt;
Follow the same strategy of the COHSEX case. Enter each k-point folder and type:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -d -k hartree -g n -p p -F Inputs/03GoWo_PPA_corrections&lt;br /&gt;
&lt;br /&gt;
otherwise you can use the existent file &amp;lt;code&amp;gt;Input/03GoWo_PPA_corrections&amp;lt;/code&amp;gt;. Now you have to study the convergence of the G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; gap versus the number of k-points, the number of bands in χ &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt;, the size of the dielectric constant &amp;lt;code&amp;gt;NGsBlkXs&amp;lt;/code&amp;gt; and the number of bands in the Green&#039;s function &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please follow the same strategy of the COHSEX case running yambo using&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/03GoWo_PPA_corrections -J GoWo_PPA_HF7Ry_X???Ry-nb???_nb???&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final convergence plots should look like these (the plots are done using as a basis the above code).&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W size.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA G bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA gap vs kpts.png]]&lt;br /&gt;
&lt;br /&gt;
Final runs!! Now you know how to converge a G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; calculation so you can decide which are the parameters needed for full convergence. First do a COHSEX and then a GoWo (PPA) run at convergence, and you should obtain results similar to the following graph:&lt;br /&gt;
&lt;br /&gt;
[[File:Si_gap.png|Final Gap Silicon]]&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;gw&amp;quot;&amp;gt;H. N. Rojas, R. W. Godby, and R. J. Needs, Phys. Rev. Lett. &#039;&#039;&#039;74&#039;&#039;&#039;, 1827 (1995)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;hedin&amp;quot;&amp;gt; L. Hedin, Phys. Rev. &#039;&#039;&#039;139&#039;&#039;&#039;, A796 (1965)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5283</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5283"/>
		<updated>2022-02-08T10:50:03Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* COHSEX without empty bands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Basic concepts of the GW approximation =&lt;br /&gt;
&lt;br /&gt;
[[File:GW0.png|x300px|center|]] &lt;br /&gt;
&lt;br /&gt;
In this tutorial you will learn the basic concepts of the [[Hartree-Fock]] and of the GW&amp;lt;ref name=&amp;quot;gw&amp;quot;/&amp;gt; approximation. In particular we will illustrate how to calculate [http://en.wikipedia.org/wiki/Quasiparticle Quasi-Particle] energies with a single shot G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; approximation. Different lecture notes on the GW approach are available in the [[Lectures|Lectures section]].&lt;br /&gt;
&lt;br /&gt;
The tutorial is split in different sections. In the first part we will deal with Hartree-Fock (HF) and the Coulomb-hole and screened-exchange (COHSEX) approximation. Finally in the last section we will discuss dynamical correlation with a Plasmon Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
= The material: Silicon =&lt;br /&gt;
&lt;br /&gt;
* [http://cst-www.nrl.navy.mil/lattice/struk/a1.html FCC] lattice&lt;br /&gt;
* Two atoms per cell (8 electrons)&lt;br /&gt;
* Lattice constant 10.183 [a.u.]&lt;br /&gt;
* Plane waves cutoff 15 Rydberg&lt;br /&gt;
&lt;br /&gt;
===Band gap===&lt;br /&gt;
&lt;br /&gt;
*Direct gap   3.4 eV at Gamma&lt;br /&gt;
*Indirect gap 1.1 eV betweeb Gamma and X&#039;&lt;br /&gt;
*Gamma= (0 0 0)&lt;br /&gt;
*X&#039; is a point close to X=(0 1 0)&lt;br /&gt;
&lt;br /&gt;
[[File:si_banddiagram.gif|thumb|x400px|Silicon Band Structure]]&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;Silicon.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= The Tutorial structure =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the tutorial archive file is unzipped the following folder structure will appear&lt;br /&gt;
&lt;br /&gt;
 COPYING  README  Silicon/&lt;br /&gt;
&lt;br /&gt;
with the Solid_Si folder containing&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls Silicon/ &lt;br /&gt;
 PWSCF/  YAMBO/&lt;br /&gt;
&lt;br /&gt;
In the Pwscf folder  the student will find an input/output directory with input/output files for pw.x. The Silicon pseudopotential file is also provided.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls PWSCF/&lt;br /&gt;
 convergence_scripts  input  output  psps&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;convergence_scripts&amp;lt;/code&amp;gt; you will find some useful shell scripts to run the ground state convergence runs for Silicon.&lt;br /&gt;
&lt;br /&gt;
The YAMBO folder contains the Yambo input/output files and core databases.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls YAMBO/&lt;br /&gt;
 2x2x2/  4x4x4/  6x6x6/  8x8x8/  Convergence_Plots_and_Scripts/  GAMMA/&lt;br /&gt;
&lt;br /&gt;
The core databases are provided for several k-points grids. In addition the folder &amp;lt;code&amp;gt;Convergence_Plots_and_Scripts&amp;lt;/code&amp;gt; contains some scripts to extract informations from the report files useful for the tutorial.&lt;br /&gt;
&lt;br /&gt;
= Hartree-Fock =&lt;br /&gt;
&lt;br /&gt;
Now we will study the convergence of the [http://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method Hartree-Fock] self energy, respect to the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors and &#039;&#039;&#039;k&#039;&#039;&#039;-points. Yambo is a plane-wave code, therefore all the operators and wave-functions are expanded as:&lt;br /&gt;
&lt;br /&gt;
[[File:orbital.png|Orbital in plane wave]]&lt;br /&gt;
&lt;br /&gt;
Before you start any calculations we can decide how many &#039;&#039;&#039;G&#039;&#039;&#039;-vectors you want use to represent your wave-function. By default Yambo will use all of them, and for the present tutorial this is fine, however if you are studying larger systems you would like to reduce them in order to speed-up calculations, you can do it with &amp;lt;code&amp;gt; yambo -i -V RL&amp;lt;/code&amp;gt; and then changing the variable &amp;lt;code&amp;gt;MaxGvecs&amp;lt;/code&amp;gt; that referees to N&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt; in the previous formula.&lt;br /&gt;
&lt;br /&gt;
Now we will proceed in the calculation of the [[Hartree-Fock|Hartree-Fock]] exchange. This is composed of two terms, that Hartree and the Fock (or exchange) one:&lt;br /&gt;
&lt;br /&gt;
[[File:hf.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will calculate only the first order correction to the Kohn-Sham Hamiltonian due to the exchange term. Because of we are working in periodic system, the most appropriate basis to represent the Coulomb potential, appearing in the Fock term, is a plane-wave basis:&lt;br /&gt;
&lt;br /&gt;
[[File:v_q_plus_G.png|Coulomb potential in plane wave]]&lt;br /&gt;
&lt;br /&gt;
In order to generate the input file for the exchange type &amp;lt;code&amp;gt;yambo -x&amp;lt;/code&amp;gt;. The variable that governs the number of &#039;&#039;&#039;G&#039;&#039;&#039; vectors N&amp;lt;sub&amp;gt;ex&amp;lt;/sub&amp;gt; in the Coulomb potential is &amp;lt;code&amp;gt;EXXRLvcs&amp;lt;/code&amp;gt;. In addition notice that in the previous formula for V(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) we have an integral on the &#039;&#039;&#039;q&#039;&#039;&#039; vector, that in the code is discretized on a regular &#039;&#039;&#039;q&#039;&#039;&#039;-grid generated from the &#039;&#039;&#039;k&#039;&#039;&#039;-point one, &#039;&#039;&#039;q&#039;&#039;&#039;=&#039;&#039;&#039;k&#039;&#039;&#039;-&#039;&#039;&#039;k&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== G-vectors convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd 4x4x4&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;code&amp;gt;01HF_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;EXXRLvcs=&amp;lt;/code&amp;gt;3,6,7 and 15 Ry. For each case run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/01HF_corrections -J HF_???Ry&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15&lt;br /&gt;
&lt;br /&gt;
Now plot the HF corrections by using the [[Gnuplot_scripts|hf_vs_cutoff.gnuplot]] script. Launch it via&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 gnuplot&amp;gt;load &amp;quot;hf_vs_cutoff.gnuplot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:HF_parameters.png|Hartree-Fock corrections versus energy cutoff]]&lt;br /&gt;
&lt;br /&gt;
== K-points convergence==&lt;br /&gt;
&lt;br /&gt;
Enter each grid folder (&amp;lt;code&amp;gt;GAMMA,2x2x2,4x4x4,...&amp;lt;/code&amp;gt;) and run &lt;br /&gt;
 &amp;gt; yambo&lt;br /&gt;
without options. Then type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -x -F Inputs/01HF_corrections -J 01HF_corrections&lt;br /&gt;
&lt;br /&gt;
and edit the 01HF_corrections file&lt;br /&gt;
&lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 EXXRLvcs= 15           Ry    # [XX] Exchange RL components &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices   &lt;br /&gt;
 1|  8|  1| 15| &lt;br /&gt;
 % &lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices  &lt;br /&gt;
  1|  8| 0.0|-1.0| &lt;br /&gt;
 % &lt;br /&gt;
&lt;br /&gt;
setting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; EXXRLvcs=15 Ry&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run in each k-point folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &amp;gt; yambo -F Inputs/01HF_corrections -J 01HF_corrections&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after each run Yambo produces three output file, one starting with &amp;lt;code&amp;gt;r_...&amp;lt;/code&amp;gt; , another with &amp;lt;code&amp;gt;l_...&amp;lt;/code&amp;gt; and a third one starting with &amp;lt;code&amp;gt;o_...&amp;lt;/code&amp;gt;. The first one is a &#039;&#039;report&#039;&#039; of the actual calculation with all the details of the system, input, and results, while the second is a &#039;&#039;log&#039;&#039; with the running time of each process.&lt;br /&gt;
&lt;br /&gt;
The file we are most interested in is the output file, &amp;lt;code&amp;gt;o-01HF_corrections.hf&amp;lt;/code&amp;gt;. This file contains several columns. The fourth, labelled with &amp;lt;code&amp;gt;Ehf&amp;lt;/code&amp;gt; represents the Hartree-Fock energy. This is the quantity we have to look at.&lt;br /&gt;
&lt;br /&gt;
Use the [[Bash_scripts|parse_gap_hf.sh]] to parse the output files and adapt the gnuplot script provided earlier to print the values by using gnuplot&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd ../&lt;br /&gt;
 &amp;gt; ./parse_gap.sh o-01HF_corrections.hf hf_direct_gap_vs_kpoints.dat&lt;br /&gt;
&lt;br /&gt;
[[File:Hf gap vs kpts.png|Direct gap vs k-points]]&lt;br /&gt;
&lt;br /&gt;
= COHSEX without empty bands =&lt;br /&gt;
&lt;br /&gt;
The Hartree-Fock self-energy just described in the previous section, although successful on some molecular systems, miserably fails in extended systems. The reason of this failure lies in the fact that electrons can screen the Coulomb potential, and therefore one electron feels a screened potential instead of the bare one. A common approximation for this screened potential is the so-called Random Phase Approximation:&lt;br /&gt;
&lt;br /&gt;
[[File:gw.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
where the bare Coulomb potential V(&#039;&#039;&#039;r&#039;&#039;&#039;) is replaced by a non-local and frequency dependent one W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,ω). Subsequently it is possible to redefine all the perturbation theory in term of this screened potential, and disregarding the additional corrections coming from the vertex part, one obtains the so-called [[GW|GW]] approximation.&lt;br /&gt;
&lt;br /&gt;
However the substantial complexity associated with calculating the non-local, energy dependent Σ=GW operator inspired early efforts to find simplifying approximations as the static COHSEX approximation prosed by Hedin&amp;lt;ref name=&amp;quot;hedin&amp;quot;/&amp;gt;. The Coulomb Hole plus Screened Exchange (COHSEX) approximation[[[#march|2]],[[#fardi|3]]] eliminates the summation over empty states for the self energy operator and has the added benefit of being a static operator, a particular simplification for self consistent calculations. With the COHSEX approximation the self-energy is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
[[File:gw_sex.png|Screened Exchange]]&lt;br /&gt;
&lt;br /&gt;
[[File:gw_coh.png|Cuolomb Hole]]&lt;br /&gt;
&lt;br /&gt;
where W&amp;lt;sub&amp;gt;p&amp;lt;/sub&amp;gt;=W - V.&lt;br /&gt;
&lt;br /&gt;
In order to calculate the COHSEX self-energy with yambo you need first the static screened interaction &amp;lt;code&amp;gt;yambo -X s -k hartree&amp;lt;/code&amp;gt;. As for the V(&#039;&#039;&#039;r&#039;&#039;&#039;) case, also W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,E=0) will depend from the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors, and the &#039;&#039;&#039;k&#039;&#039;&#039;-grid, but this time also the number of conduction bands &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt; will enter in the screening calculation through the polarization function, see [http://www.yambo-code.org/theory/docs/doc_Xd.php The Interacting response function: Many-Body and TDDFT] section. Notice however that there are not any additional dependence of the self-energy operator from the conduction bands. After you obtained the screened interaction you are ready to build the self-energy operator and solve the corresponding Dyson equation, have a look to the [[GW|Dyson Equation solvers]] in Yambo. In order to get the quasi-particle energies, just do &amp;lt;code&amp;gt;yambo -b -g n -k hartree&amp;lt;/code&amp;gt;. After calculation are completed Yambo will produce an output file &amp;lt;code&amp;gt;o.qp&amp;lt;/code&amp;gt; which contains the values of the bare and re-normalized energy levels.&lt;br /&gt;
&lt;br /&gt;
== K-points convergence ==&lt;br /&gt;
&lt;br /&gt;
Follow the same strategy of the HF case. Enter each k-point folder and type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -b -k hartree -g n -p c -F Inputs/02Cohsex&lt;br /&gt;
&lt;br /&gt;
edit the input file and change the values of the fields&lt;br /&gt;
&lt;br /&gt;
 EXXRLvcs=7 Ry %BndsRnXs   1 | 10  |                   # [Xs] Polarization function bands &lt;br /&gt;
 NGsBlkXs= 1            RL    # [Xs] Response block size &lt;br /&gt;
 #UseEbands                   # [GW] Force COHSEX to use empty bands &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
 1|  8|  1| 10| &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
leaving the other parameters unchanged. Now, in each k-point folder, run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X0Ry-nb10&lt;br /&gt;
&lt;br /&gt;
Adapt the shell script provided earlier to plot the direct gap dependence on the k-points grid&lt;br /&gt;
&lt;br /&gt;
[[File:Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints.png]]&lt;br /&gt;
&lt;br /&gt;
== W size convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder and edit the &amp;lt;code&amp;gt;02Cohsex_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;NGsBlkXs=&amp;lt;/code&amp;gt;3,6,7 Ry. Run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X???Ry-nb10 &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_size.png]]&lt;br /&gt;
&lt;br /&gt;
== W bands ==&lt;br /&gt;
&lt;br /&gt;
Open your input file and change only the input variable &amp;lt;code&amp;gt;NGsBlkXs=1 Ry&amp;lt;/code&amp;gt;. Then change&lt;br /&gt;
&lt;br /&gt;
 %BndsRnXs   1 | 20  |        # [Xs] Polarization function bands&lt;br /&gt;
&lt;br /&gt;
and run &amp;lt;code&amp;gt;yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X1Ry-nb20&amp;lt;/code&amp;gt;. &lt;br /&gt;
Repeat the calculations using 30 and 40 bands changing &amp;lt;code&amp;gt;nb???&amp;lt;/code&amp;gt; in the job string identifier. Finally check how the Chosex Direct and Indirect band gap behave as a function of the number of bands in the screening.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_bands.png]]&lt;br /&gt;
&lt;br /&gt;
== COHSEX with empty bands ==&lt;br /&gt;
&lt;br /&gt;
While the Screened Exchange(SEX) part of the COHSEX self-energy has a structure similar to the Hartree-Fock exchange term, the Coulomb Hole(COH) acts as static external potential on the electrons. In the COH part the delta function δ(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) comes from the completeness relation:&lt;br /&gt;
&lt;br /&gt;
[[File:completeness.png|Completeness relation]]&lt;br /&gt;
&lt;br /&gt;
Now we avoid the use of this relation in such a way to have a self-energy that depends from the conduction bands too. This can be done uncommenting flags &amp;lt;code&amp;gt;UseEbands&amp;lt;/code&amp;gt; and setting the number of bands in the Green&#039;s function: &lt;br /&gt;
&lt;br /&gt;
 % GbndRnge   1 | 10 |                   # [GW] G[W] bands range&lt;br /&gt;
&lt;br /&gt;
Repeat the previous calculations with different &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt; for instance, 10 20 30 40, and check how the COHSEX direct and indirect band gap behave as a function of the number of bands in the Green&#039;s function.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_empties_G_bands.png]]&lt;br /&gt;
&lt;br /&gt;
= GW within the plasmon pole approximation (PPA) =&lt;br /&gt;
&lt;br /&gt;
Even the static COHSEX approximation is very appealing, it was clear from the first calculation that dynamical effects cannot be disregarded in solids. This fact motivated the research for approximated way to deal with a frequency dependent interaction, and one of the first proposal was the so-called Plasmon-Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
Now we will proceed to the calculation of the silicon band gap in G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; within PPA. In each section you will be asked to perform several calculations varying the value of the relevant variables involved. More specifically let&#039;s consider a typical Yambo input file to calculate GW corrections in the PPA.&lt;br /&gt;
&lt;br /&gt;
 gw0                          # [R GW] GoWo Quasiparticle energy levels &lt;br /&gt;
 ppa                          # [R Xp] Plasmon Pole Approximation &lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 em1d                         # [R Xd] Dynamical Inverse Dielectric Matrix&lt;br /&gt;
 EXXRLvcs= 7            Ry    # [XX] Exchange RL components &lt;br /&gt;
 % QpntsRXp &lt;br /&gt;
   1 |  8 |                   # [Xp] Transferred momenta&lt;br /&gt;
 %&lt;br /&gt;
 % BndsRnXp  &lt;br /&gt;
  1 | 10 |                 # [Xp] Polarization function bands&lt;br /&gt;
 % &lt;br /&gt;
 NGsBlkXp= 1            RL    # [Xp] Response block size&lt;br /&gt;
 % LongDrXp &lt;br /&gt;
  1.000000 | 0.000000 | 0.000000 |        # [Xp] [cc] Electric Field&lt;br /&gt;
 % &lt;br /&gt;
 PPAPntXp= 27.21138     eV    # [Xp] PPA imaginary energy&lt;br /&gt;
 % GbndRnge  &lt;br /&gt;
  1 |  10 |                 # [GW] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 GDamping=  0.10000     eV    # [GW] G[W] damping&lt;br /&gt;
 dScStep=  0.10000      eV    # [GW] Energy step to evalute Z factors&lt;br /&gt;
 DysSolver= n               # [GW] Dyson Equation solver (`n`,`s`,`g`)&lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
  1|  8|  1| 10|&lt;br /&gt;
 %&lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices &lt;br /&gt;
  1|  8| 0.0|-1.0|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
The variables are the same of the COHSEX case plus a new one &amp;lt;code&amp;gt;PPAPntXp&amp;lt;/code&amp;gt; that describes the imaginary energy used to fit the Plasmon Pole model.&amp;lt;br /&amp;gt;&lt;br /&gt;
Follow the same strategy of the COHSEX case. Enter each k-point folder and type:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -d -k hartree -g n -p p -F Inputs/03GoWo_PPA_corrections&lt;br /&gt;
&lt;br /&gt;
otherwise you can use the existent file &amp;lt;code&amp;gt;Input/03GoWo_PPA_corrections&amp;lt;/code&amp;gt;. Now you have to study the convergence of the G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; gap versus the number of k-points, the number of bands in χ &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt;, the size of the dielectric constant &amp;lt;code&amp;gt;NGsBlkXs&amp;lt;/code&amp;gt; and the number of bands in the Green&#039;s function &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please follow the same strategy of the COHSEX case running yambo using&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/03GoWo_PPA_corrections -J GoWo_PPA_HF7Ry_X???Ry-nb???_nb???&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final convergence plots should look like these (the plots are done using as a basis the above code).&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W size.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA G bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA gap vs kpts.png]]&lt;br /&gt;
&lt;br /&gt;
Final runs!! Now you know how to converge a G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; calculation so you can decide which are the parameters needed for full convergence. First do a COHSEX and then a GoWo (PPA) run at convergence, and you should obtain results similar to the following graph:&lt;br /&gt;
&lt;br /&gt;
[[File:Si_gap.png|Final Gap Silicon]]&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;gw&amp;quot;&amp;gt;H. N. Rojas, R. W. Godby, and R. J. Needs, Phys. Rev. Lett. &#039;&#039;&#039;74&#039;&#039;&#039;, 1827 (1995)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;hedin&amp;quot;&amp;gt; L. Hedin, Phys. Rev. &#039;&#039;&#039;139&#039;&#039;&#039;, A796 (1965)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5282</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5282"/>
		<updated>2022-02-08T10:48:51Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* K-points convergence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Basic concepts of the GW approximation =&lt;br /&gt;
&lt;br /&gt;
[[File:GW0.png|x300px|center|]] &lt;br /&gt;
&lt;br /&gt;
In this tutorial you will learn the basic concepts of the [[Hartree-Fock]] and of the GW&amp;lt;ref name=&amp;quot;gw&amp;quot;/&amp;gt; approximation. In particular we will illustrate how to calculate [http://en.wikipedia.org/wiki/Quasiparticle Quasi-Particle] energies with a single shot G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; approximation. Different lecture notes on the GW approach are available in the [[Lectures|Lectures section]].&lt;br /&gt;
&lt;br /&gt;
The tutorial is split in different sections. In the first part we will deal with Hartree-Fock (HF) and the Coulomb-hole and screened-exchange (COHSEX) approximation. Finally in the last section we will discuss dynamical correlation with a Plasmon Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
= The material: Silicon =&lt;br /&gt;
&lt;br /&gt;
* [http://cst-www.nrl.navy.mil/lattice/struk/a1.html FCC] lattice&lt;br /&gt;
* Two atoms per cell (8 electrons)&lt;br /&gt;
* Lattice constant 10.183 [a.u.]&lt;br /&gt;
* Plane waves cutoff 15 Rydberg&lt;br /&gt;
&lt;br /&gt;
===Band gap===&lt;br /&gt;
&lt;br /&gt;
*Direct gap   3.4 eV at Gamma&lt;br /&gt;
*Indirect gap 1.1 eV betweeb Gamma and X&#039;&lt;br /&gt;
*Gamma= (0 0 0)&lt;br /&gt;
*X&#039; is a point close to X=(0 1 0)&lt;br /&gt;
&lt;br /&gt;
[[File:si_banddiagram.gif|thumb|x400px|Silicon Band Structure]]&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;Silicon.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= The Tutorial structure =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the tutorial archive file is unzipped the following folder structure will appear&lt;br /&gt;
&lt;br /&gt;
 COPYING  README  Silicon/&lt;br /&gt;
&lt;br /&gt;
with the Solid_Si folder containing&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls Silicon/ &lt;br /&gt;
 PWSCF/  YAMBO/&lt;br /&gt;
&lt;br /&gt;
In the Pwscf folder  the student will find an input/output directory with input/output files for pw.x. The Silicon pseudopotential file is also provided.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls PWSCF/&lt;br /&gt;
 convergence_scripts  input  output  psps&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;convergence_scripts&amp;lt;/code&amp;gt; you will find some useful shell scripts to run the ground state convergence runs for Silicon.&lt;br /&gt;
&lt;br /&gt;
The YAMBO folder contains the Yambo input/output files and core databases.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls YAMBO/&lt;br /&gt;
 2x2x2/  4x4x4/  6x6x6/  8x8x8/  Convergence_Plots_and_Scripts/  GAMMA/&lt;br /&gt;
&lt;br /&gt;
The core databases are provided for several k-points grids. In addition the folder &amp;lt;code&amp;gt;Convergence_Plots_and_Scripts&amp;lt;/code&amp;gt; contains some scripts to extract informations from the report files useful for the tutorial.&lt;br /&gt;
&lt;br /&gt;
= Hartree-Fock =&lt;br /&gt;
&lt;br /&gt;
Now we will study the convergence of the [http://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method Hartree-Fock] self energy, respect to the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors and &#039;&#039;&#039;k&#039;&#039;&#039;-points. Yambo is a plane-wave code, therefore all the operators and wave-functions are expanded as:&lt;br /&gt;
&lt;br /&gt;
[[File:orbital.png|Orbital in plane wave]]&lt;br /&gt;
&lt;br /&gt;
Before you start any calculations we can decide how many &#039;&#039;&#039;G&#039;&#039;&#039;-vectors you want use to represent your wave-function. By default Yambo will use all of them, and for the present tutorial this is fine, however if you are studying larger systems you would like to reduce them in order to speed-up calculations, you can do it with &amp;lt;code&amp;gt; yambo -i -V RL&amp;lt;/code&amp;gt; and then changing the variable &amp;lt;code&amp;gt;MaxGvecs&amp;lt;/code&amp;gt; that referees to N&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt; in the previous formula.&lt;br /&gt;
&lt;br /&gt;
Now we will proceed in the calculation of the [[Hartree-Fock|Hartree-Fock]] exchange. This is composed of two terms, that Hartree and the Fock (or exchange) one:&lt;br /&gt;
&lt;br /&gt;
[[File:hf.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will calculate only the first order correction to the Kohn-Sham Hamiltonian due to the exchange term. Because of we are working in periodic system, the most appropriate basis to represent the Coulomb potential, appearing in the Fock term, is a plane-wave basis:&lt;br /&gt;
&lt;br /&gt;
[[File:v_q_plus_G.png|Coulomb potential in plane wave]]&lt;br /&gt;
&lt;br /&gt;
In order to generate the input file for the exchange type &amp;lt;code&amp;gt;yambo -x&amp;lt;/code&amp;gt;. The variable that governs the number of &#039;&#039;&#039;G&#039;&#039;&#039; vectors N&amp;lt;sub&amp;gt;ex&amp;lt;/sub&amp;gt; in the Coulomb potential is &amp;lt;code&amp;gt;EXXRLvcs&amp;lt;/code&amp;gt;. In addition notice that in the previous formula for V(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) we have an integral on the &#039;&#039;&#039;q&#039;&#039;&#039; vector, that in the code is discretized on a regular &#039;&#039;&#039;q&#039;&#039;&#039;-grid generated from the &#039;&#039;&#039;k&#039;&#039;&#039;-point one, &#039;&#039;&#039;q&#039;&#039;&#039;=&#039;&#039;&#039;k&#039;&#039;&#039;-&#039;&#039;&#039;k&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== G-vectors convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd 4x4x4&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;code&amp;gt;01HF_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;EXXRLvcs=&amp;lt;/code&amp;gt;3,6,7 and 15 Ry. For each case run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/01HF_corrections -J HF_???Ry&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15&lt;br /&gt;
&lt;br /&gt;
Now plot the HF corrections by using the [[Gnuplot_scripts|hf_vs_cutoff.gnuplot]] script. Launch it via&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 gnuplot&amp;gt;load &amp;quot;hf_vs_cutoff.gnuplot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:HF_parameters.png|Hartree-Fock corrections versus energy cutoff]]&lt;br /&gt;
&lt;br /&gt;
== K-points convergence==&lt;br /&gt;
&lt;br /&gt;
Enter each grid folder (&amp;lt;code&amp;gt;GAMMA,2x2x2,4x4x4,...&amp;lt;/code&amp;gt;) and run &lt;br /&gt;
 &amp;gt; yambo&lt;br /&gt;
without options. Then type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -x -F Inputs/01HF_corrections -J 01HF_corrections&lt;br /&gt;
&lt;br /&gt;
and edit the 01HF_corrections file&lt;br /&gt;
&lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 EXXRLvcs= 15           Ry    # [XX] Exchange RL components &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices   &lt;br /&gt;
 1|  8|  1| 15| &lt;br /&gt;
 % &lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices  &lt;br /&gt;
  1|  8| 0.0|-1.0| &lt;br /&gt;
 % &lt;br /&gt;
&lt;br /&gt;
setting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; EXXRLvcs=15 Ry&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run in each k-point folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &amp;gt; yambo -F Inputs/01HF_corrections -J 01HF_corrections&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after each run Yambo produces three output file, one starting with &amp;lt;code&amp;gt;r_...&amp;lt;/code&amp;gt; , another with &amp;lt;code&amp;gt;l_...&amp;lt;/code&amp;gt; and a third one starting with &amp;lt;code&amp;gt;o_...&amp;lt;/code&amp;gt;. The first one is a &#039;&#039;report&#039;&#039; of the actual calculation with all the details of the system, input, and results, while the second is a &#039;&#039;log&#039;&#039; with the running time of each process.&lt;br /&gt;
&lt;br /&gt;
The file we are most interested in is the output file, &amp;lt;code&amp;gt;o-01HF_corrections.hf&amp;lt;/code&amp;gt;. This file contains several columns. The fourth, labelled with &amp;lt;code&amp;gt;Ehf&amp;lt;/code&amp;gt; represents the Hartree-Fock energy. This is the quantity we have to look at.&lt;br /&gt;
&lt;br /&gt;
Use the [[Bash_scripts|parse_gap_hf.sh]] to parse the output files and adapt the gnuplot script provided earlier to print the values by using gnuplot&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd ../&lt;br /&gt;
 &amp;gt; ./parse_gap.sh o-01HF_corrections.hf hf_direct_gap_vs_kpoints.dat&lt;br /&gt;
&lt;br /&gt;
[[File:Hf gap vs kpts.png|Direct gap vs k-points]]&lt;br /&gt;
&lt;br /&gt;
= COHSEX without empty bands =&lt;br /&gt;
&lt;br /&gt;
The Hartree-Fock self-energy just described in the previous section, although successful on some molecular systems, miserably fails in extended systems. The reason of this failure lies in the fact that electrons can screen the Coulomb potential, and therefore one electron feels a screened potential instead of the bare one. A common approximation for this screened potential is the so-called Random Phase Approximation:&lt;br /&gt;
&lt;br /&gt;
[[File:gw.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
where the bare Coulomb potential V(&#039;&#039;&#039;r&#039;&#039;&#039;) is replaced by a non-local and frequency dependent one W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,ω). Subsequently it is possible to redefine all the perturbation theory in term of this screened potential, and disregarding the additional corrections coming from the vertex part, one obtains the so-called [[GW|GW]] approximation.&lt;br /&gt;
&lt;br /&gt;
However the substantial complexity associated with calculating the non-local, energy dependent Σ=GW operator inspired early efforts to find simplifying approximations as the static COHSEX approximation prosed by Hedin&amp;lt;ref name=&amp;quot;hedin&amp;quot;/&amp;gt;. The Coulomb Hole plus Screened Exchange (COHSEX) approximation[[[#march|2]],[[#fardi|3]]] eliminates the summation over empty states for the self energy operator and has the added benefit of being a static operator, a particular simplification for self consistent calculations. With the COHSEX approximation the self-energy is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
[[File:gw_sex.png|Screened Exchange]]&lt;br /&gt;
&lt;br /&gt;
[[File:gw_coh.png|Cuolomb Hole]]&lt;br /&gt;
&lt;br /&gt;
where W&amp;lt;sub&amp;gt;p&amp;lt;/sub&amp;gt;=W - V.&lt;br /&gt;
&lt;br /&gt;
In order to calculate the COHSEX self-energy with yambo you need first the static screened interaction &amp;lt;code&amp;gt;yambo -X s -k hartree&amp;lt;/code&amp;gt;. As for the V(&#039;&#039;&#039;r&#039;&#039;&#039;) case, also W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,E=0) will depend from the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors, and the &#039;&#039;&#039;k&#039;&#039;&#039;-grid, but this time also the number of conduction bands &amp;lt;code&amp;gt;XsBndsRn&amp;lt;/code&amp;gt; will enter in the screening calculation through the polarization function, see [http://www.yambo-code.org/theory/docs/doc_Xd.php The Interacting response function: Many-Body and TDDFT] section. Notice however that there are not any additional dependence of the self-energy operator from the conduction bands. After you obtained the screened interaction you are ready to build the self-energy operator and solve the corresponding Dyson equation, have a look to the [[GW|Dyson Equation solvers]] in Yambo. In order to get the quasi-particle energies, just do &amp;lt;code&amp;gt;yambo -b -g n -k hartree&amp;lt;/code&amp;gt;. After calculation are completed Yambo will produce an output file &amp;lt;code&amp;gt;o.qp&amp;lt;/code&amp;gt; which contains the values of the bare and re-normalized energy levels.&lt;br /&gt;
&lt;br /&gt;
== K-points convergence ==&lt;br /&gt;
&lt;br /&gt;
Follow the same strategy of the HF case. Enter each k-point folder and type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -b -k hartree -g n -p c -F Inputs/02Cohsex&lt;br /&gt;
&lt;br /&gt;
edit the input file and change the values of the fields&lt;br /&gt;
&lt;br /&gt;
 EXXRLvcs=7 Ry %BndsRnXs   1 | 10  |                   # [Xs] Polarization function bands &lt;br /&gt;
 NGsBlkXs= 1            RL    # [Xs] Response block size &lt;br /&gt;
 #UseEbands                   # [GW] Force COHSEX to use empty bands &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
 1|  8|  1| 10| &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
leaving the other parameters unchanged. Now, in each k-point folder, run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X0Ry-nb10&lt;br /&gt;
&lt;br /&gt;
Adapt the shell script provided earlier to plot the direct gap dependence on the k-points grid&lt;br /&gt;
&lt;br /&gt;
[[File:Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints.png]]&lt;br /&gt;
&lt;br /&gt;
== W size convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder and edit the &amp;lt;code&amp;gt;02Cohsex_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;NGsBlkXs=&amp;lt;/code&amp;gt;3,6,7 Ry. Run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X???Ry-nb10 &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_size.png]]&lt;br /&gt;
&lt;br /&gt;
== W bands ==&lt;br /&gt;
&lt;br /&gt;
Open your input file and change only the input variable &amp;lt;code&amp;gt;NGsBlkXs=1 Ry&amp;lt;/code&amp;gt;. Then change&lt;br /&gt;
&lt;br /&gt;
 %BndsRnXs   1 | 20  |        # [Xs] Polarization function bands&lt;br /&gt;
&lt;br /&gt;
and run &amp;lt;code&amp;gt;yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X1Ry-nb20&amp;lt;/code&amp;gt;. &lt;br /&gt;
Repeat the calculations using 30 and 40 bands changing &amp;lt;code&amp;gt;nb???&amp;lt;/code&amp;gt; in the job string identifier. Finally check how the Chosex Direct and Indirect band gap behave as a function of the number of bands in the screening.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_bands.png]]&lt;br /&gt;
&lt;br /&gt;
== COHSEX with empty bands ==&lt;br /&gt;
&lt;br /&gt;
While the Screened Exchange(SEX) part of the COHSEX self-energy has a structure similar to the Hartree-Fock exchange term, the Coulomb Hole(COH) acts as static external potential on the electrons. In the COH part the delta function δ(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) comes from the completeness relation:&lt;br /&gt;
&lt;br /&gt;
[[File:completeness.png|Completeness relation]]&lt;br /&gt;
&lt;br /&gt;
Now we avoid the use of this relation in such a way to have a self-energy that depends from the conduction bands too. This can be done uncommenting flags &amp;lt;code&amp;gt;UseEbands&amp;lt;/code&amp;gt; and setting the number of bands in the Green&#039;s function: &lt;br /&gt;
&lt;br /&gt;
 % GbndRnge   1 | 10 |                   # [GW] G[W] bands range&lt;br /&gt;
&lt;br /&gt;
Repeat the previous calculations with different &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt; for instance, 10 20 30 40, and check how the COHSEX direct and indirect band gap behave as a function of the number of bands in the Green&#039;s function.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_empties_G_bands.png]]&lt;br /&gt;
&lt;br /&gt;
= GW within the plasmon pole approximation (PPA) =&lt;br /&gt;
&lt;br /&gt;
Even the static COHSEX approximation is very appealing, it was clear from the first calculation that dynamical effects cannot be disregarded in solids. This fact motivated the research for approximated way to deal with a frequency dependent interaction, and one of the first proposal was the so-called Plasmon-Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
Now we will proceed to the calculation of the silicon band gap in G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; within PPA. In each section you will be asked to perform several calculations varying the value of the relevant variables involved. More specifically let&#039;s consider a typical Yambo input file to calculate GW corrections in the PPA.&lt;br /&gt;
&lt;br /&gt;
 gw0                          # [R GW] GoWo Quasiparticle energy levels &lt;br /&gt;
 ppa                          # [R Xp] Plasmon Pole Approximation &lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 em1d                         # [R Xd] Dynamical Inverse Dielectric Matrix&lt;br /&gt;
 EXXRLvcs= 7            Ry    # [XX] Exchange RL components &lt;br /&gt;
 % QpntsRXp &lt;br /&gt;
   1 |  8 |                   # [Xp] Transferred momenta&lt;br /&gt;
 %&lt;br /&gt;
 % BndsRnXp  &lt;br /&gt;
  1 | 10 |                 # [Xp] Polarization function bands&lt;br /&gt;
 % &lt;br /&gt;
 NGsBlkXp= 1            RL    # [Xp] Response block size&lt;br /&gt;
 % LongDrXp &lt;br /&gt;
  1.000000 | 0.000000 | 0.000000 |        # [Xp] [cc] Electric Field&lt;br /&gt;
 % &lt;br /&gt;
 PPAPntXp= 27.21138     eV    # [Xp] PPA imaginary energy&lt;br /&gt;
 % GbndRnge  &lt;br /&gt;
  1 |  10 |                 # [GW] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 GDamping=  0.10000     eV    # [GW] G[W] damping&lt;br /&gt;
 dScStep=  0.10000      eV    # [GW] Energy step to evalute Z factors&lt;br /&gt;
 DysSolver= n               # [GW] Dyson Equation solver (`n`,`s`,`g`)&lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
  1|  8|  1| 10|&lt;br /&gt;
 %&lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices &lt;br /&gt;
  1|  8| 0.0|-1.0|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
The variables are the same of the COHSEX case plus a new one &amp;lt;code&amp;gt;PPAPntXp&amp;lt;/code&amp;gt; that describes the imaginary energy used to fit the Plasmon Pole model.&amp;lt;br /&amp;gt;&lt;br /&gt;
Follow the same strategy of the COHSEX case. Enter each k-point folder and type:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -d -k hartree -g n -p p -F Inputs/03GoWo_PPA_corrections&lt;br /&gt;
&lt;br /&gt;
otherwise you can use the existent file &amp;lt;code&amp;gt;Input/03GoWo_PPA_corrections&amp;lt;/code&amp;gt;. Now you have to study the convergence of the G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; gap versus the number of k-points, the number of bands in χ &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt;, the size of the dielectric constant &amp;lt;code&amp;gt;NGsBlkXs&amp;lt;/code&amp;gt; and the number of bands in the Green&#039;s function &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please follow the same strategy of the COHSEX case running yambo using&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/03GoWo_PPA_corrections -J GoWo_PPA_HF7Ry_X???Ry-nb???_nb???&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final convergence plots should look like these (the plots are done using as a basis the above code).&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W size.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA G bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA gap vs kpts.png]]&lt;br /&gt;
&lt;br /&gt;
Final runs!! Now you know how to converge a G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; calculation so you can decide which are the parameters needed for full convergence. First do a COHSEX and then a GoWo (PPA) run at convergence, and you should obtain results similar to the following graph:&lt;br /&gt;
&lt;br /&gt;
[[File:Si_gap.png|Final Gap Silicon]]&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;gw&amp;quot;&amp;gt;H. N. Rojas, R. W. Godby, and R. J. Needs, Phys. Rev. Lett. &#039;&#039;&#039;74&#039;&#039;&#039;, 1827 (1995)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;hedin&amp;quot;&amp;gt; L. Hedin, Phys. Rev. &#039;&#039;&#039;139&#039;&#039;&#039;, A796 (1965)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5281</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5281"/>
		<updated>2022-02-08T10:48:01Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* G-vectors convergence */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Basic concepts of the GW approximation =&lt;br /&gt;
&lt;br /&gt;
[[File:GW0.png|x300px|center|]] &lt;br /&gt;
&lt;br /&gt;
In this tutorial you will learn the basic concepts of the [[Hartree-Fock]] and of the GW&amp;lt;ref name=&amp;quot;gw&amp;quot;/&amp;gt; approximation. In particular we will illustrate how to calculate [http://en.wikipedia.org/wiki/Quasiparticle Quasi-Particle] energies with a single shot G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; approximation. Different lecture notes on the GW approach are available in the [[Lectures|Lectures section]].&lt;br /&gt;
&lt;br /&gt;
The tutorial is split in different sections. In the first part we will deal with Hartree-Fock (HF) and the Coulomb-hole and screened-exchange (COHSEX) approximation. Finally in the last section we will discuss dynamical correlation with a Plasmon Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
= The material: Silicon =&lt;br /&gt;
&lt;br /&gt;
* [http://cst-www.nrl.navy.mil/lattice/struk/a1.html FCC] lattice&lt;br /&gt;
* Two atoms per cell (8 electrons)&lt;br /&gt;
* Lattice constant 10.183 [a.u.]&lt;br /&gt;
* Plane waves cutoff 15 Rydberg&lt;br /&gt;
&lt;br /&gt;
===Band gap===&lt;br /&gt;
&lt;br /&gt;
*Direct gap   3.4 eV at Gamma&lt;br /&gt;
*Indirect gap 1.1 eV betweeb Gamma and X&#039;&lt;br /&gt;
*Gamma= (0 0 0)&lt;br /&gt;
*X&#039; is a point close to X=(0 1 0)&lt;br /&gt;
&lt;br /&gt;
[[File:si_banddiagram.gif|thumb|x400px|Silicon Band Structure]]&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;Silicon.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= The Tutorial structure =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the tutorial archive file is unzipped the following folder structure will appear&lt;br /&gt;
&lt;br /&gt;
 COPYING  README  Silicon/&lt;br /&gt;
&lt;br /&gt;
with the Solid_Si folder containing&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls Silicon/ &lt;br /&gt;
 PWSCF/  YAMBO/&lt;br /&gt;
&lt;br /&gt;
In the Pwscf folder  the student will find an input/output directory with input/output files for pw.x. The Silicon pseudopotential file is also provided.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls PWSCF/&lt;br /&gt;
 convergence_scripts  input  output  psps&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;convergence_scripts&amp;lt;/code&amp;gt; you will find some useful shell scripts to run the ground state convergence runs for Silicon.&lt;br /&gt;
&lt;br /&gt;
The YAMBO folder contains the Yambo input/output files and core databases.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls YAMBO/&lt;br /&gt;
 2x2x2/  4x4x4/  6x6x6/  8x8x8/  Convergence_Plots_and_Scripts/  GAMMA/&lt;br /&gt;
&lt;br /&gt;
The core databases are provided for several k-points grids. In addition the folder &amp;lt;code&amp;gt;Convergence_Plots_and_Scripts&amp;lt;/code&amp;gt; contains some scripts to extract informations from the report files useful for the tutorial.&lt;br /&gt;
&lt;br /&gt;
= Hartree-Fock =&lt;br /&gt;
&lt;br /&gt;
Now we will study the convergence of the [http://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method Hartree-Fock] self energy, respect to the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors and &#039;&#039;&#039;k&#039;&#039;&#039;-points. Yambo is a plane-wave code, therefore all the operators and wave-functions are expanded as:&lt;br /&gt;
&lt;br /&gt;
[[File:orbital.png|Orbital in plane wave]]&lt;br /&gt;
&lt;br /&gt;
Before you start any calculations we can decide how many &#039;&#039;&#039;G&#039;&#039;&#039;-vectors you want use to represent your wave-function. By default Yambo will use all of them, and for the present tutorial this is fine, however if you are studying larger systems you would like to reduce them in order to speed-up calculations, you can do it with &amp;lt;code&amp;gt; yambo -i -V RL&amp;lt;/code&amp;gt; and then changing the variable &amp;lt;code&amp;gt;MaxGvecs&amp;lt;/code&amp;gt; that referees to N&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt; in the previous formula.&lt;br /&gt;
&lt;br /&gt;
Now we will proceed in the calculation of the [[Hartree-Fock|Hartree-Fock]] exchange. This is composed of two terms, that Hartree and the Fock (or exchange) one:&lt;br /&gt;
&lt;br /&gt;
[[File:hf.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will calculate only the first order correction to the Kohn-Sham Hamiltonian due to the exchange term. Because of we are working in periodic system, the most appropriate basis to represent the Coulomb potential, appearing in the Fock term, is a plane-wave basis:&lt;br /&gt;
&lt;br /&gt;
[[File:v_q_plus_G.png|Coulomb potential in plane wave]]&lt;br /&gt;
&lt;br /&gt;
In order to generate the input file for the exchange type &amp;lt;code&amp;gt;yambo -x&amp;lt;/code&amp;gt;. The variable that governs the number of &#039;&#039;&#039;G&#039;&#039;&#039; vectors N&amp;lt;sub&amp;gt;ex&amp;lt;/sub&amp;gt; in the Coulomb potential is &amp;lt;code&amp;gt;EXXRLvcs&amp;lt;/code&amp;gt;. In addition notice that in the previous formula for V(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) we have an integral on the &#039;&#039;&#039;q&#039;&#039;&#039; vector, that in the code is discretized on a regular &#039;&#039;&#039;q&#039;&#039;&#039;-grid generated from the &#039;&#039;&#039;k&#039;&#039;&#039;-point one, &#039;&#039;&#039;q&#039;&#039;&#039;=&#039;&#039;&#039;k&#039;&#039;&#039;-&#039;&#039;&#039;k&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== G-vectors convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd 4x4x4&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;code&amp;gt;01HF_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;EXXRLvcs=&amp;lt;/code&amp;gt;3,6,7 and 15 Ry. For each case run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/01HF_corrections -J HF_???Ry&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15&lt;br /&gt;
&lt;br /&gt;
Now plot the HF corrections by using the [[Gnuplot_scripts|hf_vs_cutoff.gnuplot]] script. Launch it via&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 gnuplot&amp;gt;load &amp;quot;hf_vs_cutoff.gnuplot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:HF_parameters.png|Hartree-Fock corrections versus energy cutoff]]&lt;br /&gt;
&lt;br /&gt;
== K-points convergence==&lt;br /&gt;
&lt;br /&gt;
Enter each grid folder (&amp;lt;code&amp;gt;GAMMA,2x2x2,4x4x4,...&amp;lt;/code&amp;gt;) and run &lt;br /&gt;
 &amp;gt; yambo&lt;br /&gt;
without options. Then type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -x -F Inputs/01HF_corrections -J 01HF_corrections&lt;br /&gt;
&lt;br /&gt;
and edit the 01HF_corrections file&lt;br /&gt;
&lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 EXXRLvcs= 15           Ry    # [XX] Exchange RL components &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices   &lt;br /&gt;
 1|  8|  1| 15| &lt;br /&gt;
 % &lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices  &lt;br /&gt;
  1|  8| 0.0|-1.0| &lt;br /&gt;
 % &lt;br /&gt;
&lt;br /&gt;
setting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; EXXRLvcs=15 Ry&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run in each k-point folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &amp;gt; yambo -F Inputs/01HF_corrections -J 01HF_corrections&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after the each run Yambo produces three output file, one starting with &amp;lt;code&amp;gt;r_...&amp;lt;/code&amp;gt; , another with &amp;lt;code&amp;gt;l_...&amp;lt;/code&amp;gt; and a third one starting with &amp;lt;code&amp;gt;o_...&amp;lt;/code&amp;gt;. The first one is a &#039;&#039;report&#039;&#039; of the actual calculation with all the details of the system, input, and results, while the second is a &#039;&#039;log&#039;&#039; with the running time of each process.&lt;br /&gt;
&lt;br /&gt;
The file we are most interested in is the output file, &amp;lt;code&amp;gt;o-01HF_corrections.hf&amp;lt;/code&amp;gt;. This file contains several columns. The fourth, labelled with &amp;lt;code&amp;gt;Ehf&amp;lt;/code&amp;gt; represents the Hartree-Fock energy. This is the quantity we have to look at.&lt;br /&gt;
&lt;br /&gt;
Use the [[Bash_scripts|parse_gap_hf.sh]] to parse the output files and adapt the gnuplot script provided earlier to print the values by using gnuplot&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd ../&lt;br /&gt;
 &amp;gt; ./parse_gap.sh o-01HF_corrections.hf hf_direct_gap_vs_kpoints.dat&lt;br /&gt;
&lt;br /&gt;
[[File:Hf gap vs kpts.png|Direct gap vs k-points]]&lt;br /&gt;
&lt;br /&gt;
= COHSEX without empty bands =&lt;br /&gt;
&lt;br /&gt;
The Hartree-Fock self-energy just described in the previous section, although successful on some molecular systems, miserably fails in extended systems. The reason of this failure lies in the fact that electrons can screen the Coulomb potential, and therefore one electron feels a screened potential instead of the bare one. A common approximation for this screened potential is the so-called Random Phase Approximation:&lt;br /&gt;
&lt;br /&gt;
[[File:gw.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
where the bare Coulomb potential V(&#039;&#039;&#039;r&#039;&#039;&#039;) is replaced by a non-local and frequency dependent one W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,ω). Subsequently it is possible to redefine all the perturbation theory in term of this screened potential, and disregarding the additional corrections coming from the vertex part, one obtains the so-called [[GW|GW]] approximation.&lt;br /&gt;
&lt;br /&gt;
However the substantial complexity associated with calculating the non-local, energy dependent Σ=GW operator inspired early efforts to find simplifying approximations as the static COHSEX approximation prosed by Hedin&amp;lt;ref name=&amp;quot;hedin&amp;quot;/&amp;gt;. The Coulomb Hole plus Screened Exchange (COHSEX) approximation[[[#march|2]],[[#fardi|3]]] eliminates the summation over empty states for the self energy operator and has the added benefit of being a static operator, a particular simplification for self consistent calculations. With the COHSEX approximation the self-energy is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
[[File:gw_sex.png|Screened Exchange]]&lt;br /&gt;
&lt;br /&gt;
[[File:gw_coh.png|Cuolomb Hole]]&lt;br /&gt;
&lt;br /&gt;
where W&amp;lt;sub&amp;gt;p&amp;lt;/sub&amp;gt;=W - V.&lt;br /&gt;
&lt;br /&gt;
In order to calculate the COHSEX self-energy with yambo you need first the static screened interaction &amp;lt;code&amp;gt;yambo -X s -k hartree&amp;lt;/code&amp;gt;. As for the V(&#039;&#039;&#039;r&#039;&#039;&#039;) case, also W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,E=0) will depend from the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors, and the &#039;&#039;&#039;k&#039;&#039;&#039;-grid, but this time also the number of conduction bands &amp;lt;code&amp;gt;XsBndsRn&amp;lt;/code&amp;gt; will enter in the screening calculation through the polarization function, see [http://www.yambo-code.org/theory/docs/doc_Xd.php The Interacting response function: Many-Body and TDDFT] section. Notice however that there are not any additional dependence of the self-energy operator from the conduction bands. After you obtained the screened interaction you are ready to build the self-energy operator and solve the corresponding Dyson equation, have a look to the [[GW|Dyson Equation solvers]] in Yambo. In order to get the quasi-particle energies, just do &amp;lt;code&amp;gt;yambo -b -g n -k hartree&amp;lt;/code&amp;gt;. After calculation are completed Yambo will produce an output file &amp;lt;code&amp;gt;o.qp&amp;lt;/code&amp;gt; which contains the values of the bare and re-normalized energy levels.&lt;br /&gt;
&lt;br /&gt;
== K-points convergence ==&lt;br /&gt;
&lt;br /&gt;
Follow the same strategy of the HF case. Enter each k-point folder and type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -b -k hartree -g n -p c -F Inputs/02Cohsex&lt;br /&gt;
&lt;br /&gt;
edit the input file and change the values of the fields&lt;br /&gt;
&lt;br /&gt;
 EXXRLvcs=7 Ry %BndsRnXs   1 | 10  |                   # [Xs] Polarization function bands &lt;br /&gt;
 NGsBlkXs= 1            RL    # [Xs] Response block size &lt;br /&gt;
 #UseEbands                   # [GW] Force COHSEX to use empty bands &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
 1|  8|  1| 10| &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
leaving the other parameters unchanged. Now, in each k-point folder, run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X0Ry-nb10&lt;br /&gt;
&lt;br /&gt;
Adapt the shell script provided earlier to plot the direct gap dependence on the k-points grid&lt;br /&gt;
&lt;br /&gt;
[[File:Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints.png]]&lt;br /&gt;
&lt;br /&gt;
== W size convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder and edit the &amp;lt;code&amp;gt;02Cohsex_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;NGsBlkXs=&amp;lt;/code&amp;gt;3,6,7 Ry. Run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X???Ry-nb10 &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_size.png]]&lt;br /&gt;
&lt;br /&gt;
== W bands ==&lt;br /&gt;
&lt;br /&gt;
Open your input file and change only the input variable &amp;lt;code&amp;gt;NGsBlkXs=1 Ry&amp;lt;/code&amp;gt;. Then change&lt;br /&gt;
&lt;br /&gt;
 %BndsRnXs   1 | 20  |        # [Xs] Polarization function bands&lt;br /&gt;
&lt;br /&gt;
and run &amp;lt;code&amp;gt;yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X1Ry-nb20&amp;lt;/code&amp;gt;. &lt;br /&gt;
Repeat the calculations using 30 and 40 bands changing &amp;lt;code&amp;gt;nb???&amp;lt;/code&amp;gt; in the job string identifier. Finally check how the Chosex Direct and Indirect band gap behave as a function of the number of bands in the screening.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_bands.png]]&lt;br /&gt;
&lt;br /&gt;
== COHSEX with empty bands ==&lt;br /&gt;
&lt;br /&gt;
While the Screened Exchange(SEX) part of the COHSEX self-energy has a structure similar to the Hartree-Fock exchange term, the Coulomb Hole(COH) acts as static external potential on the electrons. In the COH part the delta function δ(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) comes from the completeness relation:&lt;br /&gt;
&lt;br /&gt;
[[File:completeness.png|Completeness relation]]&lt;br /&gt;
&lt;br /&gt;
Now we avoid the use of this relation in such a way to have a self-energy that depends from the conduction bands too. This can be done uncommenting flags &amp;lt;code&amp;gt;UseEbands&amp;lt;/code&amp;gt; and setting the number of bands in the Green&#039;s function: &lt;br /&gt;
&lt;br /&gt;
 % GbndRnge   1 | 10 |                   # [GW] G[W] bands range&lt;br /&gt;
&lt;br /&gt;
Repeat the previous calculations with different &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt; for instance, 10 20 30 40, and check how the COHSEX direct and indirect band gap behave as a function of the number of bands in the Green&#039;s function.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_empties_G_bands.png]]&lt;br /&gt;
&lt;br /&gt;
= GW within the plasmon pole approximation (PPA) =&lt;br /&gt;
&lt;br /&gt;
Even the static COHSEX approximation is very appealing, it was clear from the first calculation that dynamical effects cannot be disregarded in solids. This fact motivated the research for approximated way to deal with a frequency dependent interaction, and one of the first proposal was the so-called Plasmon-Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
Now we will proceed to the calculation of the silicon band gap in G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; within PPA. In each section you will be asked to perform several calculations varying the value of the relevant variables involved. More specifically let&#039;s consider a typical Yambo input file to calculate GW corrections in the PPA.&lt;br /&gt;
&lt;br /&gt;
 gw0                          # [R GW] GoWo Quasiparticle energy levels &lt;br /&gt;
 ppa                          # [R Xp] Plasmon Pole Approximation &lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 em1d                         # [R Xd] Dynamical Inverse Dielectric Matrix&lt;br /&gt;
 EXXRLvcs= 7            Ry    # [XX] Exchange RL components &lt;br /&gt;
 % QpntsRXp &lt;br /&gt;
   1 |  8 |                   # [Xp] Transferred momenta&lt;br /&gt;
 %&lt;br /&gt;
 % BndsRnXp  &lt;br /&gt;
  1 | 10 |                 # [Xp] Polarization function bands&lt;br /&gt;
 % &lt;br /&gt;
 NGsBlkXp= 1            RL    # [Xp] Response block size&lt;br /&gt;
 % LongDrXp &lt;br /&gt;
  1.000000 | 0.000000 | 0.000000 |        # [Xp] [cc] Electric Field&lt;br /&gt;
 % &lt;br /&gt;
 PPAPntXp= 27.21138     eV    # [Xp] PPA imaginary energy&lt;br /&gt;
 % GbndRnge  &lt;br /&gt;
  1 |  10 |                 # [GW] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 GDamping=  0.10000     eV    # [GW] G[W] damping&lt;br /&gt;
 dScStep=  0.10000      eV    # [GW] Energy step to evalute Z factors&lt;br /&gt;
 DysSolver= n               # [GW] Dyson Equation solver (`n`,`s`,`g`)&lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
  1|  8|  1| 10|&lt;br /&gt;
 %&lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices &lt;br /&gt;
  1|  8| 0.0|-1.0|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
The variables are the same of the COHSEX case plus a new one &amp;lt;code&amp;gt;PPAPntXp&amp;lt;/code&amp;gt; that describes the imaginary energy used to fit the Plasmon Pole model.&amp;lt;br /&amp;gt;&lt;br /&gt;
Follow the same strategy of the COHSEX case. Enter each k-point folder and type:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -d -k hartree -g n -p p -F Inputs/03GoWo_PPA_corrections&lt;br /&gt;
&lt;br /&gt;
otherwise you can use the existent file &amp;lt;code&amp;gt;Input/03GoWo_PPA_corrections&amp;lt;/code&amp;gt;. Now you have to study the convergence of the G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; gap versus the number of k-points, the number of bands in χ &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt;, the size of the dielectric constant &amp;lt;code&amp;gt;NGsBlkXs&amp;lt;/code&amp;gt; and the number of bands in the Green&#039;s function &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please follow the same strategy of the COHSEX case running yambo using&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/03GoWo_PPA_corrections -J GoWo_PPA_HF7Ry_X???Ry-nb???_nb???&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final convergence plots should look like these (the plots are done using as a basis the above code).&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W size.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA G bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA gap vs kpts.png]]&lt;br /&gt;
&lt;br /&gt;
Final runs!! Now you know how to converge a G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; calculation so you can decide which are the parameters needed for full convergence. First do a COHSEX and then a GoWo (PPA) run at convergence, and you should obtain results similar to the following graph:&lt;br /&gt;
&lt;br /&gt;
[[File:Si_gap.png|Final Gap Silicon]]&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;gw&amp;quot;&amp;gt;H. N. Rojas, R. W. Godby, and R. J. Needs, Phys. Rev. Lett. &#039;&#039;&#039;74&#039;&#039;&#039;, 1827 (1995)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;hedin&amp;quot;&amp;gt; L. Hedin, Phys. Rev. &#039;&#039;&#039;139&#039;&#039;&#039;, A796 (1965)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5280</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=5280"/>
		<updated>2022-02-08T10:46:25Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* COHSEX without empty bands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Basic concepts of the GW approximation =&lt;br /&gt;
&lt;br /&gt;
[[File:GW0.png|x300px|center|]] &lt;br /&gt;
&lt;br /&gt;
In this tutorial you will learn the basic concepts of the [[Hartree-Fock]] and of the GW&amp;lt;ref name=&amp;quot;gw&amp;quot;/&amp;gt; approximation. In particular we will illustrate how to calculate [http://en.wikipedia.org/wiki/Quasiparticle Quasi-Particle] energies with a single shot G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; approximation. Different lecture notes on the GW approach are available in the [[Lectures|Lectures section]].&lt;br /&gt;
&lt;br /&gt;
The tutorial is split in different sections. In the first part we will deal with Hartree-Fock (HF) and the Coulomb-hole and screened-exchange (COHSEX) approximation. Finally in the last section we will discuss dynamical correlation with a Plasmon Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
= The material: Silicon =&lt;br /&gt;
&lt;br /&gt;
* [http://cst-www.nrl.navy.mil/lattice/struk/a1.html FCC] lattice&lt;br /&gt;
* Two atoms per cell (8 electrons)&lt;br /&gt;
* Lattice constant 10.183 [a.u.]&lt;br /&gt;
* Plane waves cutoff 15 Rydberg&lt;br /&gt;
&lt;br /&gt;
===Band gap===&lt;br /&gt;
&lt;br /&gt;
*Direct gap   3.4 eV at Gamma&lt;br /&gt;
*Indirect gap 1.1 eV betweeb Gamma and X&#039;&lt;br /&gt;
*Gamma= (0 0 0)&lt;br /&gt;
*X&#039; is a point close to X=(0 1 0)&lt;br /&gt;
&lt;br /&gt;
[[File:si_banddiagram.gif|thumb|x400px|Silicon Band Structure]]&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;Silicon.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= The Tutorial structure =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the tutorial archive file is unzipped the following folder structure will appear&lt;br /&gt;
&lt;br /&gt;
 COPYING  README  Silicon/&lt;br /&gt;
&lt;br /&gt;
with the Solid_Si folder containing&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls Silicon/ &lt;br /&gt;
 PWSCF/  YAMBO/&lt;br /&gt;
&lt;br /&gt;
In the Pwscf folder  the student will find an input/output directory with input/output files for pw.x. The Silicon pseudopotential file is also provided.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls PWSCF/&lt;br /&gt;
 convergence_scripts  input  output  psps&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;convergence_scripts&amp;lt;/code&amp;gt; you will find some useful shell scripts to run the ground state convergence runs for Silicon.&lt;br /&gt;
&lt;br /&gt;
The YAMBO folder contains the Yambo input/output files and core databases.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; ls YAMBO/&lt;br /&gt;
 2x2x2/  4x4x4/  6x6x6/  8x8x8/  Convergence_Plots_and_Scripts/  GAMMA/&lt;br /&gt;
&lt;br /&gt;
The core databases are provided for several k-points grids. In addition the folder &amp;lt;code&amp;gt;Convergence_Plots_and_Scripts&amp;lt;/code&amp;gt; contains some scripts to extract informations from the report files useful for the tutorial.&lt;br /&gt;
&lt;br /&gt;
= Hartree-Fock =&lt;br /&gt;
&lt;br /&gt;
Now we will study the convergence of the [http://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method Hartree-Fock] self energy, respect to the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors and &#039;&#039;&#039;k&#039;&#039;&#039;-points. Yambo is a plane-wave code, therefore all the operators and wave-functions are expanded as:&lt;br /&gt;
&lt;br /&gt;
[[File:orbital.png|Orbital in plane wave]]&lt;br /&gt;
&lt;br /&gt;
Before you start any calculations we can decide how many &#039;&#039;&#039;G&#039;&#039;&#039;-vectors you want use to represent your wave-function. By default Yambo will use all of them, and for the present tutorial this is fine, however if you are studying larger systems you would like to reduce them in order to speed-up calculations, you can do it with &amp;lt;code&amp;gt; yambo -i -V RL&amp;lt;/code&amp;gt; and then changing the variable &amp;lt;code&amp;gt;MaxGvecs&amp;lt;/code&amp;gt; that referees to N&amp;lt;sub&amp;gt;g&amp;lt;/sub&amp;gt; in the previous formula.&lt;br /&gt;
&lt;br /&gt;
Now we will proceed in the calculation of the [[Hartree-Fock|Hartree-Fock]] exchange. This is composed of two terms, that Hartree and the Fock (or exchange) one:&lt;br /&gt;
&lt;br /&gt;
[[File:hf.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will calculate only the first order correction to the Kohn-Sham Hamiltonian due to the exchange term. Because of we are working in periodic system, the most appropriate basis to represent the Coulomb potential, appearing in the Fock term, is a plane-wave basis:&lt;br /&gt;
&lt;br /&gt;
[[File:v_q_plus_G.png|Coulomb potential in plane wave]]&lt;br /&gt;
&lt;br /&gt;
In order to generate the input file for the exchange type &amp;lt;code&amp;gt;yambo -x&amp;lt;/code&amp;gt;. The variable that governs the number of &#039;&#039;&#039;G&#039;&#039;&#039; vectors N&amp;lt;sub&amp;gt;ex&amp;lt;/sub&amp;gt; in the Coulomb potential is &amp;lt;code&amp;gt;EXXRLvcs&amp;lt;/code&amp;gt;. In addition notice that in the previous formula for V(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) we have an integral on the &#039;&#039;&#039;q&#039;&#039;&#039; vector, that in the code is discretized on a regular &#039;&#039;&#039;q&#039;&#039;&#039;-grid generated from the &#039;&#039;&#039;k&#039;&#039;&#039;-point one, &#039;&#039;&#039;q&#039;&#039;&#039;=&#039;&#039;&#039;k&#039;&#039;&#039;-&#039;&#039;&#039;k&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== G-vectors convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd 4x4x4&lt;br /&gt;
&lt;br /&gt;
Enter the  and edit the &amp;lt;code&amp;gt;01HF_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;EXXRLvcs=&amp;lt;/code&amp;gt;3,6,7 and 15 Ry. For each case run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/01HF_corrections -J HF_???Ry&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15&lt;br /&gt;
&lt;br /&gt;
Now plot the HF corrections by using the [[Gnuplot_scripts|hf_vs_cutoff.gnuplot]] script. Launch it via&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 gnuplot&amp;gt;load &amp;quot;hf_vs_cutoff.gnuplot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:HF_parameters.png|Hartree-Fock corrections versus energy cutoff]]&lt;br /&gt;
&lt;br /&gt;
== K-points convergence==&lt;br /&gt;
&lt;br /&gt;
Enter each grid folder (&amp;lt;code&amp;gt;GAMMA,2x2x2,4x4x4,...&amp;lt;/code&amp;gt;) and run &lt;br /&gt;
 &amp;gt; yambo&lt;br /&gt;
without options. Then type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -x -F Inputs/01HF_corrections -J 01HF_corrections&lt;br /&gt;
&lt;br /&gt;
and edit the 01HF_corrections file&lt;br /&gt;
&lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 EXXRLvcs= 15           Ry    # [XX] Exchange RL components &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices   &lt;br /&gt;
 1|  8|  1| 15| &lt;br /&gt;
 % &lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices  &lt;br /&gt;
  1|  8| 0.0|-1.0| &lt;br /&gt;
 % &lt;br /&gt;
&lt;br /&gt;
setting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; EXXRLvcs=15 Ry&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run in each k-point folder&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &amp;gt; yambo -F Inputs/01HF_corrections -J 01HF_corrections&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that after the each run Yambo produces three output file, one starting with &amp;lt;code&amp;gt;r_...&amp;lt;/code&amp;gt; , another with &amp;lt;code&amp;gt;l_...&amp;lt;/code&amp;gt; and a third one starting with &amp;lt;code&amp;gt;o_...&amp;lt;/code&amp;gt;. The first one is a &#039;&#039;report&#039;&#039; of the actual calculation with all the details of the system, input, and results, while the second is a &#039;&#039;log&#039;&#039; with the running time of each process.&lt;br /&gt;
&lt;br /&gt;
The file we are most interested in is the output file, &amp;lt;code&amp;gt;o-01HF_corrections.hf&amp;lt;/code&amp;gt;. This file contains several columns. The fourth, labelled with &amp;lt;code&amp;gt;Ehf&amp;lt;/code&amp;gt; represents the Hartree-Fock energy. This is the quantity we have to look at.&lt;br /&gt;
&lt;br /&gt;
Use the [[Bash_scripts|parse_gap_hf.sh]] to parse the output files and adapt the gnuplot script provided earlier to print the values by using gnuplot&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd ../&lt;br /&gt;
 &amp;gt; ./parse_gap.sh o-01HF_corrections.hf hf_direct_gap_vs_kpoints.dat&lt;br /&gt;
&lt;br /&gt;
[[File:Hf gap vs kpts.png|Direct gap vs k-points]]&lt;br /&gt;
&lt;br /&gt;
= COHSEX without empty bands =&lt;br /&gt;
&lt;br /&gt;
The Hartree-Fock self-energy just described in the previous section, although successful on some molecular systems, miserably fails in extended systems. The reason of this failure lies in the fact that electrons can screen the Coulomb potential, and therefore one electron feels a screened potential instead of the bare one. A common approximation for this screened potential is the so-called Random Phase Approximation:&lt;br /&gt;
&lt;br /&gt;
[[File:gw.png|Hartree Fock]]&lt;br /&gt;
&lt;br /&gt;
where the bare Coulomb potential V(&#039;&#039;&#039;r&#039;&#039;&#039;) is replaced by a non-local and frequency dependent one W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,ω). Subsequently it is possible to redefine all the perturbation theory in term of this screened potential, and disregarding the additional corrections coming from the vertex part, one obtains the so-called [[GW|GW]] approximation.&lt;br /&gt;
&lt;br /&gt;
However the substantial complexity associated with calculating the non-local, energy dependent Σ=GW operator inspired early efforts to find simplifying approximations as the static COHSEX approximation prosed by Hedin&amp;lt;ref name=&amp;quot;hedin&amp;quot;/&amp;gt;. The Coulomb Hole plus Screened Exchange (COHSEX) approximation[[[#march|2]],[[#fardi|3]]] eliminates the summation over empty states for the self energy operator and has the added benefit of being a static operator, a particular simplification for self consistent calculations. With the COHSEX approximation the self-energy is composed of two parts:&lt;br /&gt;
&lt;br /&gt;
[[File:gw_sex.png|Screened Exchange]]&lt;br /&gt;
&lt;br /&gt;
[[File:gw_coh.png|Cuolomb Hole]]&lt;br /&gt;
&lt;br /&gt;
where W&amp;lt;sub&amp;gt;p&amp;lt;/sub&amp;gt;=W - V.&lt;br /&gt;
&lt;br /&gt;
In order to calculate the COHSEX self-energy with yambo you need first the static screened interaction &amp;lt;code&amp;gt;yambo -X s -k hartree&amp;lt;/code&amp;gt;. As for the V(&#039;&#039;&#039;r&#039;&#039;&#039;) case, also W(&#039;&#039;&#039;r&#039;&#039;&#039;,&#039;&#039;&#039;r&#039;&#039;&#039;&#039;,E=0) will depend from the number of &#039;&#039;&#039;G&#039;&#039;&#039;-vectors, and the &#039;&#039;&#039;k&#039;&#039;&#039;-grid, but this time also the number of conduction bands &amp;lt;code&amp;gt;XsBndsRn&amp;lt;/code&amp;gt; will enter in the screening calculation through the polarization function, see [http://www.yambo-code.org/theory/docs/doc_Xd.php The Interacting response function: Many-Body and TDDFT] section. Notice however that there are not any additional dependence of the self-energy operator from the conduction bands. After you obtained the screened interaction you are ready to build the self-energy operator and solve the corresponding Dyson equation, have a look to the [[GW|Dyson Equation solvers]] in Yambo. In order to get the quasi-particle energies, just do &amp;lt;code&amp;gt;yambo -b -g n -k hartree&amp;lt;/code&amp;gt;. After calculation are completed Yambo will produce an output file &amp;lt;code&amp;gt;o.qp&amp;lt;/code&amp;gt; which contains the values of the bare and re-normalized energy levels.&lt;br /&gt;
&lt;br /&gt;
== K-points convergence ==&lt;br /&gt;
&lt;br /&gt;
Follow the same strategy of the HF case. Enter each k-point folder and type&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -b -k hartree -g n -p c -F Inputs/02Cohsex&lt;br /&gt;
&lt;br /&gt;
edit the input file and change the values of the fields&lt;br /&gt;
&lt;br /&gt;
 EXXRLvcs=7 Ry %BndsRnXs   1 | 10  |                   # [Xs] Polarization function bands &lt;br /&gt;
 NGsBlkXs= 1            RL    # [Xs] Response block size &lt;br /&gt;
 #UseEbands                   # [GW] Force COHSEX to use empty bands &lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
 1|  8|  1| 10| &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
leaving the other parameters unchanged. Now, in each k-point folder, run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X0Ry-nb10&lt;br /&gt;
&lt;br /&gt;
Adapt the shell script provided earlier to plot the direct gap dependence on the k-points grid&lt;br /&gt;
&lt;br /&gt;
[[File:Cohsex_HF7Ry_X0Ry-nb10_gap_vs_kpoints.png]]&lt;br /&gt;
&lt;br /&gt;
== W size convergence ==&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;4x4x4&amp;lt;/code&amp;gt; folder and edit the &amp;lt;code&amp;gt;02Cohsex_corrections&amp;lt;/code&amp;gt; file changing the field &amp;lt;code&amp;gt;NGsBlkXs=&amp;lt;/code&amp;gt;3,6,7 Ry. Run&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X???Ry-nb10 &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;???&amp;lt;/code&amp;gt;=3,6,7 and 15.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_size.png]]&lt;br /&gt;
&lt;br /&gt;
== W bands ==&lt;br /&gt;
&lt;br /&gt;
Open your input file and change only the input variable &amp;lt;code&amp;gt;NGsBlkXs=1 Ry&amp;lt;/code&amp;gt;. Then change&lt;br /&gt;
&lt;br /&gt;
 %BndsRnXs   1 | 20  |        # [Xs] Polarization function bands&lt;br /&gt;
&lt;br /&gt;
and run &amp;lt;code&amp;gt;yambo -F Inputs/02Cohsex -J Cohsex_HF7Ry_X1Ry-nb20&amp;lt;/code&amp;gt;. &lt;br /&gt;
Repeat the calculations using 30 and 40 bands changing &amp;lt;code&amp;gt;nb???&amp;lt;/code&amp;gt; in the job string identifier. Finally check how the Chosex Direct and Indirect band gap behave as a function of the number of bands in the screening.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_no_empties_W_bands.png]]&lt;br /&gt;
&lt;br /&gt;
== COHSEX with empty bands ==&lt;br /&gt;
&lt;br /&gt;
While the Screened Exchange(SEX) part of the COHSEX self-energy has a structure similar to the Hartree-Fock exchange term, the Coulomb Hole(COH) acts as static external potential on the electrons. In the COH part the delta function δ(&#039;&#039;&#039;r&#039;&#039;&#039;-&#039;&#039;&#039;r&#039;&#039;&#039;&#039;) comes from the completeness relation:&lt;br /&gt;
&lt;br /&gt;
[[File:completeness.png|Completeness relation]]&lt;br /&gt;
&lt;br /&gt;
Now we avoid the use of this relation in such a way to have a self-energy that depends from the conduction bands too. This can be done uncommenting flags &amp;lt;code&amp;gt;UseEbands&amp;lt;/code&amp;gt; and setting the number of bands in the Green&#039;s function: &lt;br /&gt;
&lt;br /&gt;
 % GbndRnge   1 | 10 |                   # [GW] G[W] bands range&lt;br /&gt;
&lt;br /&gt;
Repeat the previous calculations with different &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt; for instance, 10 20 30 40, and check how the COHSEX direct and indirect band gap behave as a function of the number of bands in the Green&#039;s function.&lt;br /&gt;
&lt;br /&gt;
[[File:COHSEX_empties_G_bands.png]]&lt;br /&gt;
&lt;br /&gt;
= GW within the plasmon pole approximation (PPA) =&lt;br /&gt;
&lt;br /&gt;
Even the static COHSEX approximation is very appealing, it was clear from the first calculation that dynamical effects cannot be disregarded in solids. This fact motivated the research for approximated way to deal with a frequency dependent interaction, and one of the first proposal was the so-called Plasmon-Pole Approximation (PPA).&lt;br /&gt;
&lt;br /&gt;
Now we will proceed to the calculation of the silicon band gap in G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; within PPA. In each section you will be asked to perform several calculations varying the value of the relevant variables involved. More specifically let&#039;s consider a typical Yambo input file to calculate GW corrections in the PPA.&lt;br /&gt;
&lt;br /&gt;
 gw0                          # [R GW] GoWo Quasiparticle energy levels &lt;br /&gt;
 ppa                          # [R Xp] Plasmon Pole Approximation &lt;br /&gt;
 HF_and_locXC                 # [R XX] Hartree-Fock Self-energy and Vxc &lt;br /&gt;
 em1d                         # [R Xd] Dynamical Inverse Dielectric Matrix&lt;br /&gt;
 EXXRLvcs= 7            Ry    # [XX] Exchange RL components &lt;br /&gt;
 % QpntsRXp &lt;br /&gt;
   1 |  8 |                   # [Xp] Transferred momenta&lt;br /&gt;
 %&lt;br /&gt;
 % BndsRnXp  &lt;br /&gt;
  1 | 10 |                 # [Xp] Polarization function bands&lt;br /&gt;
 % &lt;br /&gt;
 NGsBlkXp= 1            RL    # [Xp] Response block size&lt;br /&gt;
 % LongDrXp &lt;br /&gt;
  1.000000 | 0.000000 | 0.000000 |        # [Xp] [cc] Electric Field&lt;br /&gt;
 % &lt;br /&gt;
 PPAPntXp= 27.21138     eV    # [Xp] PPA imaginary energy&lt;br /&gt;
 % GbndRnge  &lt;br /&gt;
  1 |  10 |                 # [GW] G[W] bands range&lt;br /&gt;
 %&lt;br /&gt;
 GDamping=  0.10000     eV    # [GW] G[W] damping&lt;br /&gt;
 dScStep=  0.10000      eV    # [GW] Energy step to evalute Z factors&lt;br /&gt;
 DysSolver= n               # [GW] Dyson Equation solver (`n`,`s`,`g`)&lt;br /&gt;
 %QPkrange                    # [GW] QP generalized Kpoint/Band indices  &lt;br /&gt;
  1|  8|  1| 10|&lt;br /&gt;
 %&lt;br /&gt;
 %QPerange                    # [GW] QP generalized Kpoint/Energy indices &lt;br /&gt;
  1|  8| 0.0|-1.0|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
The variables are the same of the COHSEX case plus a new one &amp;lt;code&amp;gt;PPAPntXp&amp;lt;/code&amp;gt; that describes the imaginary energy used to fit the Plasmon Pole model.&amp;lt;br /&amp;gt;&lt;br /&gt;
Follow the same strategy of the COHSEX case. Enter each k-point folder and type:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -d -k hartree -g n -p p -F Inputs/03GoWo_PPA_corrections&lt;br /&gt;
&lt;br /&gt;
otherwise you can use the existent file &amp;lt;code&amp;gt;Input/03GoWo_PPA_corrections&amp;lt;/code&amp;gt;. Now you have to study the convergence of the G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; gap versus the number of k-points, the number of bands in χ &amp;lt;code&amp;gt;BndsRnXs&amp;lt;/code&amp;gt;, the size of the dielectric constant &amp;lt;code&amp;gt;NGsBlkXs&amp;lt;/code&amp;gt; and the number of bands in the Green&#039;s function &amp;lt;code&amp;gt;GbndRnge&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please follow the same strategy of the COHSEX case running yambo using&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F Inputs/03GoWo_PPA_corrections -J GoWo_PPA_HF7Ry_X???Ry-nb???_nb???&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final convergence plots should look like these (the plots are done using as a basis the above code).&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W size.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA W bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA G bands.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:PPA gap vs kpts.png]]&lt;br /&gt;
&lt;br /&gt;
Final runs!! Now you know how to converge a G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;W&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; calculation so you can decide which are the parameters needed for full convergence. First do a COHSEX and then a GoWo (PPA) run at convergence, and you should obtain results similar to the following graph:&lt;br /&gt;
&lt;br /&gt;
[[File:Si_gap.png|Final Gap Silicon]]&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;gw&amp;quot;&amp;gt;H. N. Rojas, R. W. Godby, and R. J. Needs, Phys. Rev. Lett. &#039;&#039;&#039;74&#039;&#039;&#039;, 1827 (1995)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;hedin&amp;quot;&amp;gt; L. Hedin, Phys. Rev. &#039;&#039;&#039;139&#039;&#039;&#039;, A796 (1965)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=LiF&amp;diff=5254</id>
		<title>LiF</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=LiF&amp;diff=5254"/>
		<updated>2022-01-21T14:34:23Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* The Statically screened Electron-electron interaction (yambo -X s) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:LiF-crystal.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
= Solid LiF: excitons at work =&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_lif_structure.jpg|LiF structure]]&lt;br /&gt;
&lt;br /&gt;
= The material =&lt;br /&gt;
&lt;br /&gt;
* FCC lattice&lt;br /&gt;
* Two atoms per cell, Li and F (8 electrons)&lt;br /&gt;
* Lattice constant 7.61 [a.u.]&lt;br /&gt;
* Plane waves cutoff 40 Hartree (1800 RL vectors)&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;LiF.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= From PWscf to the Yambo core databases =&lt;br /&gt;
&lt;br /&gt;
 $ cd YAMBO_TUTORIALS/LiF/PWSCF&lt;br /&gt;
 $ ls&lt;br /&gt;
 inputs	outputs  psps&lt;br /&gt;
&lt;br /&gt;
First run the SCF calculation to generate the ground-state charge density, occupations, Fermi level, and so on:&lt;br /&gt;
 $ pw.x &amp;lt; inputs/scf.in &amp;gt; scf.out&lt;br /&gt;
&lt;br /&gt;
Next run a non-SCF calculation to generate a set of Kohn-Sham eigenvalues and eigenvectors for both occupied and unoccupied states (100 bands): &lt;br /&gt;
 $ pw.x &amp;lt; inputs/nscf.in &amp;gt; nscf.out  &lt;br /&gt;
&lt;br /&gt;
Note the presence of the following flags in the input file:&lt;br /&gt;
 wf_collect=.true.&lt;br /&gt;
 force_symmorphic=.true.&lt;br /&gt;
 diago_full_acc=.true.&lt;br /&gt;
which are needed for generating the Yambo databases accurately. Full explanations of these variables are given on the [http://www.quantum-espresso.org/wp-content/uploads/Doc/INPUT_PW.html quantum-ESPRESSO input variables page]. &lt;br /&gt;
&lt;br /&gt;
After these two runs, you should have a &#039;&#039;LiF.save&#039;&#039; directory:&lt;br /&gt;
 $ ls LiF.save&lt;br /&gt;
 charge-density.dat  data-file-schema.xml  F.LDA.cpi.UPF  Li.LDA.cpi.UPF  wfc10.dat  wfc1.dat  wfc2.dat	wfc3.dat  wfc4.dat  wfc5.dat  wfc6.dat	wfc7.dat  wfc8.dat  wfc9.dat&lt;br /&gt;
&lt;br /&gt;
=== Conversion to Yambo format ===&lt;br /&gt;
The PWscf &#039;&#039;LiF.save&#039;&#039; output is converted to the Yambo format using the &amp;lt;code&amp;gt;p2y&amp;lt;/code&amp;gt; executable (pwscf to yambo), found in the yambo &#039;&#039;bin&#039;&#039; directory.&lt;br /&gt;
Enter &#039;&#039;LiF.save&#039;&#039; and launch &amp;lt;code&amp;gt;p2y&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 $ cd LiF.save&lt;br /&gt;
 $ p2y&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;---&amp;gt; DBs path set to .&lt;br /&gt;
 &amp;lt;---&amp;gt; Index file set to data-file.xml&lt;br /&gt;
 &amp;lt;---&amp;gt; Header/K-points/Energies... done&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;---&amp;gt; == DB1 (Gvecs and more) ...&lt;br /&gt;
 &amp;lt;---&amp;gt; ... Database done&lt;br /&gt;
 &amp;lt;---&amp;gt; == DB2 (wavefunctions)  ... done ==&lt;br /&gt;
 &amp;lt;---&amp;gt; == DB3 (PseudoPotential) ... done ==&lt;br /&gt;
 &amp;lt;---&amp;gt;  == P2Y completed ==&lt;br /&gt;
&lt;br /&gt;
This output repeats some information about the system and generates a &#039;&#039;SAVE&#039;&#039; directory:&lt;br /&gt;
 $ ls SAVE&lt;br /&gt;
 ns.db1  ns.wf  ns.kb_pp_pwscf&lt;br /&gt;
 ns.wf_fragments_1_1 ...&lt;br /&gt;
 ns.kb_pp_pwscf_fragment_1 ...&lt;br /&gt;
These files, with an &#039;&#039;n&#039;&#039; prefix, indicate that they are in netCDF format, and thus not human readable. However, they are perfectly transferable across different architectures. &lt;br /&gt;
&lt;br /&gt;
In practice we suggest to move the &#039;&#039;SAVE&#039;&#039; folder into a new clean folder. &lt;br /&gt;
&lt;br /&gt;
In this tutorial however, we ask instead that you continue using a &#039;&#039;SAVE&#039;&#039; folder that we prepared previously:&lt;br /&gt;
 $ cd ../../Optics/YAMBO&lt;br /&gt;
 $ ls&lt;br /&gt;
 SAVE&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
We will start the TDDFT tutorial exactly where standard local approximations for f&amp;lt;sub&amp;gt;xc&amp;lt;/sub&amp;gt; (like ALDA) do not work at all. The optical spectrum of solid&lt;br /&gt;
[[LiF]] &amp;lt;ref name=&amp;quot;wikipedia/&amp;gt; is dominated by a strongly bound exciton (3 eV binding energy) &amp;lt;ref name=&amp;quot;rholf&amp;quot;/&amp;gt; and will immediately see that any independent particle approximation drastically fails to describe the complex structures that are observed experimentally.&lt;br /&gt;
&lt;br /&gt;
[[File:lif_rholf.png|345x289px|Optical absorption of solid LiF. Dots: experiment. Continuous line: BSE. Dashed line: RPA-QP]]&lt;br /&gt;
&lt;br /&gt;
In the following we will describe in detail the different TDDFT related calculations. For each example you can find a link to the Input file with a brief explanation of the variables meaning.&lt;br /&gt;
&lt;br /&gt;
We will also use this first system to explain in detail some of the most relevant technical aspects of yambo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;01&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Initialization (yambo -i -V RL) =&lt;br /&gt;
&lt;br /&gt;
This section describes the standard initialization procedure. As this initialization is common to all yambo runs it will be described extensively only in this case.&lt;br /&gt;
&lt;br /&gt;
To run this example enter the &#039;&#039;YAMBO&#039;&#039; directory (where you have previously created the SAVE folder) and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/01_init -J 01_init&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
and you will see&lt;br /&gt;
&amp;lt;pre&amp;gt; &amp;lt;---&amp;gt; [01] Game Summary&lt;br /&gt;
 &amp;lt;---&amp;gt; [02] Input variables setup&lt;br /&gt;
 &amp;lt;---&amp;gt; RL-shells |                    | [000%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt; RL-shells |####################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt; [02.01] K-grid lattice&lt;br /&gt;
 &amp;lt;---&amp;gt; [02.02] Input (E)nergies[ev] &amp;amp;amp; Occupations&lt;br /&gt;
 &amp;lt;---&amp;gt; [03] Transferred momenta grid: Indexes&lt;br /&gt;
 &amp;lt;---&amp;gt; [04] Game Over &amp;amp;amp; Game summary&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
If now you edit the &#039;&#039;r-01_setup&#039;&#039; you will find a lot of useless ([[File:LiF_smile.gif|60x23px]]) informations about your system like, the Fermi level&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   [02.02] Input (E)nergies[ev] &amp;amp;amp; Occupations&lt;br /&gt;
  ========&lt;br /&gt;
 &lt;br /&gt;
  Fermi Energy[ev] - T[ev/K] :-0.241627  0.000100  1.160400&lt;br /&gt;
  Bands summary              : Full        Empty&lt;br /&gt;
                               0001-0004   0005-0050&lt;br /&gt;
  Indirect Gap  [ev][min-max]:  9.11330  14.79631&amp;lt;/pre&amp;gt;&lt;br /&gt;
confirming that, yes, our bulk LiF is a &#039;&#039;&#039;wide&#039;&#039;&#039; gap insulator. Then you can see the effect of using&lt;br /&gt;
&amp;lt;pre&amp;gt; MaxGvecs=  800           RL  # [INI] Max number of G-vectors planned to use&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
in the &#039;&#039;Inputs/01_init&#039;&#039; file. In the report file we notice that&lt;br /&gt;
&amp;lt;pre&amp;gt;  G-vectors             [RL space]: 1807&lt;br /&gt;
                   [wavefunctions]: 1807&amp;lt;/pre&amp;gt;&lt;br /&gt;
whereas the Reciprocal Space shells found by yambo are&lt;br /&gt;
&amp;lt;pre&amp;gt; G-vector (S)hells. Format: [Snn] G`s&lt;br /&gt;
  [S0030]:   773 [S0029]:   749 [S0028]:   725 [S0027]:   701 [S0026]:   645&lt;br /&gt;
  [S0025]:   609 [S0024]:   561 [S0023]:   537 [S0022]:   531 [S0021]:   459&lt;br /&gt;
  [S0020]:   411 [S0019]:   387 [S0018]:   339 [S0017]:   331 [S0016]:   307&lt;br /&gt;
  [S0015]:   283 [S0014]:   259 [S0013]:   229 [S0012]:   181 [S0011]:   169&lt;br /&gt;
  [S0010]:   137 [S0009]:   113 [S0008]:    89 [S0007]:    65 [S0006]:    59&lt;br /&gt;
  [S0005]:    51 [S0004]:    27 [S0003]:    15 [S0002]:     9 [S0001]:     1&amp;lt;/pre&amp;gt;&lt;br /&gt;
so that the highest number of RL vectors we can use is 773, lower than the charge number given by Abinit and different from the value for &#039;&#039;MaxGvecs&#039;&#039; we provided. This happens because yambo has calculated the Reciprocal Space shells up to 800 to find that the highest closed shell corresponds to 773 RL vectors. Note that, independently of the value you set for any variable that defines a dimension in the RL space, yambo redefines it, in order to match it to the nearest closed shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;02&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span id=&amp;quot;03&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Random-Phase approximation (yambo -o c) (yambo -o c -k hartree) (yambo -o c -k hartree -V qp) =&lt;br /&gt;
&lt;br /&gt;
The simplest approximation that can be used to calculate the absorption spectrum of LiF is the independent particle approximation. This is done in &#039;&#039;Inputs/02_RPA_no_LF&#039;&#039;, that is generated directly by &amp;amp;quot;yambo -o c&amp;amp;quot; command line without specifying an approximation for the kernel (in fact there is no kernel!), To run this example type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/02_RPA_no_LF -J 02_RPA_no_LF&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
The optional &#039;&#039;-J&#039;&#039; flag is used to label the output/report/log files.&lt;br /&gt;
In &#039;&#039;Inputs/03_RPA_LF&#039;&#039; we include a kernel in the Hartree approximation. This correspond to the Random-Phase-Approximation (RPA). The response function size is changed to 51 RL. This means including Local Field Effects corresponding to charge oscillations expanded up to the 51&amp;lt;sup&amp;gt;st&amp;lt;/sup&amp;gt; RL component. The converged value for &#039;&#039;NGsBlkXd&#039;&#039; shall be determined by doing several calculations with different values and checking the effect on the final physical result (the absorption spectrum, in this case).&lt;br /&gt;
&lt;br /&gt;
After having run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/03_RPA_LF -J 03_RPA_LF&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
we can compare the result of our calculations with the experimental curve (that you find in the &#039;&#039;Experiment&#039;&#039; folder).&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_02_03.png|512x384px&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
The comparison with the experiment clearly show that the RPA is not at all adequate in the case of LiF. We notice two main discrepancies between theory and experiment: the RPA absorption onset is too low and the shape lacks the sharp peak observed experimentally at around 12 eV. The onset position can be artificially corrected using a scissor operator (representing the QP gap correction) of 5.19 eV that simply opens rigidly the LDA gap. This is shown in &#039;&#039;Inputs/03_RPA_LF_QP&#039;&#039; with the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;% XfnQP_E&lt;br /&gt;
 5.190000 | 1.000000 | 1.000000 |      # [EXTQP Xd] E parameters (c/v)&lt;br /&gt;
%&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting spectrum fits better with the experiment but now there seems to be an even more serious problem:&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_03.png|512x384px]]&lt;br /&gt;
&lt;br /&gt;
there is an experimental peak well below the QP absorption onset:&lt;br /&gt;
&lt;br /&gt;
an [http://en.wikipedia.org/wiki/Exciton EXCITON!]&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_exciton.jpg|160x202px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;04&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= ALDA (yambo -o c -k alda) =&lt;br /&gt;
&lt;br /&gt;
Our first attempt to go beyond RPA is using TDDFT in the Adiabatic LDA approximation. Depending on the exchange-correlation(xc) functional used in the ground state calculation yambo will produce a corresponding xc-kernel. In this case, as reported by the &#039;&#039;a2y&#039;&#039; command we are using a Perdew Wang parametrization.&lt;br /&gt;
&lt;br /&gt;
Running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/04_alda_g_space -J 04_alda_g_space&amp;lt;/pre&amp;gt;&lt;br /&gt;
we get&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_04.png|512x384px]]&lt;br /&gt;
&lt;br /&gt;
Unfortunately ALDA only slightly changes the RPA result. The situation will change in more isolated system (reduced dimensionality).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;05&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=The Statically screened Electron-electron interaction (yambo -X s) =&lt;br /&gt;
&lt;br /&gt;
As simple RPA and ALDA approximations have not described correctly the experimental spectrum we have to move towards more elaborate techniques like the Bethe-Salpeter (BS) equation.&lt;br /&gt;
&lt;br /&gt;
A key ingredient in the BS kernel is the electron-electron interaction commonly evaluated in the static approximation. The input file &#039;&#039;Inputs/05_W&#039;&#039; describes how to calculate it. The variables used in this input file have the same physical meaning of those used in the optical absorption calculation. The only difference is that, in general, the response function dimension obtained in the examples (03-04), gives an upper bound to the number of RL vectors needed here. This is because the size of response matrix in an RPA calculation defines also the size of the Hartree potential, whose short-range components are not screened. In the present case, instead, the electron-electron interaction is screened and, for this reason, the RL vectors needed are considerably smaller than in the RPA case. So let&#039;s type (no &#039;&#039;-J&#039;&#039; option here) ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/05_W &amp;lt;/pre&amp;gt;&lt;br /&gt;
... and after waiting for some minutes the result, that is the database SAVE/ndb.em1s. Do not use the &#039;&#039;-J&#039;&#039; option here as we will need to read this database in the next examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;06&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=The Bethe-Salpeter equation, Excitons (yambo -o b -k sex -y h) =&lt;br /&gt;
&lt;br /&gt;
The input file &#039;&#039;Inputs/06_BSE&#039;&#039; describes how to calculate an excitonic absorption spectrum, by solving the BS equation using the recursive Haydock Method. Before running &#039;&#039;yambo&#039;&#039; we must have a closer look at the input file:&lt;br /&gt;
&lt;br /&gt;
The line&lt;br /&gt;
&amp;lt;pre&amp;gt;% KfnQP_E&lt;br /&gt;
 5.80000 | 1.000000 | 1.000000 |      # [EXTQP BSK BSS] E parameters (c/v)&lt;br /&gt;
%&amp;lt;/pre&amp;gt;&lt;br /&gt;
applies a 5.8 eV scissor in order to open the LDA gap.&lt;br /&gt;
&amp;lt;pre&amp;gt;BSKmod= &amp;amp;quot;SEX&amp;amp;quot;                # [BSE] IP/Hartree/HF/ALDA/SEX&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we are using the screened exchange (SEX) approximation for the kernel that includes both exchange and correlation terms&lt;br /&gt;
&amp;lt;pre&amp;gt;% BSEBands&lt;br /&gt;
  2 |  7 |                   # [BSK] Bands range&lt;br /&gt;
%&lt;br /&gt;
BSENGBlk=  51            RL  # [BSK] Screened interaction block size&lt;br /&gt;
BSENGexx=  773           RL  # [BSK] Exchange components&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we specify the range of bands to be used and the RL components for the screened interaction (51) (read from the ndb.em1s file) and for the Hartree term (773, the maximal available). &#039;&#039;&#039;Remember&#039;&#039;&#039; that the BS kernel is written in Bloch space and its size is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;BS kernel size = Valence Bands × Conduction Bands  × K-points in the whole BZ&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case the size is 2304. The BS bands range must be converged with care trying to keep as a few bands as possible.&lt;br /&gt;
Running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/06_BSE -J 06_BSE&amp;lt;/pre&amp;gt;&lt;br /&gt;
will calculate the BS kernel and store in in the &#039;&#039;06_BSE&#039;&#039; folder. Before analyzing the BS absorption spectrum we can edit the log file &#039;&#039;l-06_BSE_optics_bse_bss&#039;&#039; to observe the on-the-fly live timing feature of yambo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; [...]&lt;br /&gt;
  &amp;lt;---&amp;gt; BSK |                    | [000%] --(E) --(X)&lt;br /&gt;
 &amp;lt;05s&amp;gt; BSK |#                   | [007%] 05s(E) 01m-07s(X)&lt;br /&gt;
 &amp;lt;11s&amp;gt; BSK |###                 | [015%] 10s(E) 01m-06s(X)&lt;br /&gt;
 [...]&lt;br /&gt;
 &amp;lt;01m-02s&amp;gt; BSK |##################  | [093%] 01m-01s(E) 01m-06s(X)&lt;br /&gt;
 &amp;lt;01m-07s&amp;gt; BSK |####################| [100%] 01m-06s(E) 01m-06s(X)&lt;br /&gt;
 [...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The two numbers at the end of each line represents the elapsed time(E) and the expected time(X). The latter estimates the time needed to complete that particular section (the BS kernel construction in this case).&lt;br /&gt;
&lt;br /&gt;
Finally we can compare the resulting BS optical absorption with the experimental result. We see how strong is the excitonic effect, if compared to the RPA calculation. The BS equation is, then, able to describe the bound electron-hole state responsible for the peak observed experimentally below the QP gap.&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_06.png|512x384px&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;07&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=A Bethe-Salpeter based F&amp;lt;sub&amp;gt;xc&amp;lt;/sub&amp;gt;(yambo -o c -k lrc) =&lt;br /&gt;
&lt;br /&gt;
As for TDDFT we might be a little bit disappointed at this stage as the only method that yields a reasonable absorption spectrum for LiF is based on MBPT. It is possible, however, to extract from the BS kernel a possible approximation for the xc-kernel. This approach is efficient, but is far too complicated, and requires the prior computation of the BS kernel. An alternative possibility is to use a simple Long Range Component model, as introduced in [[#Reining|Reining]]. In this model, the yambo input file &#039;&#039;Inputs/07_LRC&#039;&#039; describes a model where&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_PIC_LiF_equations-14.png|190x55px]]&lt;br /&gt;
with F&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;= &#039;&#039;LRC_alpha&#039;&#039;=-8.7.&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_07.png|512x384px&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
We see from the previous figure that the agreement with the BS calculation is not very good. Nevertheless this simple model captures the presence of an exciton and works quite well for a large number of simple semiconductors, as show in [[#silvana|Botti]]:&lt;br /&gt;
&lt;br /&gt;
[[File:F_silvana.png|371x352px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;exercises&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Additional Exercises =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Calculate the absorption spectra like in section [[#02|02]]-[[#03|03]] increasing the polarization RL size, the polarization bands to find the converged values.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Plot the EELS spectrum obtained in section [[#02|02]]-[[#03|03]] and check the effect of increasing the polarization bands. Do a resonant only calculation (using the -V option) to see that the EELS cannot be described using only the resonant part of the response function.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;See the effect of using a denser BZ sampling grid running Abinit with, for example&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ngkpt2  6 6 6&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Repeat the [[#06|BSE]] calculation increasing the bands.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Calculate the [[#06|BSE]] spectrum using a diagonal only interaction.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;wikipedia&amp;quot;&amp;gt; [http://en.wikipedia.org/wiki/Lithium_fluoride LiF on wikipedia].&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;rholf&amp;quot;&amp;gt; M. Rohlfing, S. Louie, Phys. Rev. Lett. &#039;&#039;&#039;81&#039;&#039;&#039;, 2312 (2000).&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;p1&amp;quot;&amp;gt; A. Marini, R. Del Sole, and A. Rubio, Phys. Rev. Lett., &#039;&#039;&#039;91&#039;&#039;&#039;, 256402 (2003),G. Adragna, R. Del Sole, and A. Marini, Phys. Rev. B &#039;&#039;&#039;68&#039;&#039;&#039;, 165108 (2003), F. Sottile, V. Olevano, and L. Reining, Phys. Rev. Lett. &#039;&#039;&#039;91&#039;&#039;&#039;, 056402 (2003).&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;Reining&amp;quot;&amp;gt;  Reining, V. Olevano, A. Rubio, and G. Onida, Phys. Rev. Lett. &#039;&#039;&#039;88&#039;&#039;&#039;, 066404 (2002).&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;silvana&amp;quot;&amp;gt;  S. Botti, Phys. Rev. B &#039;&#039;&#039;69&#039;&#039;&#039;, 155112 (2004).&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=LiF&amp;diff=5219</id>
		<title>LiF</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=LiF&amp;diff=5219"/>
		<updated>2022-01-12T16:46:42Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* From PWscf to the Yambo core databases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:LiF-crystal.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
= Solid LiF: excitons at work =&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_lif_structure.jpg|LiF structure]]&lt;br /&gt;
&lt;br /&gt;
= The material =&lt;br /&gt;
&lt;br /&gt;
* FCC lattice&lt;br /&gt;
* Two atoms per cell, Li and F (8 electrons)&lt;br /&gt;
* Lattice constant 7.61 [a.u.]&lt;br /&gt;
* Plane waves cutoff 40 Hartree (1800 RL vectors)&lt;br /&gt;
&lt;br /&gt;
= The Tutorial files =&lt;br /&gt;
Follow the instructions in [[Tutorials#Files]] and download/unpack the &amp;lt;code&amp;gt;LiF.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= From PWscf to the Yambo core databases =&lt;br /&gt;
&lt;br /&gt;
 $ cd YAMBO_TUTORIALS/LiF/PWSCF&lt;br /&gt;
 $ ls&lt;br /&gt;
 inputs	outputs  psps&lt;br /&gt;
&lt;br /&gt;
First run the SCF calculation to generate the ground-state charge density, occupations, Fermi level, and so on:&lt;br /&gt;
 $ pw.x &amp;lt; inputs/scf.in &amp;gt; scf.out&lt;br /&gt;
&lt;br /&gt;
Next run a non-SCF calculation to generate a set of Kohn-Sham eigenvalues and eigenvectors for both occupied and unoccupied states (100 bands): &lt;br /&gt;
 $ pw.x &amp;lt; inputs/nscf.in &amp;gt; nscf.out  &lt;br /&gt;
&lt;br /&gt;
Note the presence of the following flags in the input file:&lt;br /&gt;
 wf_collect=.true.&lt;br /&gt;
 force_symmorphic=.true.&lt;br /&gt;
 diago_full_acc=.true.&lt;br /&gt;
which are needed for generating the Yambo databases accurately. Full explanations of these variables are given on the [http://www.quantum-espresso.org/wp-content/uploads/Doc/INPUT_PW.html quantum-ESPRESSO input variables page]. &lt;br /&gt;
&lt;br /&gt;
After these two runs, you should have a &#039;&#039;LiF.save&#039;&#039; directory:&lt;br /&gt;
 $ ls LiF.save&lt;br /&gt;
 charge-density.dat  data-file-schema.xml  F.LDA.cpi.UPF  Li.LDA.cpi.UPF  wfc10.dat  wfc1.dat  wfc2.dat	wfc3.dat  wfc4.dat  wfc5.dat  wfc6.dat	wfc7.dat  wfc8.dat  wfc9.dat&lt;br /&gt;
&lt;br /&gt;
=== Conversion to Yambo format ===&lt;br /&gt;
The PWscf &#039;&#039;LiF.save&#039;&#039; output is converted to the Yambo format using the &amp;lt;code&amp;gt;p2y&amp;lt;/code&amp;gt; executable (pwscf to yambo), found in the yambo &#039;&#039;bin&#039;&#039; directory.&lt;br /&gt;
Enter &#039;&#039;LiF.save&#039;&#039; and launch &amp;lt;code&amp;gt;p2y&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 $ cd LiF.save&lt;br /&gt;
 $ p2y&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;---&amp;gt; DBs path set to .&lt;br /&gt;
 &amp;lt;---&amp;gt; Index file set to data-file.xml&lt;br /&gt;
 &amp;lt;---&amp;gt; Header/K-points/Energies... done&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;---&amp;gt; == DB1 (Gvecs and more) ...&lt;br /&gt;
 &amp;lt;---&amp;gt; ... Database done&lt;br /&gt;
 &amp;lt;---&amp;gt; == DB2 (wavefunctions)  ... done ==&lt;br /&gt;
 &amp;lt;---&amp;gt; == DB3 (PseudoPotential) ... done ==&lt;br /&gt;
 &amp;lt;---&amp;gt;  == P2Y completed ==&lt;br /&gt;
&lt;br /&gt;
This output repeats some information about the system and generates a &#039;&#039;SAVE&#039;&#039; directory:&lt;br /&gt;
 $ ls SAVE&lt;br /&gt;
 ns.db1  ns.wf  ns.kb_pp_pwscf&lt;br /&gt;
 ns.wf_fragments_1_1 ...&lt;br /&gt;
 ns.kb_pp_pwscf_fragment_1 ...&lt;br /&gt;
These files, with an &#039;&#039;n&#039;&#039; prefix, indicate that they are in netCDF format, and thus not human readable. However, they are perfectly transferable across different architectures. &lt;br /&gt;
&lt;br /&gt;
In practice we suggest to move the &#039;&#039;SAVE&#039;&#039; folder into a new clean folder. &lt;br /&gt;
&lt;br /&gt;
In this tutorial however, we ask instead that you continue using a &#039;&#039;SAVE&#039;&#039; folder that we prepared previously:&lt;br /&gt;
 $ cd ../../Optics/YAMBO&lt;br /&gt;
 $ ls&lt;br /&gt;
 SAVE&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
We will start the TDDFT tutorial exactly where standard local approximations for f&amp;lt;sub&amp;gt;xc&amp;lt;/sub&amp;gt; (like ALDA) do not work at all. The optical spectrum of solid&lt;br /&gt;
[[LiF]] &amp;lt;ref name=&amp;quot;wikipedia/&amp;gt; is dominated by a strongly bound exciton (3 eV binding energy) &amp;lt;ref name=&amp;quot;rholf&amp;quot;/&amp;gt; and will immediately see that any independent particle approximation drastically fails to describe the complex structures that are observed experimentally.&lt;br /&gt;
&lt;br /&gt;
[[File:lif_rholf.png|345x289px|Optical absorption of solid LiF. Dots: experiment. Continuous line: BSE. Dashed line: RPA-QP]]&lt;br /&gt;
&lt;br /&gt;
In the following we will describe in detail the different TDDFT related calculations. For each example you can find a link to the Input file with a brief explanation of the variables meaning.&lt;br /&gt;
&lt;br /&gt;
We will also use this first system to explain in detail some of the most relevant technical aspects of yambo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;01&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Initialization (yambo -i -V RL) =&lt;br /&gt;
&lt;br /&gt;
This section describes the standard initialization procedure. As this initialization is common to all yambo runs it will be described extensively only in this case.&lt;br /&gt;
&lt;br /&gt;
To run this example enter the &#039;&#039;YAMBO&#039;&#039; directory (where you have previously created the SAVE folder) and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/01_init -J 01_init&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
and you will see&lt;br /&gt;
&amp;lt;pre&amp;gt; &amp;lt;---&amp;gt; [01] Game Summary&lt;br /&gt;
 &amp;lt;---&amp;gt; [02] Input variables setup&lt;br /&gt;
 &amp;lt;---&amp;gt; RL-shells |                    | [000%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt; RL-shells |####################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;---&amp;gt; [02.01] K-grid lattice&lt;br /&gt;
 &amp;lt;---&amp;gt; [02.02] Input (E)nergies[ev] &amp;amp;amp; Occupations&lt;br /&gt;
 &amp;lt;---&amp;gt; [03] Transferred momenta grid: Indexes&lt;br /&gt;
 &amp;lt;---&amp;gt; [04] Game Over &amp;amp;amp; Game summary&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
If now you edit the &#039;&#039;r-01_setup&#039;&#039; you will find a lot of useless ([[File:LiF_smile.gif|60x23px]]) informations about your system like, the Fermi level&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   [02.02] Input (E)nergies[ev] &amp;amp;amp; Occupations&lt;br /&gt;
  ========&lt;br /&gt;
 &lt;br /&gt;
  Fermi Energy[ev] - T[ev/K] :-0.241627  0.000100  1.160400&lt;br /&gt;
  Bands summary              : Full        Empty&lt;br /&gt;
                               0001-0004   0005-0050&lt;br /&gt;
  Indirect Gap  [ev][min-max]:  9.11330  14.79631&amp;lt;/pre&amp;gt;&lt;br /&gt;
confirming that, yes, our bulk LiF is a &#039;&#039;&#039;wide&#039;&#039;&#039; gap insulator. Then you can see the effect of using&lt;br /&gt;
&amp;lt;pre&amp;gt; MaxGvecs=  800           RL  # [INI] Max number of G-vectors planned to use&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
in the &#039;&#039;Inputs/01_init&#039;&#039; file. In the report file we notice that&lt;br /&gt;
&amp;lt;pre&amp;gt;  G-vectors             [RL space]: 1807&lt;br /&gt;
                   [wavefunctions]: 1807&amp;lt;/pre&amp;gt;&lt;br /&gt;
whereas the Reciprocal Space shells found by yambo are&lt;br /&gt;
&amp;lt;pre&amp;gt; G-vector (S)hells. Format: [Snn] G`s&lt;br /&gt;
  [S0030]:   773 [S0029]:   749 [S0028]:   725 [S0027]:   701 [S0026]:   645&lt;br /&gt;
  [S0025]:   609 [S0024]:   561 [S0023]:   537 [S0022]:   531 [S0021]:   459&lt;br /&gt;
  [S0020]:   411 [S0019]:   387 [S0018]:   339 [S0017]:   331 [S0016]:   307&lt;br /&gt;
  [S0015]:   283 [S0014]:   259 [S0013]:   229 [S0012]:   181 [S0011]:   169&lt;br /&gt;
  [S0010]:   137 [S0009]:   113 [S0008]:    89 [S0007]:    65 [S0006]:    59&lt;br /&gt;
  [S0005]:    51 [S0004]:    27 [S0003]:    15 [S0002]:     9 [S0001]:     1&amp;lt;/pre&amp;gt;&lt;br /&gt;
so that the highest number of RL vectors we can use is 773, lower than the charge number given by Abinit and different from the value for &#039;&#039;MaxGvecs&#039;&#039; we provided. This happens because yambo has calculated the Reciprocal Space shells up to 800 to find that the highest closed shell corresponds to 773 RL vectors. Note that, independently of the value you set for any variable that defines a dimension in the RL space, yambo redefines it, in order to match it to the nearest closed shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;02&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span id=&amp;quot;03&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Random-Phase approximation (yambo -o c) (yambo -o c -k hartree) (yambo -o c -k hartree -V qp) =&lt;br /&gt;
&lt;br /&gt;
The simplest approximation that can be used to calculate the absorption spectrum of LiF is the independent particle approximation. This is done in &#039;&#039;Inputs/02_RPA_no_LF&#039;&#039;, that is generated directly by &amp;amp;quot;yambo -o c&amp;amp;quot; command line without specifying an approximation for the kernel (in fact there is no kernel!), To run this example type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/02_RPA_no_LF -J 02_RPA_no_LF&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
The optional &#039;&#039;-J&#039;&#039; flag is used to label the output/report/log files.&lt;br /&gt;
In &#039;&#039;Inputs/03_RPA_LF&#039;&#039; we include a kernel in the Hartree approximation. This correspond to the Random-Phase-Approximation (RPA). The response function size is changed to 51 RL. This means including Local Field Effects corresponding to charge oscillations expanded up to the 51&amp;lt;sup&amp;gt;st&amp;lt;/sup&amp;gt; RL component. The converged value for &#039;&#039;NGsBlkXd&#039;&#039; shall be determined by doing several calculations with different values and checking the effect on the final physical result (the absorption spectrum, in this case).&lt;br /&gt;
&lt;br /&gt;
After having run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/03_RPA_LF -J 03_RPA_LF&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
we can compare the result of our calculations with the experimental curve (that you find in the &#039;&#039;Experiment&#039;&#039; folder).&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_02_03.png|512x384px&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
The comparison with the experiment clearly show that the RPA is not at all adequate in the case of LiF. We notice two main discrepancies between theory and experiment: the RPA absorption onset is too low and the shape lacks the sharp peak observed experimentally at around 12 eV. The onset position can be artificially corrected using a scissor operator (representing the QP gap correction) of 5.19 eV that simply opens rigidly the LDA gap. This is shown in &#039;&#039;Inputs/03_RPA_LF_QP&#039;&#039; with the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;% XfnQP_E&lt;br /&gt;
 5.190000 | 1.000000 | 1.000000 |      # [EXTQP Xd] E parameters (c/v)&lt;br /&gt;
%&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting spectrum fits better with the experiment but now there seems to be an even more serious problem:&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_03.png|512x384px]]&lt;br /&gt;
&lt;br /&gt;
there is an experimental peak well below the QP absorption onset:&lt;br /&gt;
&lt;br /&gt;
an [http://en.wikipedia.org/wiki/Exciton EXCITON!]&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_exciton.jpg|160x202px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;04&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= ALDA (yambo -o c -k alda) =&lt;br /&gt;
&lt;br /&gt;
Our first attempt to go beyond RPA is using TDDFT in the Adiabatic LDA approximation. Depending on the exchange-correlation(xc) functional used in the ground state calculation yambo will produce a corresponding xc-kernel. In this case, as reported by the &#039;&#039;a2y&#039;&#039; command we are using a Perdew Wang parametrization.&lt;br /&gt;
&lt;br /&gt;
Running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/04_alda_g_space -J 04_alda_g_space&amp;lt;/pre&amp;gt;&lt;br /&gt;
we get&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_04.png|512x384px]]&lt;br /&gt;
&lt;br /&gt;
Unfortunately ALDA only slightly changes the RPA result. The situation will change in more isolated system (reduced dimensionality).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;05&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=The Statically screened Electron-electron interaction(yambo -b) =&lt;br /&gt;
&lt;br /&gt;
As simple RPA and ALDA approximations have not described correctly the experimental spectrum we have to move towards more elaborate techniques like the Bethe-Salpeter (BS) equation.&lt;br /&gt;
&lt;br /&gt;
A key ingredient in the BS kernel is the electron-electron interaction commonly evaluated in the static approximation. The input file &#039;&#039;Inputs/05_W&#039;&#039; describes how to calculate it. The variables used in this input file have the same physical meaning of those used in the optical absorption calculation. The only difference is that, in general, the response function dimension obtained in the examples (03-04), gives an upper bound to the number of RL vectors needed here. This is because the size of response matrix in an RPA calculation defines also the size of the Hartree potential, whose short-range components are not screened. In the present case, instead, the electron-electron interaction is screened and, for this reason, the RL vectors needed are considerably smaller than in the RPA case. So let&#039;s type (no &#039;&#039;-J&#039;&#039; option here) ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/05_W &amp;lt;/pre&amp;gt;&lt;br /&gt;
... and after waiting for some minutes the result, that is the database SAVE/ndb.em1s. Do not use the &#039;&#039;-J&#039;&#039; option here as we will need to read this database in the next examples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;06&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=The Bethe-Salpeter equation, Excitons (yambo -o b -k sex -y h) =&lt;br /&gt;
&lt;br /&gt;
The input file &#039;&#039;Inputs/06_BSE&#039;&#039; describes how to calculate an excitonic absorption spectrum, by solving the BS equation using the recursive Haydock Method. Before running &#039;&#039;yambo&#039;&#039; we must have a closer look at the input file:&lt;br /&gt;
&lt;br /&gt;
The line&lt;br /&gt;
&amp;lt;pre&amp;gt;% KfnQP_E&lt;br /&gt;
 5.80000 | 1.000000 | 1.000000 |      # [EXTQP BSK BSS] E parameters (c/v)&lt;br /&gt;
%&amp;lt;/pre&amp;gt;&lt;br /&gt;
applies a 5.8 eV scissor in order to open the LDA gap.&lt;br /&gt;
&amp;lt;pre&amp;gt;BSKmod= &amp;amp;quot;SEX&amp;amp;quot;                # [BSE] IP/Hartree/HF/ALDA/SEX&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we are using the screened exchange (SEX) approximation for the kernel that includes both exchange and correlation terms&lt;br /&gt;
&amp;lt;pre&amp;gt;% BSEBands&lt;br /&gt;
  2 |  7 |                   # [BSK] Bands range&lt;br /&gt;
%&lt;br /&gt;
BSENGBlk=  51            RL  # [BSK] Screened interaction block size&lt;br /&gt;
BSENGexx=  773           RL  # [BSK] Exchange components&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we specify the range of bands to be used and the RL components for the screened interaction (51) (read from the ndb.em1s file) and for the Hartree term (773, the maximal available). &#039;&#039;&#039;Remember&#039;&#039;&#039; that the BS kernel is written in Bloch space and its size is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;BS kernel size = Valence Bands × Conduction Bands  × K-points in the whole BZ&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case the size is 2304. The BS bands range must be converged with care trying to keep as a few bands as possible.&lt;br /&gt;
Running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; localhost:&amp;gt;yambo -F Inputs/06_BSE -J 06_BSE&amp;lt;/pre&amp;gt;&lt;br /&gt;
will calculate the BS kernel and store in in the &#039;&#039;06_BSE&#039;&#039; folder. Before analyzing the BS absorption spectrum we can edit the log file &#039;&#039;l-06_BSE_optics_bse_bss&#039;&#039; to observe the on-the-fly live timing feature of yambo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; [...]&lt;br /&gt;
  &amp;lt;---&amp;gt; BSK |                    | [000%] --(E) --(X)&lt;br /&gt;
 &amp;lt;05s&amp;gt; BSK |#                   | [007%] 05s(E) 01m-07s(X)&lt;br /&gt;
 &amp;lt;11s&amp;gt; BSK |###                 | [015%] 10s(E) 01m-06s(X)&lt;br /&gt;
 [...]&lt;br /&gt;
 &amp;lt;01m-02s&amp;gt; BSK |##################  | [093%] 01m-01s(E) 01m-06s(X)&lt;br /&gt;
 &amp;lt;01m-07s&amp;gt; BSK |####################| [100%] 01m-06s(E) 01m-06s(X)&lt;br /&gt;
 [...]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The two numbers at the end of each line represents the elapsed time(E) and the expected time(X). The latter estimates the time needed to complete that particular section (the BS kernel construction in this case).&lt;br /&gt;
&lt;br /&gt;
Finally we can compare the resulting BS optical absorption with the experimental result. We see how strong is the excitonic effect, if compared to the RPA calculation. The BS equation is, then, able to describe the bound electron-hole state responsible for the peak observed experimentally below the QP gap.&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_06.png|512x384px&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;07&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=A Bethe-Salpeter based F&amp;lt;sub&amp;gt;xc&amp;lt;/sub&amp;gt;(yambo -o c -k lrc) =&lt;br /&gt;
&lt;br /&gt;
As for TDDFT we might be a little bit disappointed at this stage as the only method that yields a reasonable absorption spectrum for LiF is based on MBPT. It is possible, however, to extract from the BS kernel a possible approximation for the xc-kernel. This approach is efficient, but is far too complicated, and requires the prior computation of the BS kernel. An alternative possibility is to use a simple Long Range Component model, as introduced in [[#Reining|Reining]]. In this model, the yambo input file &#039;&#039;Inputs/07_LRC&#039;&#039; describes a model where&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_PIC_LiF_equations-14.png|190x55px]]&lt;br /&gt;
with F&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;= &#039;&#039;LRC_alpha&#039;&#039;=-8.7.&lt;br /&gt;
&lt;br /&gt;
[[File:LiF_07.png|512x384px&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
We see from the previous figure that the agreement with the BS calculation is not very good. Nevertheless this simple model captures the presence of an exciton and works quite well for a large number of simple semiconductors, as show in [[#silvana|Botti]]:&lt;br /&gt;
&lt;br /&gt;
[[File:F_silvana.png|371x352px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;exercises&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Additional Exercises =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Calculate the absorption spectra like in section [[#02|02]]-[[#03|03]] increasing the polarization RL size, the polarization bands to find the converged values.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Plot the EELS spectrum obtained in section [[#02|02]]-[[#03|03]] and check the effect of increasing the polarization bands. Do a resonant only calculation (using the -V option) to see that the EELS cannot be described using only the resonant part of the response function.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;See the effect of using a denser BZ sampling grid running Abinit with, for example&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ngkpt2  6 6 6&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Repeat the [[#06|BSE]] calculation increasing the bands.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Calculate the [[#06|BSE]] spectrum using a diagonal only interaction.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;wikipedia&amp;quot;&amp;gt; [http://en.wikipedia.org/wiki/Lithium_fluoride LiF on wikipedia].&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;rholf&amp;quot;&amp;gt; M. Rohlfing, S. Louie, Phys. Rev. Lett. &#039;&#039;&#039;81&#039;&#039;&#039;, 2312 (2000).&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;p1&amp;quot;&amp;gt; A. Marini, R. Del Sole, and A. Rubio, Phys. Rev. Lett., &#039;&#039;&#039;91&#039;&#039;&#039;, 256402 (2003),G. Adragna, R. Del Sole, and A. Marini, Phys. Rev. B &#039;&#039;&#039;68&#039;&#039;&#039;, 165108 (2003), F. Sottile, V. Olevano, and L. Reining, Phys. Rev. Lett. &#039;&#039;&#039;91&#039;&#039;&#039;, 056402 (2003).&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;Reining&amp;quot;&amp;gt;  Reining, V. Olevano, A. Rubio, and G. Onida, Phys. Rev. Lett. &#039;&#039;&#039;88&#039;&#039;&#039;, 066404 (2002).&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;silvana&amp;quot;&amp;gt;  S. Botti, Phys. Rev. B &#039;&#039;&#039;69&#039;&#039;&#039;, 155112 (2004).&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5186</id>
		<title>Some hints on github</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5186"/>
		<updated>2022-01-07T10:53:04Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) The easiest way to switch branch on Git is : git checkout &amp;lt;desired_branch&amp;gt;&lt;br /&gt;
2) Before starting working on your own code/branch type &#039;&#039;&#039;git pull&#039;&#039;&#039;, to ensure that your work will be later merged to the updated version of the code. &lt;br /&gt;
&lt;br /&gt;
3) Whenever you edit subroutines and other files, and if you desire that your changes do not get lost, prepare a commit file.&lt;br /&gt;
*) In order to set the proper layout for the commit type ./sbin/git_configure_and_hooks.sh&lt;br /&gt;
*) Then type:  &#039;&#039;&#039;git commit -a&#039;&#039;&#039; &lt;br /&gt;
*) Edit the file accordingly, pointing out your most important changes.&lt;br /&gt;
&lt;br /&gt;
4) &#039;&#039;&#039;Git push&#039;&#039;&#039;, is the command to save a record of your work.&lt;br /&gt;
&lt;br /&gt;
5) If you are interested in comparing your last downloaded version of the branch with a previous one, type&lt;br /&gt;
git log | less  → you will have a list of modified files and identify the “long alphanumerical string”  on the right of the word commit.&lt;br /&gt;
git diff &amp;quot;long alphanumerical string” &amp;gt; a → It is better to redirect the outcome to a file called here “a”&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5114</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5114"/>
		<updated>2021-06-18T07:31:58Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you are about to start a new project with Yambo, you will be interested in knowing how to move the first steps in the code:&lt;br /&gt;
&lt;br /&gt;
1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. NP_PROJ = yambo_&#039;&#039;&#039;np&#039;&#039;&#039;  ypp_&#039;&#039;&#039;np&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
DF_PROJ  = yambo_df  ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &amp;lt;code&amp;gt;config/mk/actions/compile_yambo.mk&amp;lt;/code&amp;gt;  and &amp;lt;code&amp;gt;config/mk/actions/compile_ypp.mk&amp;lt;/code&amp;gt;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
 yambo_df: ext-libs&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
          ADF=&amp;quot;-D_DF -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DF -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
          @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
          ADF=&amp;quot;-D_DF -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DF -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DF -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DF -D_YPP_SC&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DF -D_YPP_SC&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &amp;lt;code&amp;gt;config/mk/libraries.mk&amp;lt;/code&amp;gt;  by adding the libraries you need for your project, for example in this example we will use the main libs, plus &amp;quot;hamiltonian&amp;quot; and &amp;quot;sc&amp;quot;:&lt;br /&gt;
 &lt;br /&gt;
 PJ_DFLIBS    = $(MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 PJ_DFLIBS_LD = $(MAIN_LIBS_LD) hamiltonian collisions sc&lt;br /&gt;
&lt;br /&gt;
in the same you set also the libraries for ypp:&lt;br /&gt;
&lt;br /&gt;
 YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) edit the file &amp;lt;code&amp;gt;driver/.objects&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 objs = yambo.o&lt;br /&gt;
 #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl &#039;&#039;&#039;|| _ypp_df&#039;&#039;&#039;&lt;br /&gt;
 objs = ypp.o&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
5) Edit the file: lib/yambo/driver/src/main/tool_init.c&lt;br /&gt;
&lt;br /&gt;
    #if defined _YPP_DF || defined _DF&lt;br /&gt;
    pj=&amp;quot;df&amp;quot;;&lt;br /&gt;
    #endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5113</id>
		<title>How to create a new ypp interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5113"/>
		<updated>2021-06-18T07:29:57Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The choice for “section” and the “short_opt” comes from an analysis of the outcome of “ypp_df -h”&lt;br /&gt;
&lt;br /&gt;
0) Adding an option in ypp.in input file:&lt;br /&gt;
Edit the file src/driver/options_ypp.c&lt;br /&gt;
&lt;br /&gt;
 #if defined _DF&lt;br /&gt;
 *i_opt=*i_opt+1;&lt;br /&gt;
 options[*i_opt].short_desc=&amp;quot;Write_here_a_short_description_of_the_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].long_opt=  &amp;quot;short_name_of_your_new_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].short_opt=&#039;d&#039;;      &lt;br /&gt;
 options[*i_opt].bin=&amp;quot;associated_executable&amp;quot;;  % for example ypp_df&lt;br /&gt;
 options[*i_opt].yambo_string=&amp;quot;short_name_of_your_new_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].section=&amp;quot;Choose_your_section&amp;quot;;  &lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file.&lt;br /&gt;
&lt;br /&gt;
1) Edit the file  ypp/modules/mod_YPP.F&lt;br /&gt;
&lt;br /&gt;
   logical            :: l_defects&lt;br /&gt;
   character(lchlen)  :: superc_path&lt;br /&gt;
&lt;br /&gt;
2) Initialize the non logical variable in ypp/modules/YPP_SET_defaults.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
   !&lt;br /&gt;
   superc_path=&#039;none&#039;&lt;br /&gt;
   !&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
3) Edit ypp/interface/INIT_load_ypp.F in order to instruct the code to switch on the flag in the ypp.in input file&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    use YPPm,          ONLY:superc_path&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    call it(defs,&#039;SupercPATH&#039;,  &#039;Path to the supercell with defect&#039;,superc_path)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
4) Edit ypp/interface/INIT_ypp.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     l_defects   =  trim(rstr_piece(i1)) == &#039;dsuperc&#039;&lt;br /&gt;
   #endif&lt;br /&gt;
Notice that ‘dsuperc’ has been introduced in options_ypp.c. So if the code “sees” this flag it associates .true. to the logical l_defects.&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if (l_defects)       call initactivate(1,&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    l_defects=runlevel_is_on(&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if(l_defects) call initactivate(1,&amp;quot;SupercPATH&amp;quot;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
5) Create directory ypp/defects/ and the file .objects:&lt;br /&gt;
   &lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     DF_objects = DEFECTS_driver.o&lt;br /&gt;
   #endif&lt;br /&gt;
    objs = $(DF_objects)&lt;br /&gt;
&lt;br /&gt;
and then DEFECTS_driver.F:&lt;br /&gt;
   &lt;br /&gt;
   subroutine DEFECTS_driver(en,k)&lt;br /&gt;
   !&lt;br /&gt;
   use R_lattice,      ONLY:bz_samp&lt;br /&gt;
   use electrons,      ONLY:levels&lt;br /&gt;
   !&lt;br /&gt;
   #include&amp;lt;memory.h&amp;gt;&lt;br /&gt;
   !&lt;br /&gt;
   type(levels)  :: en&lt;br /&gt;
   type(bz_samp) :: k&lt;br /&gt;
   end subroutine &lt;br /&gt;
&lt;br /&gt;
Finally &amp;quot;git add defects&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
   YPPDF_LIBS         = $(YPP_LIBS) defects&lt;br /&gt;
   YPPDF_LIBS_LD      = $(YPP_LIBS_LD) defects&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5055</id>
		<title>Some hints on github</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5055"/>
		<updated>2021-05-17T14:35:55Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Before starting working on your own code/branch type &#039;&#039;&#039;git pull&#039;&#039;&#039;, to ensure that your work will be later merged to the updated version of the code. &lt;br /&gt;
&lt;br /&gt;
2) Whenever you edit subroutines and other files, and if you desire that your changes do not get lost, prepare a commit file.&lt;br /&gt;
*) In order to set the proper layout for the commit type ./sbin/git_configure_and_hooks.sh&lt;br /&gt;
*) Then type:  &#039;&#039;&#039;git commit -a&#039;&#039;&#039; &lt;br /&gt;
*) Edit the file accordingly, pointing out your most important changes.&lt;br /&gt;
&lt;br /&gt;
3) &#039;&#039;&#039;Git push&#039;&#039;&#039;, is the command to save a record of your work.&lt;br /&gt;
&lt;br /&gt;
4) If you are interested in comparing your last downloaded version of the branch with a previous one, type&lt;br /&gt;
git log | less  → you will have a list of modified files and identify the “long alphanumerical string”  on the right of the word commit.&lt;br /&gt;
git diff &amp;quot;long alphanumerical string” &amp;gt; a → It is better to redirect the outcome to a file called here “a”&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5054</id>
		<title>Some hints on github</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5054"/>
		<updated>2021-05-17T14:32:42Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Whenever you edit subroutines and other files, and if you desire that your changes do not get lost, prepare a commit file.&lt;br /&gt;
*) In order to set the proper layout for the commit type ./sbin/git_configure_and_hooks.sh&lt;br /&gt;
*) Then type:  &#039;&#039;&#039;git commit -a&#039;&#039;&#039; &lt;br /&gt;
*) Edit the file accordingly, pointing out your most important changes.&lt;br /&gt;
&lt;br /&gt;
2) &#039;&#039;&#039;Git push&#039;&#039;&#039;, is the command to save a record of your work.&lt;br /&gt;
&lt;br /&gt;
3) Before starting working on your own code/branch type &#039;&#039;&#039;git pull&#039;&#039;&#039;, to ensure that your work will be later merged to the updated version of the code. &lt;br /&gt;
&lt;br /&gt;
4) If you are interested in comparing your last downloaded version of the branch with a previous one, type&lt;br /&gt;
git log | less  → you will have a list of modified files and identify the “long alphanumerical string”  on the right of the word commit.&lt;br /&gt;
git diff &amp;quot;long alphanumerical string” &amp;gt; a → It is better to redirect the outcome to a file called here “a”&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5053</id>
		<title>Some hints on github</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5053"/>
		<updated>2021-05-17T14:30:59Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Whenever you edit subroutines and other files, and if you desire that your changes do not get lost, prepare a commit file.&lt;br /&gt;
*) In order to set the proper layout for the commit: ./sbin/git_configure_and_hooks.sh&lt;br /&gt;
*) Then type:  git commit -a &lt;br /&gt;
*) Edit the file accordingly, pointing out your most important changes.&lt;br /&gt;
&lt;br /&gt;
2) Git push, is the command to save a record of your work.&lt;br /&gt;
&lt;br /&gt;
3) Before starting working on your own code/branch please type: git pull, to ensure that your work will be later merged to the updated version of the code. &lt;br /&gt;
&lt;br /&gt;
4) If you are interested in comparing your last downloaded version of the branch with a previous one, type&lt;br /&gt;
git log | less  → you will have a list of modified files and identify the “long alphanumerical string”  on the right of the word commit.&lt;br /&gt;
git diff “long alphanumerical string” &amp;gt; a → It is better to redirect the outcome to a file called here “a”&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5052</id>
		<title>Some hints on github</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Some_hints_on_github&amp;diff=5052"/>
		<updated>2021-05-17T14:28:07Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: Created page with &amp;quot;2) Whenever you edit subroutines and other files, and if you desire that your changes do not get lost, prepare a commit file. *) In order to set the proper layout for the comm...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;2) Whenever you edit subroutines and other files, and if you desire that your changes do not get lost, prepare a commit file.&lt;br /&gt;
*) In order to set the proper layout for the commit: ./sbin/git_configure_and_hooks.sh&lt;br /&gt;
*) Then type:  git commit -a &lt;br /&gt;
*) Edit the file accordingly, pointing out your most important changes.&lt;br /&gt;
&lt;br /&gt;
3) Git push, is the command to save a record of your work.&lt;br /&gt;
&lt;br /&gt;
4) Before starting working on your own code/branch please type: git pull, to ensure that your work will be later merged to the updated version of the code. &lt;br /&gt;
&lt;br /&gt;
5) If you are interested in comparing your last downloaded version of the branch with a previous one, type&lt;br /&gt;
git log | less  → you will have a list of modified files and identify the “long alphanumerical string”  on the right of the word commit.&lt;br /&gt;
git diff “long alphanumerical string” &amp;gt; a → It is better to redirect the outcome to a file called here “a”&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Tutorials&amp;diff=5051</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Tutorials&amp;diff=5051"/>
		<updated>2021-05-17T14:27:40Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- &#039;&#039;&#039;ICTP students should start [[ICTP2020|HERE]]&#039;&#039;&#039;  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are starting out with Yambo, or even an experienced user, we recommend that you complete the following tutorials before trying to use Yambo for your system.&lt;br /&gt;
&lt;br /&gt;
The tutorials are meant to give some introductory background to the key concepts behind Yambo. Practical topics such as convergence are also discussed. &lt;br /&gt;
Nonetheless, users are invited to first read and study the [[lectures|background material]] in order to get familiar with the fundamental physical quantities.&lt;br /&gt;
&lt;br /&gt;
Two kinds of tutorials are provided: &#039;&#039;&#039;stand-alone&#039;&#039;&#039; and &#039;&#039;&#039;modular&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Tutorial files ==&lt;br /&gt;
&lt;br /&gt;
The tutorial CORE databases can be obtained&lt;br /&gt;
&lt;br /&gt;
* from the [[Yambo_Virtual_Machine|Yambo Virtual Machine]] &lt;br /&gt;
* from the Yambo web-page&lt;br /&gt;
* from the Yambo GIT tutorial repository &lt;br /&gt;
&lt;br /&gt;
=== From the Yambo Virtual Machine (VM)  ===&lt;br /&gt;
If you are using the VM, a recent version of the tutorial files is provided.Follow these [[Yambo_Virtual_Machine#Updating_the_Yambo_tutorial_files| instructions]] to update the tutorial files to the most recent version.&lt;br /&gt;
&lt;br /&gt;
=== From the Yambo website ===&lt;br /&gt;
If you are using your own installation or the docker, the files needed to run the tutorials can be downloaded from the lists below. &lt;br /&gt;
&lt;br /&gt;
After downloading the tar.gz files just unpack them in &#039;&#039;&#039;the YAMBO_TUTORIALS&#039;&#039;&#039; folder. For example&lt;br /&gt;
 $ mkdir YAMBO_TUTORIALS&lt;br /&gt;
 $ mv hBN.tar.gz YAMBO_TUTORIALS&lt;br /&gt;
 $ cd YAMBO_TUTORIALS&lt;br /&gt;
 $ tar -xvfz hBN.tar.gz&lt;br /&gt;
 $ ls YAMBO_TUTORIALS&lt;br /&gt;
   hBN&lt;br /&gt;
&lt;br /&gt;
====Files needed for modular tutorials====&lt;br /&gt;
All of the following should be downloaded prior to following the modular tutorials:&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN.tar.gz hBN.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-convergence-kpoints.tar.gz hBN-convergence-kpoints.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-2D.tar.gz hBN-2D.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-2D-para.tar.gz hBN-2D-para.tar.gz],&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN_DBs.tar.gz hBN_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-convergence-kpoints_DBs.tar.gz hBN-convergence-kpoints_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-2D_DBs.tar.gz hBN-2D_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-2D-para_DBs.tar.gz hBN-2D-para_DBs.tar.gz]&lt;br /&gt;
&lt;br /&gt;
====Files needed for stand-alone tutorials====&lt;br /&gt;
At the start of each tutorial you will be told which specific file needs to be downloaded:&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Silicon.tar.gz Silicon.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/LiF.tar.gz LiF.tar.gz]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Silicon_DBs.tar.gz Silicon_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/LiF_DBs.tar.gz LiF_DBs.tar.gz],&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Si_surface.tar.gz Si_surface.tar.gz]&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Si_wire.tar.gz Si_wire.tar.gz]&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/H2.tar.gz H2.tar.gz]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Aluminum.tar.gz Aluminum.tar.gz],&lt;br /&gt;
&amp;lt;!--[http://www.yambo-code.org/educational/tutorials/files/GaSb.tar.gz GaSb.tar.gz]--&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Hydrogen_Chain.tar.gz Hydrogen_Chain.tar.gz]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Aluminum_DBs.tar.gz Aluminum_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Hydrogen_Chain_DBs.tar.gz Hydrogen_Chain_DBs.tar.gz]&lt;br /&gt;
&lt;br /&gt;
=== From the Git Tutorial Repository (advanced users) ===&lt;br /&gt;
If you are using your own installation or the docker, the [https://github.com/yambo-code/tutorials tutorials repository] contains the updated tutorials CORE databases. To use it&lt;br /&gt;
 $ git clone https://github.com/yambo-code/tutorials.git YAMBO_TUTORIALS&lt;br /&gt;
 $ cd YAMBO_TUTORIALS&lt;br /&gt;
 $ ./setup.pl -install&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;Stand-alone overview&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Stand-alone tutorials ==&lt;br /&gt;
&lt;br /&gt;
These tutorials are self-contained and cover a variety of mixed topics, both physical and methodological. They are designed to be followed from start to finish in one page and do not require previous knowledge of yambo. Each tutorial requires download of a specific core database, and typically they cover a specific physical system (like bulk GaSb or a hydrogen chain). Ground state input files and pseudopotentials are provided. Output files are also provided for reference.&lt;br /&gt;
&lt;br /&gt;
These tutorials can be accessed directly from this page of from the side bar. They include different kind of subjects:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These tutorials were prepared using previous version of the Yambo code: some command lines, variables, reports and outputs can be  slightly different from the last version of the code.  Scripts for parsing output cannot work anymore and should be edited to work with the new outputs. New command lines can be accessed typing &amp;lt;code&amp;gt;yambo -h &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Basic ===&lt;br /&gt;
* [[LiF|Linear Response in 3D. Excitons at work]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* [[Si_Surface|Linear Response in 2D]]&lt;br /&gt;
* [[Si_wire|Linear Response in 1D]]&lt;br /&gt;
* [[H2|Linear Response in 0D]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[Silicon|GW convergence]]&lt;br /&gt;
&lt;br /&gt;
=== Advanced ===&lt;br /&gt;
* [[Hydrogen chain|TDDFT Failure and long range correlations]]&lt;br /&gt;
* [[Linear response from real time simulations]]&lt;br /&gt;
&lt;br /&gt;
==== GW and Quasi-particles ====&lt;br /&gt;
&lt;br /&gt;
* [[Real_Axis_and_Lifetimes|Real Axis and Lifetimes]]&lt;br /&gt;
* [[Self-consistent GW on eigenvalues only]]&lt;br /&gt;
&lt;br /&gt;
==== Electron phonon coupling ====&lt;br /&gt;
* [[Electron Phonon Coupling|Electron Phonon Coupling]]&lt;br /&gt;
* [[Optical properties at finite temperature]]&lt;br /&gt;
&lt;br /&gt;
==== Non linear response ====&lt;br /&gt;
&lt;br /&gt;
* [http://www.attaccalite.com/lumen/linear_response.html Linear response using Dynamical Berry phase]&lt;br /&gt;
* [[Real time approach to non-linear response]]&lt;br /&gt;
* [[Correlation effects in the non-linear response]]&lt;br /&gt;
* [http://www.attaccalite.com/lumen/thg_in_silicon.html Third Harmonic Generation]&lt;br /&gt;
* [http://www.attaccalite.com/lumen/spin_orbit.html Spin-orbit coupling and non-linear response]&lt;br /&gt;
&lt;br /&gt;
==== Developing Yambo ====&lt;br /&gt;
&lt;br /&gt;
* [[How to create a new project in Yambo]]&lt;br /&gt;
* [[How to create a new ypp interface]]&lt;br /&gt;
* [[Some hints on github]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
* [[SOC|Spin-Orbit Coupling MBPT]]&lt;br /&gt;
* [[Kerr|Kerr]]&lt;br /&gt;
* [[Real_Time|Real-Time]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For each TUTORIAL (Solid_LiF, Solid_Al, ...) , therefore, you can download the ground state files (zip archive named TUTORIAL_ground_state.zip) and generate the Yambo databases from your own by running abinit/PWscf and a2y/p2y. In this case the Yambo input and reference files are contained in the zip file (TUTORIAL_reference_files.zip). Alternatively, if (and only if) you have compiled yambo with the NetCDF support you can directly download the zip files containing the Yambo core databases (TUTORIAL_NETCDF_databases_and_reference_files.zip). These are generated using the NetCDF interface in order to be readable in any platform.&lt;br /&gt;
After you have downloaded the tutorial zip files and unziped them you should have now a tutorial tree:&lt;br /&gt;
localhost:&amp;gt; ls &lt;br /&gt;
YAMBO_TUTORIALS/&lt;br /&gt;
localhost:&amp;gt; ls  YAMBO_TUTORIALS/&lt;br /&gt;
COPYING  Fantastic_Dimensions/  Hydrogen_Chain/  README  Solid_LiF/ Solid_Al/ SiH4/ ...&lt;br /&gt;
In each folder you will find an Abinit or Pwscf subfolder in case you have downloaded the ground state zip files and the YAMBO subfolder. The tutorials start by entering the YAMBO subfolder and followinf the informations provided in the tutorial documentation.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;Modular overview&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Modular tutorials ==&lt;br /&gt;
These tutorials are designed to provide a deeper understanding of specific yambo tasks and runlevels. They are designed to avoid repetition of common procedures and physical concepts. As such, they make use of the same physical systems: bulk hexagonal boron nitride &#039;&#039;hBN&#039;&#039; and a hBN sheet &#039;&#039;hBN-2D&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These tutorials were prepared using previous version of the Yambo code: some command lines, variables, reports and outputs can be  slightly different from the last version of the code.  Scripts for parsing output cannot work anymore and should be edited to work with the new outputs. New command lines can be accessed typing &amp;lt;code&amp;gt;yambo -h &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
* [[First steps: a walk through from DFT to optical properties]]&lt;br /&gt;
====Quasiparticles in the GW approximation====&lt;br /&gt;
* [[How to obtain the quasi-particle band structure of a bulk material: h-BN]]&lt;br /&gt;
====Using Yambo in Parallel====&lt;br /&gt;
This modules contains very general discussions of the parallel environment of Yambo. Still the actual run of the code is specific to the CECAM cluster. If you want to run these modules just replace the parallel queue instructions with simple MPI commands.&lt;br /&gt;
&lt;br /&gt;
* [[GW_parallel_strategies|Parallel GW (CECAM specific)]]: strategies for running Yambo in parallel&lt;br /&gt;
[[GW_parallel_strategies_CECAM]]&lt;br /&gt;
* [[Pushing_convergence_in_parallel|GW convergence (CECAM specific)]]: use Yambo in parallel to converge a GW calculation for a layer of hBN (hBN-2D)&lt;br /&gt;
&lt;br /&gt;
====Excitons and the Bethe-Salpeter Equation====&lt;br /&gt;
* [[How to obtain an optical spectrum|Calculating optical spectra including excitonic effects: a step-by-step guide]]&lt;br /&gt;
* [[How to choose the input parameters|Obtaining a converged optical spectrum]] &lt;br /&gt;
* [[How to treat low dimensional systems|Many-body effects in low-dimensional systems: numerical issues and remedies]] &lt;br /&gt;
* [[How to analyse excitons|Analysis of excitonic spectra in a 2D material]]&lt;br /&gt;
&amp;lt;!--* [[Two particle excitations]] (try to bypass this page) : Learn how to set up and run calculations to obtain and analyze an optical absorption spectrum of bulk and low dimension materials by using the Bethe-Salpeter equation--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Yambo-python driver====&lt;br /&gt;
* [[First steps in Yambopy]]&lt;br /&gt;
* [[GW tutorial. Convergence and approximations (BN)]]&lt;br /&gt;
* [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
====Real-time simulations====&lt;br /&gt;
* [[Breaking of symmetries]]&lt;br /&gt;
* [[Independent-Particle Approximation Dynamics. Delta Pulse]]&lt;br /&gt;
* [[Post-processing. Optical Response]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Instructions for CECAM students]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modules ===&lt;br /&gt;
Alternatively, users can learn more about a specific runlevel or task by looking at the individual &#039;&#039;&#039;[[Modules|documentation modules]]&#039;&#039;&#039;. These provide a focus on the input parameters, run time behaviour, and underlying physics. Although they can be followed separately, non-experts are urged to follow them as part of the more structured tutorials given above.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;Schools&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Schools ==&lt;br /&gt;
&lt;br /&gt;
* [[ICTP2020]]&lt;br /&gt;
* [[CECAM VIRTUAL 2021]]&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5038</id>
		<title>How to create a new ypp interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5038"/>
		<updated>2021-05-07T21:41:33Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The choice for “section” and the “short_opt” comes from an analysis of the outcome of “ypp_df -h”&lt;br /&gt;
&lt;br /&gt;
0) Adding an option in ypp.in input file:&lt;br /&gt;
Edit the file src/driver/options_ypp.c&lt;br /&gt;
&lt;br /&gt;
 #if defined _YPP_DF&lt;br /&gt;
 *i_opt=*i_opt+1;&lt;br /&gt;
 options[*i_opt].short_desc=&amp;quot;Write_here_a_short_description_of_the_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].long_opt=  &amp;quot;short_name_of_your_new_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].short_opt=&#039;d&#039;;      &lt;br /&gt;
 options[*i_opt].bin=&amp;quot;associated_executable&amp;quot;;  % for example ypp_df&lt;br /&gt;
 options[*i_opt].yambo_string=&amp;quot;short_name_of_your_new_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].section=&amp;quot;Choose_your_section&amp;quot;;  &lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file.&lt;br /&gt;
&lt;br /&gt;
1) Edit the file  ypp/modules/mod_YPP.F&lt;br /&gt;
&lt;br /&gt;
   logical            :: l_defects&lt;br /&gt;
   character(lchlen)  :: superc_path&lt;br /&gt;
&lt;br /&gt;
2) Initialize the non logical variable in ypp/modules/YPP_SET_defaults.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
   !&lt;br /&gt;
   superc_path=&#039;none&#039;&lt;br /&gt;
   !&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
3) Edit ypp/interface/INIT_load_ypp.F in order to instruct the code to switch on the flag in the ypp.in input file&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    use YPPm,          ONLY:superc_path&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    call it(defs,&#039;SupercPATH&#039;,  &#039;Path to the supercell with defect&#039;,superc_path)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
4) Edit ypp/interface/INIT_ypp.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     l_defects   =  trim(rstr_piece(i1)) == &#039;dsuperc&#039;&lt;br /&gt;
   #endif&lt;br /&gt;
Notice that ‘dsuperc’ has been introduced in options_ypp.c. So if the code “sees” this flag it associates .true. to the logical l_defects.&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if (l_defects)       call initactivate(1,&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    l_defects=runlevel_is_on(&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if(l_defects) call initactivate(1,&amp;quot;SupercPATH&amp;quot;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
5) Create directory ypp/defects/ and the file .objects:&lt;br /&gt;
   &lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     DF_objects = DEFECTS_driver.o&lt;br /&gt;
   #endif&lt;br /&gt;
    objs = $(DF_objects)&lt;br /&gt;
&lt;br /&gt;
and then DEFECTS_driver.F:&lt;br /&gt;
   &lt;br /&gt;
   subroutine DEFECTS_driver(en,k)&lt;br /&gt;
   !&lt;br /&gt;
   use R_lattice,      ONLY:bz_samp&lt;br /&gt;
   use electrons,      ONLY:levels&lt;br /&gt;
   !&lt;br /&gt;
   #include&amp;lt;memory.h&amp;gt;&lt;br /&gt;
   !&lt;br /&gt;
   type(levels)  :: en&lt;br /&gt;
   type(bz_samp) :: k&lt;br /&gt;
   end subroutine &lt;br /&gt;
&lt;br /&gt;
Finally &amp;quot;git add defects&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
   YPPDF_LIBS         = $(YPP_LIBS) defects&lt;br /&gt;
   YPPDF_LIBS_LD      = $(YPP_LIBS_LD) defects&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5037</id>
		<title>How to create a new ypp interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5037"/>
		<updated>2021-05-07T21:40:59Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The choice for “section” and the “short_opt” comes from an analysis of the outcome of “ypp_df -h”&lt;br /&gt;
&lt;br /&gt;
0) Adding an option in ypp.in input file:&lt;br /&gt;
 Edit the file src/driver/options_ypp.c&lt;br /&gt;
&lt;br /&gt;
 #if defined _YPP_DF&lt;br /&gt;
 *i_opt=*i_opt+1;&lt;br /&gt;
 options[*i_opt].short_desc=&amp;quot;Write_here_a_short_description_of_the_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].long_opt=  &amp;quot;short_name_of_your_new_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].short_opt=&#039;d&#039;;      &lt;br /&gt;
 options[*i_opt].bin=&amp;quot;associated_executable&amp;quot;;  % for example ypp_df&lt;br /&gt;
 options[*i_opt].yambo_string=&amp;quot;short_name_of_your_new_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].section=&amp;quot;Choose_your_section&amp;quot;;  &lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file.&lt;br /&gt;
&lt;br /&gt;
1) Edit the file  ypp/modules/mod_YPP.F&lt;br /&gt;
&lt;br /&gt;
   logical            :: l_defects&lt;br /&gt;
   character(lchlen)  :: superc_path&lt;br /&gt;
&lt;br /&gt;
2) Initialize the non logical variable in ypp/modules/YPP_SET_defaults.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
   !&lt;br /&gt;
   superc_path=&#039;none&#039;&lt;br /&gt;
   !&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
3) Edit ypp/interface/INIT_load_ypp.F in order to instruct the code to switch on the flag in the ypp.in input file&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    use YPPm,          ONLY:superc_path&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    call it(defs,&#039;SupercPATH&#039;,  &#039;Path to the supercell with defect&#039;,superc_path)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
4) Edit ypp/interface/INIT_ypp.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     l_defects   =  trim(rstr_piece(i1)) == &#039;dsuperc&#039;&lt;br /&gt;
   #endif&lt;br /&gt;
Notice that ‘dsuperc’ has been introduced in options_ypp.c. So if the code “sees” this flag it associates .true. to the logical l_defects.&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if (l_defects)       call initactivate(1,&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    l_defects=runlevel_is_on(&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if(l_defects) call initactivate(1,&amp;quot;SupercPATH&amp;quot;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
5) Create directory ypp/defects/ and the file .objects:&lt;br /&gt;
   &lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     DF_objects = DEFECTS_driver.o&lt;br /&gt;
   #endif&lt;br /&gt;
    objs = $(DF_objects)&lt;br /&gt;
&lt;br /&gt;
and then DEFECTS_driver.F:&lt;br /&gt;
   &lt;br /&gt;
   subroutine DEFECTS_driver(en,k)&lt;br /&gt;
   !&lt;br /&gt;
   use R_lattice,      ONLY:bz_samp&lt;br /&gt;
   use electrons,      ONLY:levels&lt;br /&gt;
   !&lt;br /&gt;
   #include&amp;lt;memory.h&amp;gt;&lt;br /&gt;
   !&lt;br /&gt;
   type(levels)  :: en&lt;br /&gt;
   type(bz_samp) :: k&lt;br /&gt;
   end subroutine &lt;br /&gt;
&lt;br /&gt;
Finally &amp;quot;git add defects&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
   YPPDF_LIBS         = $(YPP_LIBS) defects&lt;br /&gt;
   YPPDF_LIBS_LD      = $(YPP_LIBS_LD) defects&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5036</id>
		<title>How to create a new ypp interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5036"/>
		<updated>2021-05-07T21:39:51Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The choice for “section” and the “short_opt” comes from an analysis of the outcome of “ypp_df -h”&lt;br /&gt;
&lt;br /&gt;
0) Adding an option in ypp.in input file:&lt;br /&gt;
 Edit the file src/driver/options_ypp.c&lt;br /&gt;
&lt;br /&gt;
 #if defined _YPP_DF&lt;br /&gt;
 *i_opt=*i_opt+1;&lt;br /&gt;
 options[*i_opt].short_desc=&amp;quot;Write_here_a_short_description_of_the_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].long_opt=  &amp;quot;short_name_of_your_new_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].short_opt=&#039;d&#039;;      &lt;br /&gt;
 options[*i_opt].bin=&amp;quot;associated_executable&amp;quot;;  % for example ypp_df&lt;br /&gt;
 options[*i_opt].yambo_string=&amp;quot;short_name_of_your_new_flag&amp;quot;;&lt;br /&gt;
 options[*i_opt].section=&amp;quot;Choose_your_section&amp;quot;;  &lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file.&lt;br /&gt;
&lt;br /&gt;
1) Edit the file  ypp/modules/mod_YPP.F&lt;br /&gt;
&lt;br /&gt;
   logical            :: l_defects&lt;br /&gt;
   character(lchlen)  :: superc_path&lt;br /&gt;
&lt;br /&gt;
2) Initialize the non logical variable in ypp/modules/YPP_SET_defaults.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
   !&lt;br /&gt;
   superc_path=&#039;none&#039;&lt;br /&gt;
   !&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
3) Edit ypp/interface/INIT_load_ypp.F in order to instruct the code to switch on the flag in the ypp.in input file&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    use YPPm,          ONLY:superc_path&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    call it(defs,&#039;SupercPATH&#039;,  &#039;Path to the supercell with defect&#039;,superc_path)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
4) Edit ypp/interface/INIT_ypp.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     l_defects   =  trim(rstr_piece(i1)) == &#039;dsuperc&#039;&lt;br /&gt;
   #endif&lt;br /&gt;
Notice that ‘dsuperc’ has been introduced in options_ypp.c. So if the code “sees” this flag it associates .true. to the logical l_defects.&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if (l_defects)       call initactivate(1,&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    l_defects=runlevel_is_on(&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if(l_defects) call initactivate(1,&amp;quot;SupercPATH&amp;quot;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
5) Create directory ypp/defects/ and the file .objects:&lt;br /&gt;
   &lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     DF_objects = DEFECTS_driver.o&lt;br /&gt;
   #endif&lt;br /&gt;
    objs = $(DF_objects)&lt;br /&gt;
&lt;br /&gt;
and then DEFECTS_driver.F:&lt;br /&gt;
   &lt;br /&gt;
   subroutine DEFECTS_driver(en,k)&lt;br /&gt;
   !&lt;br /&gt;
   use R_lattice,      ONLY:bz_samp&lt;br /&gt;
   use electrons,      ONLY:levels&lt;br /&gt;
   !&lt;br /&gt;
   #include&amp;lt;memory.h&amp;gt;&lt;br /&gt;
   !&lt;br /&gt;
   type(levels)  :: en&lt;br /&gt;
   type(bz_samp) :: k&lt;br /&gt;
   end subroutine &lt;br /&gt;
&lt;br /&gt;
Finally &amp;quot;git add defects&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
   YPPDF_LIBS         = $(YPP_LIBS) defects&lt;br /&gt;
   YPPDF_LIBS_LD      = $(YPP_LIBS_LD) defects&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5035</id>
		<title>How to create a new ypp interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5035"/>
		<updated>2021-05-07T21:34:37Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file.&lt;br /&gt;
&lt;br /&gt;
1) Edit the file  ypp/modules/mod_YPP.F&lt;br /&gt;
&lt;br /&gt;
   logical            :: l_defects&lt;br /&gt;
   character(lchlen)  :: superc_path&lt;br /&gt;
&lt;br /&gt;
2) Initialize the non logical variable in ypp/modules/YPP_SET_defaults.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
   !&lt;br /&gt;
   superc_path=&#039;none&#039;&lt;br /&gt;
   !&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
3) Edit ypp/interface/INIT_load_ypp.F in order to instruct the code to switch on the flag in the ypp.in input file&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    use YPPm,          ONLY:superc_path&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    call it(defs,&#039;SupercPATH&#039;,  &#039;Path to the supercell with defect&#039;,superc_path)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
4) Edit ypp/interface/INIT_ypp.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     l_defects   =  trim(rstr_piece(i1)) == &#039;dsuperc&#039;&lt;br /&gt;
   #endif&lt;br /&gt;
Notice that ‘dsuperc’ has been introduced in options_ypp.c. So if the code “sees” this flag it associates .true. to the logical l_defects.&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if (l_defects)       call initactivate(1,&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    l_defects=runlevel_is_on(&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if(l_defects) call initactivate(1,&amp;quot;SupercPATH&amp;quot;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
5) Create directory ypp/defects/ and the file .objects:&lt;br /&gt;
   &lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     DF_objects = DEFECTS_driver.o&lt;br /&gt;
   #endif&lt;br /&gt;
    objs = $(DF_objects)&lt;br /&gt;
&lt;br /&gt;
and then DEFECTS_driver.F:&lt;br /&gt;
   &lt;br /&gt;
   subroutine DEFECTS_driver(en,k)&lt;br /&gt;
   !&lt;br /&gt;
   use R_lattice,      ONLY:bz_samp&lt;br /&gt;
   use electrons,      ONLY:levels&lt;br /&gt;
   !&lt;br /&gt;
   #include&amp;lt;memory.h&amp;gt;&lt;br /&gt;
   !&lt;br /&gt;
   type(levels)  :: en&lt;br /&gt;
   type(bz_samp) :: k&lt;br /&gt;
   end subroutine &lt;br /&gt;
&lt;br /&gt;
Finally &amp;quot;git add defects&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
   YPPDF_LIBS         = $(YPP_LIBS) defects&lt;br /&gt;
   YPPDF_LIBS_LD      = $(YPP_LIBS_LD) defects&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5034</id>
		<title>How to create a new ypp interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_ypp_interface&amp;diff=5034"/>
		<updated>2021-05-07T21:32:21Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: Created page with &amp;quot;Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file.  1) Edit the file  ypp/modules/mod_YPP.F     logical...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file.&lt;br /&gt;
&lt;br /&gt;
1) Edit the file  ypp/modules/mod_YPP.F&lt;br /&gt;
&lt;br /&gt;
   logical            :: l_defects&lt;br /&gt;
   character(lchlen)  :: superc_path&lt;br /&gt;
&lt;br /&gt;
2) Initialize the non logical variable in ypp/modules/YPP_SET_defaults.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
   !&lt;br /&gt;
   superc_path=&#039;none&#039;&lt;br /&gt;
   !&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
3) Edit ypp/interface/INIT_load_ypp.F in order to instruct the code to switch on the flag in the ypp.in input file&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    use YPPm,          ONLY:superc_path&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    call it(defs,&#039;SupercPATH&#039;,  &#039;Path to the supercell with defect&#039;,superc_path)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
4) Edit ypp/interface/INIT_ypp.F&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     l_defects   =  trim(rstr_piece(i1)) == &#039;dsuperc&#039;&lt;br /&gt;
   #endif&lt;br /&gt;
Notice that ‘dsuperc’ has been introduced in options_ypp.c. So if the code “sees” this flag it associates .true. to the logical l_defects.&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if (l_defects)       call initactivate(1,&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    l_defects=runlevel_is_on(&#039;dsuperc&#039;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
    if(l_defects) call initactivate(1,&amp;quot;SupercPATH&amp;quot;)&lt;br /&gt;
   #endif&lt;br /&gt;
&lt;br /&gt;
5) Create directory ypp/defects/ and the file .objects:&lt;br /&gt;
   &lt;br /&gt;
   #if defined _YPP_DF&lt;br /&gt;
     DF_objects = DEFECTS_driver.o&lt;br /&gt;
   #endif&lt;br /&gt;
    objs = $(DF_objects)&lt;br /&gt;
&lt;br /&gt;
and then DEFECTS_driver.F &lt;br /&gt;
&lt;br /&gt;
Finally &amp;quot;git add defects&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
   YPPDF_LIBS         = $(YPP_LIBS) defects&lt;br /&gt;
   YPPDF_LIBS_LD      = $(YPP_LIBS_LD) defects&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Tutorials&amp;diff=5033</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Tutorials&amp;diff=5033"/>
		<updated>2021-05-07T21:29:13Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- &#039;&#039;&#039;ICTP students should start [[ICTP2020|HERE]]&#039;&#039;&#039;  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are starting out with Yambo, or even an experienced user, we recommend that you complete the following tutorials before trying to use Yambo for your system.&lt;br /&gt;
&lt;br /&gt;
The tutorials are meant to give some introductory background to the key concepts behind Yambo. Practical topics such as convergence are also discussed. &lt;br /&gt;
Nonetheless, users are invited to first read and study the [[lectures|background material]] in order to get familiar with the fundamental physical quantities.&lt;br /&gt;
&lt;br /&gt;
Two kinds of tutorials are provided: &#039;&#039;&#039;stand-alone&#039;&#039;&#039; and &#039;&#039;&#039;modular&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Tutorial files ==&lt;br /&gt;
&lt;br /&gt;
The tutorial CORE databases can be obtained&lt;br /&gt;
&lt;br /&gt;
* from the [[Yambo_Virtual_Machine|Yambo Virtual Machine]] &lt;br /&gt;
* from the Yambo web-page&lt;br /&gt;
* from the Yambo GIT tutorial repository &lt;br /&gt;
&lt;br /&gt;
=== From the Yambo Virtual Machine (VM)  ===&lt;br /&gt;
If you are using the VM, a recent version of the tutorial files is provided.Follow these [[Yambo_Virtual_Machine#Updating_the_Yambo_tutorial_files| instructions]] to update the tutorial files to the most recent version.&lt;br /&gt;
&lt;br /&gt;
=== From the Yambo website ===&lt;br /&gt;
If you are using your own installation or the docker, the files needed to run the tutorials can be downloaded from the lists below. &lt;br /&gt;
&lt;br /&gt;
After downloading the tar.gz files just unpack them in &#039;&#039;&#039;the YAMBO_TUTORIALS&#039;&#039;&#039; folder. For example&lt;br /&gt;
 $ mkdir YAMBO_TUTORIALS&lt;br /&gt;
 $ mv hBN.tar.gz YAMBO_TUTORIALS&lt;br /&gt;
 $ cd YAMBO_TUTORIALS&lt;br /&gt;
 $ tar -xvfz hBN.tar.gz&lt;br /&gt;
 $ ls YAMBO_TUTORIALS&lt;br /&gt;
   hBN&lt;br /&gt;
&lt;br /&gt;
====Files needed for modular tutorials====&lt;br /&gt;
All of the following should be downloaded prior to following the modular tutorials:&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN.tar.gz hBN.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-convergence-kpoints.tar.gz hBN-convergence-kpoints.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-2D.tar.gz hBN-2D.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-2D-para.tar.gz hBN-2D-para.tar.gz],&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN_DBs.tar.gz hBN_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-convergence-kpoints_DBs.tar.gz hBN-convergence-kpoints_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-2D_DBs.tar.gz hBN-2D_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/hBN-2D-para_DBs.tar.gz hBN-2D-para_DBs.tar.gz]&lt;br /&gt;
&lt;br /&gt;
====Files needed for stand-alone tutorials====&lt;br /&gt;
At the start of each tutorial you will be told which specific file needs to be downloaded:&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Silicon.tar.gz Silicon.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/LiF.tar.gz LiF.tar.gz]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Silicon_DBs.tar.gz Silicon_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/LiF_DBs.tar.gz LiF_DBs.tar.gz],&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Si_surface.tar.gz Si_surface.tar.gz]&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Si_wire.tar.gz Si_wire.tar.gz]&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/H2.tar.gz H2.tar.gz]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Aluminum.tar.gz Aluminum.tar.gz],&lt;br /&gt;
&amp;lt;!--[http://www.yambo-code.org/educational/tutorials/files/GaSb.tar.gz GaSb.tar.gz]--&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Hydrogen_Chain.tar.gz Hydrogen_Chain.tar.gz]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Aluminum_DBs.tar.gz Aluminum_DBs.tar.gz],&lt;br /&gt;
[http://www.yambo-code.org/educational/tutorials/files/Hydrogen_Chain_DBs.tar.gz Hydrogen_Chain_DBs.tar.gz]&lt;br /&gt;
&lt;br /&gt;
=== From the Git Tutorial Repository (advanced users) ===&lt;br /&gt;
If you are using your own installation or the docker, the [https://github.com/yambo-code/tutorials tutorials repository] contains the updated tutorials CORE databases. To use it&lt;br /&gt;
 $ git clone https://github.com/yambo-code/tutorials.git YAMBO_TUTORIALS&lt;br /&gt;
 $ cd YAMBO_TUTORIALS&lt;br /&gt;
 $ ./setup.pl -install&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;Stand-alone overview&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Stand-alone tutorials ==&lt;br /&gt;
&lt;br /&gt;
These tutorials are self-contained and cover a variety of mixed topics, both physical and methodological. They are designed to be followed from start to finish in one page and do not require previous knowledge of yambo. Each tutorial requires download of a specific core database, and typically they cover a specific physical system (like bulk GaSb or a hydrogen chain). Ground state input files and pseudopotentials are provided. Output files are also provided for reference.&lt;br /&gt;
&lt;br /&gt;
These tutorials can be accessed directly from this page of from the side bar. They include different kind of subjects:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These tutorials were prepared using previous version of the Yambo code: some command lines, variables, reports and outputs can be  slightly different from the last version of the code.  Scripts for parsing output cannot work anymore and should be edited to work with the new outputs. New command lines can be accessed typing &amp;lt;code&amp;gt;yambo -h &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Basic ===&lt;br /&gt;
* [[LiF|Linear Response in 3D. Excitons at work]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* [[Si_Surface|Linear Response in 2D]]&lt;br /&gt;
* [[Si_wire|Linear Response in 1D]]&lt;br /&gt;
* [[H2|Linear Response in 0D]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[Silicon|GW convergence]]&lt;br /&gt;
&lt;br /&gt;
=== Advanced ===&lt;br /&gt;
* [[Hydrogen chain|TDDFT Failure and long range correlations]]&lt;br /&gt;
* [[Linear response from real time simulations]]&lt;br /&gt;
&lt;br /&gt;
==== GW and Quasi-particles ====&lt;br /&gt;
&lt;br /&gt;
* [[Real_Axis_and_Lifetimes|Real Axis and Lifetimes]]&lt;br /&gt;
* [[Self-consistent GW on eigenvalues only]]&lt;br /&gt;
&lt;br /&gt;
==== Electron phonon coupling ====&lt;br /&gt;
* [[Electron Phonon Coupling|Electron Phonon Coupling]]&lt;br /&gt;
* [[Optical properties at finite temperature]]&lt;br /&gt;
&lt;br /&gt;
==== Non linear response ====&lt;br /&gt;
&lt;br /&gt;
* [http://www.attaccalite.com/lumen/linear_response.html Linear response using Dynamical Berry phase]&lt;br /&gt;
* [[Real time approach to non-linear response]]&lt;br /&gt;
* [[Correlation effects in the non-linear response]]&lt;br /&gt;
* [http://www.attaccalite.com/lumen/thg_in_silicon.html Third Harmonic Generation]&lt;br /&gt;
* [http://www.attaccalite.com/lumen/spin_orbit.html Spin-orbit coupling and non-linear response]&lt;br /&gt;
&lt;br /&gt;
==== Developing Yambo ====&lt;br /&gt;
&lt;br /&gt;
* [[How to create a new project in Yambo]]&lt;br /&gt;
* [[How to create a new ypp interface]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
* [[SOC|Spin-Orbit Coupling MBPT]]&lt;br /&gt;
* [[Kerr|Kerr]]&lt;br /&gt;
* [[Real_Time|Real-Time]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For each TUTORIAL (Solid_LiF, Solid_Al, ...) , therefore, you can download the ground state files (zip archive named TUTORIAL_ground_state.zip) and generate the Yambo databases from your own by running abinit/PWscf and a2y/p2y. In this case the Yambo input and reference files are contained in the zip file (TUTORIAL_reference_files.zip). Alternatively, if (and only if) you have compiled yambo with the NetCDF support you can directly download the zip files containing the Yambo core databases (TUTORIAL_NETCDF_databases_and_reference_files.zip). These are generated using the NetCDF interface in order to be readable in any platform.&lt;br /&gt;
After you have downloaded the tutorial zip files and unziped them you should have now a tutorial tree:&lt;br /&gt;
localhost:&amp;gt; ls &lt;br /&gt;
YAMBO_TUTORIALS/&lt;br /&gt;
localhost:&amp;gt; ls  YAMBO_TUTORIALS/&lt;br /&gt;
COPYING  Fantastic_Dimensions/  Hydrogen_Chain/  README  Solid_LiF/ Solid_Al/ SiH4/ ...&lt;br /&gt;
In each folder you will find an Abinit or Pwscf subfolder in case you have downloaded the ground state zip files and the YAMBO subfolder. The tutorials start by entering the YAMBO subfolder and followinf the informations provided in the tutorial documentation.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;Modular overview&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Modular tutorials ==&lt;br /&gt;
These tutorials are designed to provide a deeper understanding of specific yambo tasks and runlevels. They are designed to avoid repetition of common procedures and physical concepts. As such, they make use of the same physical systems: bulk hexagonal boron nitride &#039;&#039;hBN&#039;&#039; and a hBN sheet &#039;&#039;hBN-2D&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These tutorials were prepared using previous version of the Yambo code: some command lines, variables, reports and outputs can be  slightly different from the last version of the code.  Scripts for parsing output cannot work anymore and should be edited to work with the new outputs. New command lines can be accessed typing &amp;lt;code&amp;gt;yambo -h &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
* [[First steps: a walk through from DFT to optical properties]]&lt;br /&gt;
====Quasiparticles in the GW approximation====&lt;br /&gt;
* [[How to obtain the quasi-particle band structure of a bulk material: h-BN]]&lt;br /&gt;
====Using Yambo in Parallel====&lt;br /&gt;
This modules contains very general discussions of the parallel environment of Yambo. Still the actual run of the code is specific to the CECAM cluster. If you want to run these modules just replace the parallel queue instructions with simple MPI commands.&lt;br /&gt;
&lt;br /&gt;
* [[GW_parallel_strategies|Parallel GW (CECAM specific)]]: strategies for running Yambo in parallel&lt;br /&gt;
[[GW_parallel_strategies_CECAM]]&lt;br /&gt;
* [[Pushing_convergence_in_parallel|GW convergence (CECAM specific)]]: use Yambo in parallel to converge a GW calculation for a layer of hBN (hBN-2D)&lt;br /&gt;
&lt;br /&gt;
====Excitons and the Bethe-Salpeter Equation====&lt;br /&gt;
* [[How to obtain an optical spectrum|Calculating optical spectra including excitonic effects: a step-by-step guide]]&lt;br /&gt;
* [[How to choose the input parameters|Obtaining a converged optical spectrum]] &lt;br /&gt;
* [[How to treat low dimensional systems|Many-body effects in low-dimensional systems: numerical issues and remedies]] &lt;br /&gt;
* [[How to analyse excitons|Analysis of excitonic spectra in a 2D material]]&lt;br /&gt;
&amp;lt;!--* [[Two particle excitations]] (try to bypass this page) : Learn how to set up and run calculations to obtain and analyze an optical absorption spectrum of bulk and low dimension materials by using the Bethe-Salpeter equation--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Yambo-python driver====&lt;br /&gt;
* [[First steps in Yambopy]]&lt;br /&gt;
* [[GW tutorial. Convergence and approximations (BN)]]&lt;br /&gt;
* [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
====Real-time simulations====&lt;br /&gt;
* [[Breaking of symmetries]]&lt;br /&gt;
* [[Independent-Particle Approximation Dynamics. Delta Pulse]]&lt;br /&gt;
* [[Post-processing. Optical Response]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Instructions for CECAM students]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modules ===&lt;br /&gt;
Alternatively, users can learn more about a specific runlevel or task by looking at the individual &#039;&#039;&#039;[[Modules|documentation modules]]&#039;&#039;&#039;. These provide a focus on the input parameters, run time behaviour, and underlying physics. Although they can be followed separately, non-experts are urged to follow them as part of the more structured tutorials given above.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;Schools&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;Schools ==&lt;br /&gt;
&lt;br /&gt;
* [[ICTP2020]]&lt;br /&gt;
* [[CECAM VIRTUAL 2021]]&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5032</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5032"/>
		<updated>2021-05-07T12:53:53Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you are about to start a new project with Yambo, you will be interested in knowing how to move the first steps in the code:&lt;br /&gt;
&lt;br /&gt;
1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. NP_PROJ = yambo_&#039;&#039;&#039;np&#039;&#039;&#039;  ypp_&#039;&#039;&#039;np&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
DF_PROJ  = yambo_df  ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &amp;lt;code&amp;gt;config/mk/actions/compile_yambo.mk&amp;lt;/code&amp;gt;  and &amp;lt;code&amp;gt;config/mk/actions/compile_ypp.mk&amp;lt;/code&amp;gt;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
 yambo_df: ext-libs&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
          ADF=&amp;quot;-D_DF -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DF -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
          @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
          ADF=&amp;quot;-D_DF -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DF -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DF -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DF&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DF&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &amp;lt;code&amp;gt;config/mk/libraries.mk&amp;lt;/code&amp;gt;  by adding the libraries you need for your project, for example in this example we will use the main libs, plus &amp;quot;hamiltonian&amp;quot; and &amp;quot;sc&amp;quot;:&lt;br /&gt;
 &lt;br /&gt;
 PJ_DFLIBS    = $(MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 PJ_DFLIBS_LD = $(MAIN_LIBS_LD) hamiltonian collisions sc&lt;br /&gt;
&lt;br /&gt;
in the same you set also the libraries for ypp:&lt;br /&gt;
&lt;br /&gt;
 YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) edit the file &amp;lt;code&amp;gt;driver/.objects&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 objs = yambo.o&lt;br /&gt;
 #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl &#039;&#039;&#039;|| _ypp_df&#039;&#039;&#039;&lt;br /&gt;
 objs = ypp.o&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
5) Edit the file: lib/yambo/driver/src/main/tool_init.c&lt;br /&gt;
&lt;br /&gt;
    #if defined _YPP_DF || defined _DF&lt;br /&gt;
    pj=&amp;quot;df&amp;quot;;&lt;br /&gt;
    #endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5031</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5031"/>
		<updated>2021-05-07T12:53:27Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you are about to start a new project with Yambo, you will be interested in knowing how to move the first steps in the code:&lt;br /&gt;
&lt;br /&gt;
1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. NP_PROJ = yambo_&#039;&#039;&#039;np&#039;&#039;&#039;  ypp_&#039;&#039;&#039;np&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
DF_PROJ  = yambo_df  ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &amp;lt;code&amp;gt;config/mk/actions/compile_yambo.mk&amp;lt;/code&amp;gt;  and &amp;lt;code&amp;gt;config/mk/actions/compile_ypp.mk&amp;lt;/code&amp;gt;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
 yambo_df: ext-libs&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
          ADF=&amp;quot;-D_DF -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DF -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
          @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
          ADF=&amp;quot;-D_DF -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DF -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DF -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DF&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DF&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &amp;lt;code&amp;gt;config/mk/libraries.mk&amp;lt;/code&amp;gt;  by adding the libraries you need for your project, for example in this example we will use the main libs, plus &amp;quot;hamiltonian&amp;quot; and &amp;quot;sc&amp;quot;:&lt;br /&gt;
 &lt;br /&gt;
 PJ_DFLIBS    = $(MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 PJ_DFLIBS_LD = $(MAIN_LIBS_LD) hamiltonian collisions sc&lt;br /&gt;
&lt;br /&gt;
in the same you set also the libraries for ypp:&lt;br /&gt;
&lt;br /&gt;
 YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) edit the file &amp;lt;code&amp;gt;driver/.objects&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 objs = yambo.o&lt;br /&gt;
 #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl &#039;&#039;&#039;|| _ypp_df&#039;&#039;&#039;&lt;br /&gt;
 objs = ypp.o&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
5) Edit the file: lib/yambo/driver/src/main/tool_init.c&lt;br /&gt;
#if defined _YPP_DF || defined _DF&lt;br /&gt;
 pj=&amp;quot;df&amp;quot;;&lt;br /&gt;
#endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5030</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5030"/>
		<updated>2021-05-07T12:50:34Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you are about to start a new project with Yambo, you will be interested in knowing how to move the first steps in the code:&lt;br /&gt;
&lt;br /&gt;
1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. NP_PROJ = yambo_&#039;&#039;&#039;np&#039;&#039;&#039;  ypp_&#039;&#039;&#039;np&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
DF_PROJ  = yambo_df  ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &amp;lt;code&amp;gt;config/mk/actions/compile_yambo.mk&amp;lt;/code&amp;gt;  and &amp;lt;code&amp;gt;config/mk/actions/compile_ypp.mk&amp;lt;/code&amp;gt;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
 yambo_df: ext-libs&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
          ADF=&amp;quot;-D_DF -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DF -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
          @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
          ADF=&amp;quot;-D_DF -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DF -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DF -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DF&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DF&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &amp;lt;code&amp;gt;config/mk/libraries.mk&amp;lt;/code&amp;gt;  by adding the libraries you need for your project, for example in this example we will use the main libs, plus &amp;quot;hamiltonian&amp;quot; and &amp;quot;sc&amp;quot;:&lt;br /&gt;
 &lt;br /&gt;
 PJ_DFLIBS    = $(MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 PJ_DFLIBS_LD = $(MAIN_LIBS_LD) hamiltonian collisions sc&lt;br /&gt;
&lt;br /&gt;
in the same you set also the libraries for ypp:&lt;br /&gt;
&lt;br /&gt;
 YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) edit the file &amp;lt;code&amp;gt;driver/.objects&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 objs = yambo.o&lt;br /&gt;
 #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl &#039;&#039;&#039;|| _ypp_df&#039;&#039;&#039;&lt;br /&gt;
 objs = ypp.o&lt;br /&gt;
 #endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5029</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5029"/>
		<updated>2021-05-07T12:33:56Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you are about to start a new project with Yambo, you will be interested in knowing how to move the first steps in the code:&lt;br /&gt;
&lt;br /&gt;
1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. NP_PROJ = yambo_&#039;&#039;&#039;np&#039;&#039;&#039;  ypp_&#039;&#039;&#039;np&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
DF_PROJ  = yambo_df  ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &amp;lt;code&amp;gt;config/mk/actions/compile_yambo.mk&amp;lt;/code&amp;gt;  and &amp;lt;code&amp;gt;config/mk/actions/compile_ypp.mk&amp;lt;/code&amp;gt;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
 yambo_df: ext-libs&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
          ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
          @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
          @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
          ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &amp;lt;code&amp;gt;config/mk/libraries.mk&amp;lt;/code&amp;gt;  by adding the libraries you need for your project, for example in this example we will use the main libs, plus &amp;quot;hamiltonian&amp;quot; and &amp;quot;sc&amp;quot;:&lt;br /&gt;
 &lt;br /&gt;
 PJ_DFLIBS    = $(MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 PJ_DFLIBS_LD = $(MAIN_LIBS_LD) hamiltonian collisions sc&lt;br /&gt;
&lt;br /&gt;
in the same you set also the libraries for ypp:&lt;br /&gt;
&lt;br /&gt;
 YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
 YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) edit the file &amp;lt;code&amp;gt;driver/.objects&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 objs = yambo.o&lt;br /&gt;
 #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl &#039;&#039;&#039;|| _ypp_df&#039;&#039;&#039;&lt;br /&gt;
 objs = ypp.o&lt;br /&gt;
 #endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5020</id>
		<title>Developers Corner</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5020"/>
		<updated>2021-05-04T21:08:37Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: /* Development Repositories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Development Repositories ==&lt;br /&gt;
** [[Test-suite-simple|Test-suite (for dummies)]]&lt;br /&gt;
** [[Test-suite | Test-suite]]&lt;br /&gt;
** [[Benchmark-suite | Benchmark-suite]]&lt;br /&gt;
** [[Educational]]&lt;br /&gt;
* Special pages&lt;br /&gt;
** [[Special:AllPages | All Pages]]&lt;br /&gt;
** [[MediaWiki:Sidebar | Side Bar]]&lt;br /&gt;
** [[under construction | Html2Wiki HOWTO]]&lt;br /&gt;
** [[How to create a new project in Yambo]]&lt;br /&gt;
** [https://en.wikipedia.org/wiki/Help:Wikitext Wikitext Help]&lt;br /&gt;
&lt;br /&gt;
== Reducing the size of the VM image ==&lt;br /&gt;
Open a terminal in the VM and type&lt;br /&gt;
&lt;br /&gt;
 sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k&lt;br /&gt;
 sudo rm -rf /bigemptyfile&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How2NP&amp;diff=5019</id>
		<title>How2NP</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How2NP&amp;diff=5019"/>
		<updated>2021-05-04T21:07:57Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: ElenaCannuccia moved page How2NP to How to create a new project in Yambo: wrong title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[How to create a new project in Yambo]]&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5018</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5018"/>
		<updated>2021-05-04T21:07:57Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: ElenaCannuccia moved page How2NP to How to create a new project in Yambo: wrong title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. NP_PROJ = yambo_np  ypp_np&lt;br /&gt;
&lt;br /&gt;
Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
DF_PROJ  = yambo_df  ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &#039;&#039;&#039;config/mk/actions/compile_yambo.mk&#039;&#039;&#039;  and &#039;&#039;&#039;config/mk/actions/compile_ypp.mk&#039;&#039;&#039;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
        yambo_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
        @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &#039;&#039;&#039;config/mk/libraries.mk&#039;&#039;&#039;   by adding&lt;br /&gt;
&lt;br /&gt;
        YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
        YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) Edit the file driver/.objects&lt;br /&gt;
&lt;br /&gt;
        objs = yambo.o&lt;br /&gt;
        #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl &#039;&#039;&#039;|| _ypp_df&#039;&#039;&#039;&lt;br /&gt;
        objs = ypp.o&lt;br /&gt;
        #endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5017</id>
		<title>Developers Corner</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5017"/>
		<updated>2021-05-04T21:06:57Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Development Repositories ==&lt;br /&gt;
** [[Test-suite-simple|Test-suite (for dummies)]]&lt;br /&gt;
** [[Test-suite | Test-suite]]&lt;br /&gt;
** [[Benchmark-suite | Benchmark-suite]]&lt;br /&gt;
** [[Educational]]&lt;br /&gt;
* Special pages&lt;br /&gt;
** [[Special:AllPages | All Pages]]&lt;br /&gt;
** [[MediaWiki:Sidebar | Side Bar]]&lt;br /&gt;
** [[under construction | Html2Wiki HOWTO]]&lt;br /&gt;
** [[How2NP | How to create a new project in Yambo]]&lt;br /&gt;
** [https://en.wikipedia.org/wiki/Help:Wikitext Wikitext Help]&lt;br /&gt;
&lt;br /&gt;
== Reducing the size of the VM image ==&lt;br /&gt;
Open a terminal in the VM and type&lt;br /&gt;
&lt;br /&gt;
 sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k&lt;br /&gt;
 sudo rm -rf /bigemptyfile&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5016</id>
		<title>Developers Corner</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5016"/>
		<updated>2021-05-04T21:06:11Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Development Repositories ==&lt;br /&gt;
** [[Test-suite-simple|Test-suite (for dummies)]]&lt;br /&gt;
** [[Test-suite | Test-suite]]&lt;br /&gt;
** [[Benchmark-suite | Benchmark-suite]]&lt;br /&gt;
** [[Educational]]&lt;br /&gt;
* Special pages&lt;br /&gt;
** [[Special:AllPages | All Pages]]&lt;br /&gt;
** [[MediaWiki:Sidebar | Side Bar]]&lt;br /&gt;
** [[under construction | Html2Wiki HOWTO]]&lt;br /&gt;
** [[How to create a new project in Yambo | How to create a new project in Yambo]]&lt;br /&gt;
** [https://en.wikipedia.org/wiki/Help:Wikitext Wikitext Help]&lt;br /&gt;
&lt;br /&gt;
== Reducing the size of the VM image ==&lt;br /&gt;
Open a terminal in the VM and type&lt;br /&gt;
&lt;br /&gt;
 sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k&lt;br /&gt;
 sudo rm -rf /bigemptyfile&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5015</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5015"/>
		<updated>2021-05-04T21:01:03Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. NP_PROJ = yambo_np  ypp_np&lt;br /&gt;
&lt;br /&gt;
Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
DF_PROJ  = yambo_df  ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &#039;&#039;&#039;config/mk/actions/compile_yambo.mk&#039;&#039;&#039;  and &#039;&#039;&#039;config/mk/actions/compile_ypp.mk&#039;&#039;&#039;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
        yambo_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
        @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &#039;&#039;&#039;config/mk/libraries.mk&#039;&#039;&#039;   by adding&lt;br /&gt;
&lt;br /&gt;
        YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
        YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) Edit the file driver/.objects&lt;br /&gt;
&lt;br /&gt;
        objs = yambo.o&lt;br /&gt;
        #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl &#039;&#039;&#039;|| _ypp_df&#039;&#039;&#039;&lt;br /&gt;
        objs = ypp.o&lt;br /&gt;
        #endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5014</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5014"/>
		<updated>2021-05-04T20:59:08Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
DF_PROJ  = yambo_df    ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &#039;&#039;&#039;config/mk/actions/compile_yambo.mk&#039;&#039;&#039;  and &#039;&#039;&#039;config/mk/actions/compile_ypp.mk&#039;&#039;&#039;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
        yambo_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
        @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &#039;&#039;&#039;config/mk/libraries.mk&#039;&#039;&#039;   by adding&lt;br /&gt;
&lt;br /&gt;
        YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
        YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) Edit the file driver/.objects&lt;br /&gt;
&lt;br /&gt;
        objs = yambo.o&lt;br /&gt;
        #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl &#039;&#039;&#039;|| _ypp_df&#039;&#039;&#039;&lt;br /&gt;
        objs = ypp.o&lt;br /&gt;
        #endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5013</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5013"/>
		<updated>2021-05-04T20:58:05Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
DF_PROJ  = yambo_df    ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &#039;&#039;&#039;config/mk/actions/compile_yambo.mk&#039;&#039;&#039;  and &#039;&#039;&#039;config/mk/actions/compile_ypp.mk&#039;&#039;&#039;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
        yambo_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
        @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &#039;&#039;&#039;config/mk/libraries.mk&#039;&#039;&#039;   by adding&lt;br /&gt;
&lt;br /&gt;
        YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
        YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;br /&gt;
&lt;br /&gt;
4) Edit the file driver/.objects&lt;br /&gt;
&lt;br /&gt;
        objs = yambo.o&lt;br /&gt;
        #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl || _ypp_df&lt;br /&gt;
        objs = ypp.o&lt;br /&gt;
        #endif&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5012</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5012"/>
		<updated>2021-05-04T20:54:54Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
DF_PROJ  = yambo_df    ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &#039;&#039;&#039;config/mk/actions/compile_yambo.mk&#039;&#039;&#039;  and &#039;&#039;&#039;config/mk/actions/compile_ypp.mk&#039;&#039;&#039;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
        yambo_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
        @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Edit the file &#039;&#039;&#039;config/mk/libraries.mk&#039;&#039;&#039;   by adding&lt;br /&gt;
&lt;br /&gt;
        YPPDF_MAIN_LIBS    = $(YPP_MAIN_LIBS) collisions hamiltonian sc&lt;br /&gt;
        YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5011</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5011"/>
		<updated>2021-05-04T20:52:58Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for your new project. Choose two letters which will inequivocally identify your project. Example: &amp;quot;df&amp;quot;  stands for &amp;quot;defects&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
DF_PROJ  = yambo_df    ypp_df&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &#039;&#039;&#039;config/mk/actions/compile_yambo.mk&#039;&#039;&#039;  and &#039;&#039;&#039;config/mk/actions/compile_ypp.mk&#039;&#039;&#039;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
        yambo_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
        @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5010</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5010"/>
		<updated>2021-05-04T20:47:19Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for new project.&lt;br /&gt;
&lt;br /&gt;
NP_PROJ  = yambo_np    ypp_np&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &#039;&#039;&#039;config/mk/actions/compile_yambo.mk&#039;&#039;&#039;  and &#039;&#039;&#039;config/mk/actions/compile_ypp.mk&#039;&#039;&#039;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
        yambo_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;;\&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
        @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; \&lt;br /&gt;
        ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5009</id>
		<title>How to create a new project in Yambo</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_create_a_new_project_in_Yambo&amp;diff=5009"/>
		<updated>2021-05-04T20:45:58Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: Created page with &amp;quot;1) Edit the file config/mk/targets.mk  In the following &amp;#039;&amp;#039;&amp;#039;np&amp;#039;&amp;#039;&amp;#039; stands for new project.  NP_PROJ  = yambo_np    ypp_np  2)  Edit the file &amp;#039;&amp;#039;&amp;#039;config/mk/actions/compile_yambo.m...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) Edit the file config/mk/targets.mk&lt;br /&gt;
&lt;br /&gt;
In the following &#039;&#039;&#039;np&#039;&#039;&#039; stands for new project.&lt;br /&gt;
&lt;br /&gt;
NP_PROJ  = yambo_np    ypp_np&lt;br /&gt;
&lt;br /&gt;
2)  Edit the file &#039;&#039;&#039;config/mk/actions/compile_yambo.mk&#039;&#039;&#039;  and &#039;&#039;&#039;config/mk/actions/compile_ypp.mk&#039;&#039;&#039;&lt;br /&gt;
by adding the new executables:&lt;br /&gt;
&lt;br /&gt;
yambo_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;yambo_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC -D_yambo&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(PJ_DFLIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_src)&lt;br /&gt;
        @+X2DO=&amp;quot;yambo_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(PJ_DFLIBS_LD)&amp;quot; ; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC&amp;quot;; $(mk_yambo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ypp_df: ext-libs&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(INT_LIBS)&amp;quot;; DIR2GO=&amp;quot;lib&amp;quot; ; VPATH=&amp;quot;$(topdir)/lib&amp;quot; ; $(mk_internal_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YLIBDRIVER)&amp;quot;; NAME=&amp;quot;ypp_df_driver_&amp;quot;; DIR2GO=&amp;quot;lib/yambo/driver/src&amp;quot;; VPATH=&amp;quot;$(topdir)/lib/yambo/driver/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC -D_ypp&amp;quot;; $(mk_external_yambo_lib)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPPDF_MAIN_LIBS)&amp;quot;; XPATH=&amp;quot;src&amp;quot;; VPATH=&amp;quot;$(topdir)/src&amp;quot;; ADF=&amp;quot;-D_DEFECTS -D_SC &amp;quot;; $(mk_src)&lt;br /&gt;
        @+LIBS2DO=&amp;quot;$(YPP_LIBS)&amp;quot;; XPATH=&amp;quot;ypp&amp;quot;; VPATH=&amp;quot;$(topdir)/ypp&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp_src)&lt;br /&gt;
        @+X2DO=&amp;quot;ypp_df&amp;quot;; XPATH=&amp;quot;driver&amp;quot;; VPATH=&amp;quot;$(topdir)/driver&amp;quot;; XLIBS=&amp;quot;$(YPPDF_MAIN_LIBS_LD)&amp;quot;; \&lt;br /&gt;
        X_ypp_LIBS=&amp;quot;$(YPP_LIBS_LD)&amp;quot;; DRILIBS=&amp;quot;$(YLIBDRIVER_LD)&amp;quot;; ADF=&amp;quot;-D_YPP_DEFECTS&amp;quot;; $(mk_ypp)&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5008</id>
		<title>Developers Corner</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5008"/>
		<updated>2021-05-04T20:37:19Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Development Repositories ==&lt;br /&gt;
** [[Test-suite-simple|Test-suite (for dummies)]]&lt;br /&gt;
** [[Test-suite | Test-suite]]&lt;br /&gt;
** [[Benchmark-suite | Benchmark-suite]]&lt;br /&gt;
** [[Educational]]&lt;br /&gt;
* Special pages&lt;br /&gt;
** [[Special:AllPages | All Pages]]&lt;br /&gt;
** [[MediaWiki:Sidebar | Side Bar]]&lt;br /&gt;
** [[under construction | Html2Wiki HOWTO]]&lt;br /&gt;
** [[How2NP | How to create a new project in Yambo]]&lt;br /&gt;
** [https://en.wikipedia.org/wiki/Help:Wikitext Wikitext Help]&lt;br /&gt;
&lt;br /&gt;
== Reducing the size of the VM image ==&lt;br /&gt;
Open a terminal in the VM and type&lt;br /&gt;
&lt;br /&gt;
 sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k&lt;br /&gt;
 sudo rm -rf /bigemptyfile&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5007</id>
		<title>Developers Corner</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5007"/>
		<updated>2021-05-04T14:39:43Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Development Repositories ==&lt;br /&gt;
** [[Test-suite-simple|Test-suite (for dummies)]]&lt;br /&gt;
** [[Test-suite | Test-suite]]&lt;br /&gt;
** [[Benchmark-suite | Benchmark-suite]]&lt;br /&gt;
** [[Educational]]&lt;br /&gt;
* Special pages&lt;br /&gt;
** [[Special:AllPages | All Pages]]&lt;br /&gt;
** [[MediaWiki:Sidebar | Side Bar]]&lt;br /&gt;
** [[under construction | Html2Wiki HOWTO]]&lt;br /&gt;
** [[How to create a new project in Yambo | All Pages]]&lt;br /&gt;
** [https://en.wikipedia.org/wiki/Help:Wikitext Wikitext Help]&lt;br /&gt;
&lt;br /&gt;
== Reducing the size of the VM image ==&lt;br /&gt;
Open a terminal in the VM and type&lt;br /&gt;
&lt;br /&gt;
 sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k&lt;br /&gt;
 sudo rm -rf /bigemptyfile&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5006</id>
		<title>Developers Corner</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Developers_Corner&amp;diff=5006"/>
		<updated>2021-05-04T13:40:23Z</updated>

		<summary type="html">&lt;p&gt;ElenaCannuccia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Development Repositories ==&lt;br /&gt;
** [[Test-suite-simple|Test-suite (for dummies)]]&lt;br /&gt;
** [[Test-suite | Test-suite]]&lt;br /&gt;
** [[Benchmark-suite | Benchmark-suite]]&lt;br /&gt;
** [[Educational]]&lt;br /&gt;
* Special pages&lt;br /&gt;
** [[Special:AllPages | All Pages]]&lt;br /&gt;
** [[MediaWiki:Sidebar | Side Bar]]&lt;br /&gt;
** [[under construction | Html2Wiki HOWTO]]&lt;br /&gt;
** [[How to create a new project in Yambo]]&lt;br /&gt;
** [https://en.wikipedia.org/wiki/Help:Wikitext Wikitext Help]&lt;br /&gt;
&lt;br /&gt;
== Reducing the size of the VM image ==&lt;br /&gt;
Open a terminal in the VM and type&lt;br /&gt;
&lt;br /&gt;
 sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k&lt;br /&gt;
 sudo rm -rf /bigemptyfile&lt;/div&gt;</summary>
		<author><name>ElenaCannuccia</name></author>
	</entry>
</feed>