<?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=Nicolaspallanzani</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=Nicolaspallanzani"/>
	<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Special:Contributions/Nicolaspallanzani"/>
	<updated>2026-05-17T14:34:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Calculating_optical_spectra_including_excitonic_effects:_a_step-by-step_guide&amp;diff=8798</id>
		<title>Calculating optical spectra including excitonic effects: a step-by-step guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Calculating_optical_spectra_including_excitonic_effects:_a_step-by-step_guide&amp;diff=8798"/>
		<updated>2025-05-21T14:13:25Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial guides you through the workflow of a calculation of the optical spectrum of a given material by solving the Bethe-Salpeter equation.&lt;br /&gt;
Specifically, we will use [[Bulk material: h-BN|bulk h-BN]] as an example.&lt;br /&gt;
&lt;br /&gt;
[[File:HBN-bulk-3x3-annotated.png|x200px|center|Atomic structure of bulk hBN]]&lt;br /&gt;
&lt;br /&gt;
Before starting, you need to obtain the tarballs for hBN. See instructions on the [[Tutorials|main tutorials page]].&lt;br /&gt;
&lt;br /&gt;
The target quantity in a Bethe-Salpeter calculation is the macroscopic dielectric matrix &amp;amp;epsilon;&amp;lt;sub&amp;gt;M&amp;lt;/sub&amp;gt;. The following quantities/steps are needed to obtain &amp;amp;epsilon;&amp;lt;sub&amp;gt;M&amp;lt;/sub&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
[[File:Scheme1b.png|500px|center|BSE calculation scheme]]&lt;br /&gt;
&lt;br /&gt;
The optical absorption spectrum corresponds to Im&amp;amp;epsilon;&amp;lt;sub&amp;gt;M&amp;lt;/sub&amp;gt;(&amp;amp;omega;). Following this scheme we go through the flow of a calculation:&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Step 1: Static screening===&lt;br /&gt;
Use the &#039;&#039;SAVE&#039;&#039; folders that are already provided and type:&lt;br /&gt;
 $ cd YAMBO_TUTORIALS/hBN/YAMBO&lt;br /&gt;
&lt;br /&gt;
Follow the &#039;&#039;&#039;[[Static screening]]&#039;&#039;&#039; module and then &#039;&#039;&#039;return to this tutorial &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Step 2: Bethe-Salpeter kernel===&lt;br /&gt;
Follow the module on &#039;&#039;&#039;[[Bethe-Salpeter kernel]]&#039;&#039;&#039; and &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
===Step 3: Diagonalisation of the excitonic Hamiltonian ===&lt;br /&gt;
This is the step in which you obtain the spectra. Mathematically this implies solving a large eigenvalue problem. In this tutorial, we diagonalise the whole Bethe-Salpeter matrix, but there are other numerical approaches available in Yambo. The difference between these approaches and when they should be used is the object of [[BSE solvers overview|one of the next tutorials]]. &lt;br /&gt;
&lt;br /&gt;
Follow the module on &#039;&#039;&#039;[[Bethe-Salpeter solver: diagonalization]]&#039;&#039;&#039; then &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Include previous quasiparticle (GW) results ===&lt;br /&gt;
In Step 3, we included the quasiparticle corrections to the Kohn-sham energies as a scissor operator. An alternative is to use the results from a previous run of Yambo.&lt;br /&gt;
&lt;br /&gt;
Follow the module on &#039;&#039;&#039;[[Bethe-Salpeter on top of quasiparticle energies]]&#039;&#039;&#039; and &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* Back to [[Modena 2025]]&lt;br /&gt;
* Back to [[Rome 2023#Tutorials]]&lt;br /&gt;
* [[Modules|Back to technical modules menu]]&lt;br /&gt;
* [[Tutorials|Back to tutorials menu]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
= Calculating the effective two-particle Hamiltonian =  &lt;br /&gt;
&lt;br /&gt;
This first part calculates and stores the two-particle Hamiltonian matrix elements:&lt;br /&gt;
[[File:BSE1-Eq1.png|none|x50px]]&lt;br /&gt;
where &#039;&#039;vc&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039; indicates the pair of quasiparticle states &#039;&#039;v&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039; and &#039;&#039;c&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039;.&lt;br /&gt;
The first term on the RHS is the quasiparticle energy differences (diagonal only). The second term is the kernel which is the sum of the electron-hole exchange part &#039;&#039;V&#039;&#039; (which stems from the Hartree potential) and the electron-hole attraction part &#039;&#039;W&#039;&#039; (which stems from the screened exchange potential).  The kernel both shifts (diagonal contributions) and couples (off-diagonal contributions) the quasiparticle energy differences. &lt;br /&gt;
&lt;br /&gt;
We start the calculation by running the [[Initialization|initialization step]] (i.e. invoke yambo from the command line in the directory containing the relevant SAVE directory).&lt;br /&gt;
 &lt;br /&gt;
== Step1: Calculation of the static dielectric screening.==&lt;br /&gt;
&lt;br /&gt;
Next, to calculate the correlation part of the kernel &#039;&#039;W&#039;&#039; we need the static dielectric screening. This is a calculation of the linear response of the system analogous to the calculation of the [[RPA/IP]] dielectric function. One important difference is that here we consider the static dielectric function.       &lt;br /&gt;
[[File:BSE1-Eq2.png|none|x50px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start by [[Input file generation|generating the input]] by invoking yambo with the option &amp;quot;-b&amp;quot;  from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ yambo -b -F 01_3D_BSE_screening.in&lt;br /&gt;
&lt;br /&gt;
The input opens in the standard editor. Similarly to the other linear response calculations the relevant input variables to be changed are: &lt;br /&gt;
&lt;br /&gt;
 % [[Variables#BndsRnXs|BndsRnXs]]&lt;br /&gt;
   1 | 40 |                 &lt;br /&gt;
 %&lt;br /&gt;
  [[Variables#NGsBlkXs|NGsBlkXs]]= 4 Ry&lt;br /&gt;
&lt;br /&gt;
The first variable gives how many bands are included in the sum to calculate the static response function. The second is a cutoff for the dimension of the static dielectric matrix.&lt;br /&gt;
&lt;br /&gt;
In the [[How to choose the input parameters|next tutorial]] you will see how to choose these two parameters. Another relevant input parameter to change is&lt;br /&gt;
&lt;br /&gt;
 % [[Variables#LongDrXs|LongDrXs]]&lt;br /&gt;
  1.000 | 1.000| 1.000&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
so that the perturbing electric field has component in each direction.&lt;br /&gt;
&lt;br /&gt;
Run the calculation by invoking yambo:&lt;br /&gt;
 $ yambo -F 01_3D_BSE_screening.in -J 3D_BSE &lt;br /&gt;
&lt;br /&gt;
In the log (l_em1s) of the calculation you can see that after calculating the dipole matrix elements, for each q vector yambo calculates the IP response function and by inversion the RPA response function &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;02s&amp;gt; Xo@q[1] |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;02s&amp;gt; X@q[1] |########################################| [100%] --(E) --(X)&lt;br /&gt;
&lt;br /&gt;
In the report, r_em1s, the details of the calculations are reported under the 5th section&lt;br /&gt;
&lt;br /&gt;
 [05] Static Dielectric Matrix&lt;br /&gt;
 =============================&lt;br /&gt;
&lt;br /&gt;
This calculation does not produce any human readable output, but both the dipole matrix elements and the static screening dielectric function are saved in a database in the 3D_BSE directory:&lt;br /&gt;
&lt;br /&gt;
 3D_BSE/ndb.dip_iR_and_P&lt;br /&gt;
 3D_BSE/ndb.em1s&lt;br /&gt;
&lt;br /&gt;
which are needed and read by the following yambo runlevels.&lt;br /&gt;
&lt;br /&gt;
== Step2: Calculation of matrix elements of the BSE kernel ==&lt;br /&gt;
&lt;br /&gt;
You have now all ingredients to calculate the kernel &lt;br /&gt;
&lt;br /&gt;
[[File:BSE1_Eq3.png|none|x100px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(and thus the two-particle Hamiltonian matrix elements).&lt;br /&gt;
&lt;br /&gt;
Start by generating the input by invoking yambo with the option &amp;quot;-o b -k bse -V qp&amp;quot;  from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ yambo -o b -k bse -V qp -F 02_3D_BSE_kernel.in&lt;br /&gt;
&lt;br /&gt;
The input opens in the standard editor. The relevant input parameters to be changed are &lt;br /&gt;
&lt;br /&gt;
 [[Variables#BSENGexx|BSENGexx]] = 30 Ry&lt;br /&gt;
 [[Variables#BSENGBlk|BSENGBlk]] = 4 Ry&lt;br /&gt;
 % [[Variables#BSEBands|BSEBands]]&lt;br /&gt;
  6 | 10 |       &lt;br /&gt;
 %&lt;br /&gt;
The first two are the cutoff for the summations on the reciprocal lattice vectors which appear in the expressions for &#039;&#039;V&#039;&#039; (BSENGexx) and &#039;&#039;W&#039;&#039; (BSENGBlk) here above.   &lt;br /&gt;
&lt;br /&gt;
The third parameter gives the range of quasiparticle states (their band index) that define the basis of quasiparticle pairs that we need to describe the excitons (in the energy range of interest).&lt;br /&gt;
For example since we have 8 occupied bands, here we consider the pairs of bands: &#039;&#039;6-9&#039;&#039;, &#039;&#039;6-10&#039;&#039;, &#039;&#039;7-9&#039;&#039;, &#039;&#039;7-10&#039;&#039;, &#039;&#039;8-9&#039;&#039;, &#039;&#039;8-10&#039;&#039; (those are 6 pairs of bands = 2 valence times 3 conduction bands). &lt;br /&gt;
&lt;br /&gt;
For each of those pairs we then consider all &#039;&#039;&#039;k&#039;&#039;&#039; points in the Brillouin zone available from the DFT calculations. Since we have a &#039;&#039;6 x 6 x 2&#039;&#039; grid, this amounts to 72 &#039;&#039;&#039;k&#039;&#039;&#039; points in the Brillouin zone. &lt;br /&gt;
&lt;br /&gt;
Then finally we are using a basis of &#039;&#039;6 x 72 = 432&#039;&#039; &#039;&#039;vc&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039; pairs to represent the excitons of the system.  &lt;br /&gt;
  &lt;br /&gt;
The values for these 3 parameters are chosen from convergence studies, as discussed in the [[How to choose the input parameters|next tutorial]].&lt;br /&gt;
&lt;br /&gt;
Another parameter to modify is&lt;br /&gt;
 % [[Variables#KfnQP_E|KfnQP_E]] &lt;br /&gt;
  1.440000 | 1.000000 | 1.000000 |&lt;br /&gt;
 %&lt;br /&gt;
This gives the quasiparticle corrections to the Kohn-Sham eigenvalues and  is deduced either from experiment or previous [[How to obtain the quasi-particle band structure of a bulk material: h-BN|GW calculations]]. &lt;br /&gt;
The corrections consist in a shift (first value) of the conduction bands in eV and renormalization of the conduction and valence bandwidths (second and third value). &lt;br /&gt;
Alternatively we can directly input corrections calculated from a previous GW calculation as we will learn later in this tutorial.&lt;br /&gt;
&lt;br /&gt;
Run the calculation by invoking yambo in the command line:&lt;br /&gt;
 $ yambo -F 02_3D_BSE_kernel.in -J 3D_BSE &lt;br /&gt;
In the log (either in standard output or in l_optics_bse_bsk), after various setup/loading, the kernel is calculated:  &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;01s&amp;gt; [05.04.03] Kernel loop&lt;br /&gt;
 &amp;lt;02s&amp;gt; Kernel |########################################| [100%] --(E) --(X)&lt;br /&gt;
&lt;br /&gt;
In the report r_optics_bse_bsk the information relative to this runlevel are reported under the section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [05] Response Functions in Transition space&lt;br /&gt;
 ===========================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the log and the report. For example try to find where the input parameters are reported, the dimension of the 2-particle hamiltonian and if these match your expectations.&lt;br /&gt;
&lt;br /&gt;
This run does not produce any human readable output. The kernel is stored in a database in the 3D_BSE directory&lt;br /&gt;
&lt;br /&gt;
 3D_BSE/ndb.BS_Q1&lt;br /&gt;
&lt;br /&gt;
= Obtaining the optical spectrum from the two-particle Hamiltonian =&lt;br /&gt;
The macroscopic dielectric function (from which the absorption and EEL spectra can be computed) is obtained from the eigenvalues &#039;&#039;E&#039;&#039;&amp;lt;sub&amp;gt;&amp;amp;lambda;&amp;lt;/sub&amp;gt; (excitonic energies) and eigenvectors A&amp;lt;sup&amp;gt;&amp;amp;lambda;&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;&#039;&#039;cv&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039;&amp;lt;/sub&amp;gt; (exciton composition in terms of electron-hole pairs) of the two-particle Hamiltonian:&lt;br /&gt;
&lt;br /&gt;
[[File:BSE1-Eq4.png|none|x50px]]&lt;br /&gt;
&lt;br /&gt;
To get the two-particle Hamiltonian eigensolutions you can either &lt;br /&gt;
&lt;br /&gt;
(1) diagonalize the full Hamiltonian (diagonalization solver) &lt;br /&gt;
&lt;br /&gt;
(2) use the subspace iterative [https://en.wikipedia.org/wiki/Lanczos_algorithm | Lanczos algorithm] and by-pass diagonalization with the Haydock approach&amp;lt;ref&amp;gt;R. Haydock, in&lt;br /&gt;
 &#039;&#039;Solid State Phys.&#039;&#039;, &#039;&#039;&#039;35&#039;&#039;&#039; 215 (1980)&lt;br /&gt;
 edited by H. Ehrenfest, F. Seitz, and D. Turnbull, Academic Press&amp;lt;/ref&amp;gt; (Lanczos-Haydock solver)&lt;br /&gt;
&lt;br /&gt;
Both approaches are detailed here below.&lt;br /&gt;
&lt;br /&gt;
== Diagonalization solver ==&lt;br /&gt;
&lt;br /&gt;
Invoke yambo with the &amp;quot;-y d&amp;quot; option in the command line:&lt;br /&gt;
&lt;br /&gt;
 $ yambo -y d -F 03_3D_BSE_diago_solver.in&lt;br /&gt;
&lt;br /&gt;
The input is open in the editor. The input variable to be changed are &lt;br /&gt;
 % [[Variables#BEnRange|BEnRange]]&lt;br /&gt;
   2.00000 | 8.00000 | eV    &lt;br /&gt;
 %&lt;br /&gt;
 [[Variables#BEnSteps|BEnSteps]]= 200      &lt;br /&gt;
 &lt;br /&gt;
which define 200 evenly spaced points between 2 and 8 eV at which the spectrum is calculated (&amp;amp;omega; in the equation for the macroscopic dielectric function),&lt;br /&gt;
  &lt;br /&gt;
 % [[Variables#BDmRange|BDmRange]]&lt;br /&gt;
   0.10000 |  0.10000 | eV    &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
which defines the spectral broadening (Lorentzian model), &lt;br /&gt;
&lt;br /&gt;
 % [[Variables#BLongDir|BLongDir]]&lt;br /&gt;
  1.000000 | 1.000000 | 0.000000 | &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
which defines the direction of the perturbing electric field (in this case the in-plane direction).&lt;br /&gt;
&lt;br /&gt;
Run yambo: &lt;br /&gt;
 $ yambo -F 03_3D_BSE_diago_solver.in -J 3D_BSE  &lt;br /&gt;
In the log (either in standard output or in l-3d_BSE_optics_bse_bsk_bss), after various setup/loading, the BSE is diagonalized using the linked linear algebra libraries: &lt;br /&gt;
 &amp;lt;01s&amp;gt; [06] BSE solver(s)&lt;br /&gt;
 &amp;lt;01s&amp;gt; [LA] SERIAL linear algebra&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06.01] Diagonalization solver&lt;br /&gt;
 &amp;lt;01s&amp;gt; BSK diagonalize |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;01s&amp;gt; EPS   residuals |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;01s&amp;gt; BSK     epsilon |########################################| [100%] --(E) --(X)&lt;br /&gt;
The report r-3d_BSE_optics_bse_bsk_bss contains information relative to this runlevel in section 6:&lt;br /&gt;
&lt;br /&gt;
 [06] BSE solver(s)&lt;br /&gt;
 ==================&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the log and the report to check the consistency with the input variables. This run produces a new database in the 3D_BSE directory&lt;br /&gt;
 3D_BSE/ndb.BS_diago_Q01&lt;br /&gt;
So if you need the spectrum on a different energy range, direction, with a different broadening or on more points the diagonalization is not repeated, just the spectrum is recalculated.&lt;br /&gt;
    &lt;br /&gt;
This run produces as well human readable files (o-*). Specifically o-3D_BSE.eps_q1_diago_bse contains the real and imaginary part of the macroscopic dielectric function &lt;br /&gt;
  &lt;br /&gt;
 $ less o-3D_BSE.eps_q1_diago_bse &lt;br /&gt;
 ...&lt;br /&gt;
 #&lt;br /&gt;
 #  E/ev[1]    EPS-Im[2]  EPS-Re[3]  EPSo-Im[4] EPSo-Re[5]&lt;br /&gt;
 #&lt;br /&gt;
   2.00000    0.16162    5.83681    0.04959    4.14127&lt;br /&gt;
   2.03015    0.16787    5.88612    0.05090    4.15638&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
which is in the format &lt;br /&gt;
 Energy in eV | Imaginary part BSE | Real part BSE |Imaginary part IPA | Real part IPA |  &lt;br /&gt;
&lt;br /&gt;
where real and imaginary parts refer to the macroscopic dielectric function. The imaginary part corresponds to the optical absorption. The latter (column 2) can be plotted versus the photon energy (column 1) and compared with the independent particle approximation (IPA, column 4), e.g.: &lt;br /&gt;
 &lt;br /&gt;
 $ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 plot &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:2 w l t &#039;BSE&#039;, &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:4 w l  t &#039;IPA&#039;&lt;br /&gt;
&lt;br /&gt;
[[file:03_bse_diago.png |none|600px]]&lt;br /&gt;
The addition of the kernel has the effect to red-shift the spectrum onset and to redistribute the oscillator strengths. Note that the convergence with respect to k-points smooths out the low energy peaks in the IPA (which are an artifact of poor convergence with k-points producing an artificial confinement) to give the shoulder corresponding to the van Hove singularity in the band structure. On the other hand the low energy peak in the BSE is genuine and it is the signature of a bound exciton.&lt;br /&gt;
&lt;br /&gt;
== Lanczos-Haydock solver ==&lt;br /&gt;
&lt;br /&gt;
You can avoid the full matrix diagonalization (which rapidly become expensive as it scales as N&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;) by using the Lanczos-Haydock solver mentioned above. While for small matrices these two methods have similar computational cost, for matrices of the size 10000 by 10000 and larger, the Haydock solver is remarkably faster. The drawback is that excitonic functions cannot be calculated.&lt;br /&gt;
Within the Lanczos-Haydock approach the macroscopic dielectric function is rewritten as continued fraction&amp;lt;ref&amp;gt;L. X. Benedict and E. L. Shirley, Phys. Rev. B &#039;&#039;&#039;59&#039;&#039;&#039;, 5441 (1999)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[file:BSE1-Eq5.png|none|x100px]]&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;a&#039;&#039; &#039;s and &#039;&#039;b&#039;&#039; &#039;s result from the [https://en.wikipedia.org/wiki/Lanczos_algorithm#Lanczos_method| Lanczos iterative algorithm]. &lt;br /&gt;
&lt;br /&gt;
To use the Lanczos-Haydock solver invoke yambo with &amp;quot;-y h&amp;quot; option in the command line:&lt;br /&gt;
&lt;br /&gt;
 $ yambo -y h -F 03_3D_BSE_haydock_solver.in&lt;br /&gt;
Beside the same input parameters defined for the diagonalization solver, the parameter&lt;br /&gt;
 [[Variables#BSHayTrs|BSHayTrs]]= -0.02000          &lt;br /&gt;
defines the threshold accuracy for the Lanczos-Haydock iterative process: the calculation stops when the difference between two consecutive calculated spectra is smaller than the absolute value of the threshold.    &lt;br /&gt;
The minus sign indicates that the average difference over the specified energy range is considered (i.e. that means that cancellations of error may occur) as opposed to the maximum absolute difference over the specified energy range (plus sign). For the moment we leave this variable unchanged. This parameter ultimately determines the terms are included in the continued fraction here above. Later we explore how this variable influences the final result.   &lt;br /&gt;
&lt;br /&gt;
Invoke yambo to run the calculation:&lt;br /&gt;
 $ yambo -F 03_3D_BSE_haydock_solver.in -J &amp;quot;3D_BSE-low,3D_BSE&amp;quot;  &lt;br /&gt;
This outputs the following log:&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06] BSE solver(s)&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06.01] Haydock solver&lt;br /&gt;
 &amp;lt;01s&amp;gt; [Haydock] Iteration 1&lt;br /&gt;
 &amp;lt;03s&amp;gt; [Haydock] Iteration 21 Accuracy :  0.01647| -0.02000&lt;br /&gt;
 ...&lt;br /&gt;
The Lanczos-Haydock iterative procedure converged to the desired accuracy in 21 iterations.&lt;br /&gt;
&lt;br /&gt;
This runs only produces human readable files. That means that if you changes the input parameters (such as the broadening or the energy range) the Lanczos-Haydock procedure has to be repeated. &lt;br /&gt;
Among the human readable files, o-3D_BSE-low.eps_q1_haydock_bse contains the real and imaginary part of the macroscopic dielectric function:&lt;br /&gt;
 $ less o-3D_BSE-low.eps_q1_haydock_bse&lt;br /&gt;
 ...&lt;br /&gt;
 #&lt;br /&gt;
 #  E/ev[1]    EPS-Im[2]  EPS-Re[3]  EPSo-Im[4] EPSo-Re[5] EPS`-Im[6] EPS`-Re[7]&lt;br /&gt;
 #&lt;br /&gt;
    2.00000    0.16089    5.81293    0.04945    4.12727    0.16089    5.81293&lt;br /&gt;
    2.03015    0.16711    5.86203    0.05076    4.14234    0.16711    5.86203&lt;br /&gt;
 ...&lt;br /&gt;
This file has a slightly different data structure with respect to the diagonalization solver:&lt;br /&gt;
 Energy in eV | Imaginary part BSE | Real part BSE |Imaginary part IPA | Real part IPA |Imaginary part BSE (it-1) | Real part BSE (it-1)|&lt;br /&gt;
&lt;br /&gt;
We can plot the second and sixth columns and compare with the result from diagonalization:&lt;br /&gt;
 $gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
  plot &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:2 w l t &#039;Diagonalization&#039;, &#039;o-3D_BSE-low.eps_q1_haydock_bse&#039; u 1:2 w l t &#039;Haydock (27 its)&#039;, &#039;o-3D_BSE-low.eps_q1_haydock_bse&#039; u 1:6 w l t &#039;Haydock (26 its)&#039;&lt;br /&gt;
[[file:03_bse_haydock.png|none|600px]]&lt;br /&gt;
Except for the peak at higher energy, the results on this scale are identical to those obtained via the diagonalization solver. By comparing the results for the Lanczos-Haydock solver at 27 and 26 iterations, it is clear that the difference with the diagonalization results can be eliminated by lowering the threshold for the iterative process.&lt;br /&gt;
&lt;br /&gt;
Repeat now the calculation by changing the input variable:&lt;br /&gt;
 [[Variables#BSHayTrs|BSHayTrs]]= 0.02000          &lt;br /&gt;
which enforces a stricter condition on the convergence of the iterative process (see above)&lt;br /&gt;
&lt;br /&gt;
Running yambo: &lt;br /&gt;
 $ yambo -F 03_3D_BSE_haydock_solver.in -J &amp;quot;3D_BSE-high,3D_BSE&amp;quot;  &lt;br /&gt;
outputs the following log &lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06] BSE solver(s)&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06.01] Haydock solver&lt;br /&gt;
 &amp;lt;01s&amp;gt; [Haydock] Iteration 1&lt;br /&gt;
 &amp;lt;06s&amp;gt; [Haydock] Iteration 45 Accuracy :   0.0098|  0.02000&lt;br /&gt;
 ...&lt;br /&gt;
Now 45 iterations, rather than 21, were needed to reach the desired accuracy.&lt;br /&gt;
By plotting these results:&lt;br /&gt;
 $ gnuplot&lt;br /&gt;
 plot &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:2 w l ls 1 t &#039;Diagonalization&#039;, &#039;o-3D_BSE-high.eps_q1_haydock_bse&#039; u 1:2 w l ls 2 t &#039;Haydock (high)&#039;, &#039;o-3D_BSE-low.eps_q1_haydock_bse&#039; u 1:2 w l ls 3 t &#039;Haydock (low)&#039;&lt;br /&gt;
[[file:03_bse_haydock_high.png|none|600px]]&lt;br /&gt;
Which shows that the Lanczos-Haydock solver with the stricter convergence criterion and the diagonalization solver are identical on this scale.&lt;br /&gt;
&lt;br /&gt;
=Some more advanced options =&lt;br /&gt;
&lt;br /&gt;
==Reading the QP corrections from a previous &#039;&#039;GW&#039;&#039; calculation==&lt;br /&gt;
In the above calculation we have used a simple scissor operator to correct the Kohn-Sam DFT energies. In this part we see how we can instead take the corrections from a previous Yambo Gw calculation.&lt;br /&gt;
We create and edit the input. This time instead of proceeding in three steps as before, we create one input performing all three steps:&lt;br /&gt;
 $yambo -o b -k sex -y d -V qp -F Ins/05_3D_QP_BSE.in&lt;br /&gt;
We set all parameters as in the previous calculation, except for the part regarding the QP correction:&lt;br /&gt;
  [[Variables#KfnQPdb|KfnQPdb]]= &amp;quot;E &amp;lt; 3D_QP_BSE/ndb.QP&amp;quot;              # [EXTQP BSK BSS] Database&lt;br /&gt;
  [[Variables#KfnQP_N|KfnQP_N]]= 1                   # [EXTQP BSK BSS] Interpolation neighbours&lt;br /&gt;
  % [[Variables#KfnQP_E|KfnQP_E]]&lt;br /&gt;
   0.000000 | 1.000000 | 1.000000 |        # [EXTQP BSK BSS] E parameters  (c/v) eV|adim|adim&lt;br /&gt;
 %&lt;br /&gt;
Instead of setting the values for the scissor, we give the path to a database (3D_QP_BSE/ndb.QP) which contains the QP corrections. This has been created by running a GW calculation as in the [[How to obtain the quasi-particle band structure of a bulk material: h-BN |GW tutorial]].&lt;br /&gt;
Run Yambo:&lt;br /&gt;
 $ yambo -F Ins/05_3D_QP_BSE.in -J &amp;quot;3D_QP_BSE,3D_BSE&amp;quot;&lt;br /&gt;
This produces the following log in the standard output. Note Section 4 (regarding external QP corrections to the kernel):&lt;br /&gt;
 &amp;lt;01s&amp;gt; [04.01] External QP corrections (K)&lt;br /&gt;
 &amp;lt;01s&amp;gt; [QP@K] E&amp;lt;3D_QP_BSE/ndb.QP[ PPA XG:39 Xb:1   40 Scb:1   40]&lt;br /&gt;
 &amp;lt;01s&amp;gt; [QP] Kpts covered exactly  [o/o]: 100.0000&lt;br /&gt;
This tells you that the file was found, read correctly and that the &#039;&#039;&#039;k&#039;&#039;&#039; points found in the file matched the ones you are using for the current calculation (otherwise interpolation would be needed).&lt;br /&gt;
It is crucial to check that the file has been read, since if not Yambo gives a warning but continues the calculation (with no QP corrections at all!).&lt;br /&gt;
As in the previous calculation the final results of the calculation are the files with the spectral functions. Let&#039;s compare the results for the optical absorption spectrum with those obtained previously with a simple scissor:&lt;br /&gt;
 $ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 plot &#039;o-3D_QP_BSE.eps_q1_diago_bse&#039; u 1:2 w l t &#039;Explicit QP&#039;, &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:2 w l t &#039;Scissor&#039; &lt;br /&gt;
[[File:03 bse diago qp.png|none|600px]]&lt;br /&gt;
It is clear that this makes a difference in the peak distribution and intensity. Note that beside a simple shift you can renormalise as well the bandwidth of the valence and conduction bands in KfnQP_E (respectively the third and second value). You can try as an exercise to set up a new calculation using e.g. 1.440000 | 1.200000 | 0.900000 | for KfnQP_E.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_choose_the_input_parameters&amp;diff=8797</id>
		<title>How to choose the input parameters</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_choose_the_input_parameters&amp;diff=8797"/>
		<updated>2025-05-21T14:13:03Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In a [[Calculating optical spectra including excitonic effects: a step-by-step guide|previous tutorial]], you have been guided step-by-step through the calculations of the optical spectrum of bulk &#039;&#039;h-BN&#039;&#039; by solving the Bethe-Salpeter equation. The values for the relevant input parameters have then been given to you.&lt;br /&gt;
&lt;br /&gt;
In this tutorial you will learn how to choose these parameters which are related either to the truncation of infinite sums or to the approximations of infinitesimal with small, but finite quantities. A wrong choice of these parameters can lead to inaccurate or even physically wrong results. One needs to run a series of calculations by changing the parameters until the results are &#039;&#039;converged&#039;&#039;, meaning they are changing by what you consider a negligible amount. This is a tedious yet essential part of determining the optical properties of a system.&lt;br /&gt;
&lt;br /&gt;
Note that all the operations described below can be automated. A flexible python-based interface to yambo, [[First steps in Yambopy|yambopy]], can be used for this purpose. It is worth however to go at least once through the pain of a &#039;by-hand&#039; convergence study so to better understand the automated process.&lt;br /&gt;
&lt;br /&gt;
==Before starting==&lt;br /&gt;
&lt;br /&gt;
Have completed (or be familiar with the content of) the following tutorials:&lt;br /&gt;
* [[First steps: a walk through from DFT to optical properties]]&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide]]&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
Coming back to the scheme to calculate the macroscopic dielectric matrix within Bethe-Salpeter (BS), the list of the parameters that have to be determined by convergence studies are:&lt;br /&gt;
&lt;br /&gt;
[[File:Scheme2.png|500px|center|convergence parameters]]&lt;br /&gt;
&lt;br /&gt;
This provides as well a scheme for a full convergence study:&lt;br /&gt;
* first the parameters for the screening have to be determined, &lt;br /&gt;
* then the parameters for the BS kernel, and &lt;br /&gt;
* finally the convergence with respect to the choice of the k-mesh needs to performed. &lt;br /&gt;
&lt;br /&gt;
==Convergence of the static screening==&lt;br /&gt;
The parameters that need to be converged can be understood by looking at the equations:&lt;br /&gt;
[[File:Yambo-CH5.png|none|x30px|Yambo tutorial image]]&lt;br /&gt;
where &#039;&#039;&amp;amp;chi;&amp;lt;sub&amp;gt;GG&#039;&amp;lt;/sub&amp;gt;&#039;&#039; is given by&lt;br /&gt;
[[File:Dyson_rpa.png|none|x50px|Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;[[Variables#NGsBlkXs|NGsBlkXs]]&amp;lt;/code&amp;gt; : The dimension of the microscopic inverse matrix, related to [[Local fields]]&lt;br /&gt;
* &amp;lt;code&amp;gt;[[Variables#BndsRnXs|BndsRnXs]]&amp;lt;/code&amp;gt; : The sum on bands in the independent particle &amp;amp;chi;&amp;lt;sup&amp;gt;0&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;GG&#039;&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore as shown in [[Optics at the independent particle level#Energy cutoff|this tutorial]] one can reduce the value of &lt;br /&gt;
* &amp;lt;code&amp;gt;[[Variables#FFTGvecs|FFTGvecs]]&amp;lt;/code&amp;gt;&lt;br /&gt;
since generally, fewer G-vectors are needed than what are needed in DFT calculations. This can be critical for large calculations, or for supercells with a lot of vacuum.&lt;br /&gt;
Remember that the latter parameter appears only when the input is generated specifying the verbosity level &amp;lt;code&amp;gt;-V RL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The convergence for the static screening then is similar to the convergence of other response functions and for the plasmon-pole in [[How to obtain the quasi-particle band structure of a bulk material: h-BN|GW calculations]] and won&#039;t be covered here. Note in fact that you can re-use the database obtained (and converged) from a previous screening calculation as long as the same k-points are used.&lt;br /&gt;
&lt;br /&gt;
==Convergence of the macroscopic dielectric function==&lt;br /&gt;
In the expression for the macroscopic dielectric function &lt;br /&gt;
[[File:BSE1-Eq4.png|none|x50px]]&lt;br /&gt;
&lt;br /&gt;
depends on the summation over the pair of quasiparticle states &#039;&#039;vc&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;[[Variables#BSEBands|BSEBands]]&amp;lt;/code&amp;gt; : defines the &#039;&#039;vc&#039;&#039; pairs.&lt;br /&gt;
* the k-point mesh of the DFT calculations defines the &#039;&#039;&#039;k&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
Basically we need a large enough basis of transitions (pair of quasiparticle states) to correctly describe the excitons (in the energy region of interest).&lt;br /&gt;
&lt;br /&gt;
Furthermore, in the kernel components&lt;br /&gt;
&lt;br /&gt;
[[File:BSE1_Eq3.png|none|x100px]]&lt;br /&gt;
&lt;br /&gt;
the summations over &#039;&#039;&#039;G&#039;&#039;&#039; vectors appear. These corresponds to two parameters:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;[[Variables#BSENGblk|BSENGblk]]&amp;lt;/code&amp;gt;: defines the screened interaction block size (double sum in &#039;&#039;W&#039;&#039;), related to the electron-hole attraction.&lt;br /&gt;
* &amp;lt;code&amp;gt;[[Variables#BSENGexx|BSENGexx]]&amp;lt;/code&amp;gt;: defines the components of Hartree potential (the sum in &#039;&#039;V&#039;&#039;), related to local fields.&lt;br /&gt;
&lt;br /&gt;
In the following we will see how the spectrum depends on these parameters.&lt;br /&gt;
&lt;br /&gt;
===Prepare the common databases===&lt;br /&gt;
&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;hBN&amp;lt;/code&amp;gt; directory (containing a 6x6x2 k-grid SAVE) and run the initialization if you didn&#039;t do it before. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cd YAMBO_TUTORIALS/hBN/YAMBO&lt;br /&gt;
&lt;br /&gt;
For all the calculations in this sessions you can fix the screening parameters, and thus calculate the screening once for all.&lt;br /&gt;
Following the scheme we learned in previous tutorial:&lt;br /&gt;
&lt;br /&gt;
* Create the input for calculating the screening:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F 02_screening.in -X s&lt;br /&gt;
&lt;br /&gt;
* Modify the input as follows&lt;br /&gt;
&lt;br /&gt;
 NGsBlkXs = 4 Ry&lt;br /&gt;
 %BndsRnXs&lt;br /&gt;
  1 | 40 |&lt;br /&gt;
 %&lt;br /&gt;
 %LongDrXS&lt;br /&gt;
  1.000 | 1.000 | 1.000|&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
* Run the calculation for the screening&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; yambo -F 02_screening.in &lt;br /&gt;
&lt;br /&gt;
As we do not specify a particular prefix, the screening databases  &amp;lt;code&amp;gt;ndb.dip_iR_and_P, ndb.em1s&amp;lt;/code&amp;gt; are saved in the &amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt; folder and visible to all the subsequent jobs you will launch is this directory.&lt;br /&gt;
&lt;br /&gt;
===Convergence with the cut-off for reciprocal lattice vectors sums=== &lt;br /&gt;
As next step, create the input for calculating the macroscopic dielectric function:&lt;br /&gt;
 &amp;gt; yambo -F 03_bse.in -o b -k sex -y d -V qp&lt;br /&gt;
Which combines the BS kernel + BS solver (diagonalization) runlevels&lt;br /&gt;
* Modify the input as follows&lt;br /&gt;
 [[Variables#BSENGexx|BSENGexx]] = 30 Ry&lt;br /&gt;
 [[Variables#BSENGBlk|BSENGBlk]] = 4 Ry&lt;br /&gt;
 % [[Variables#BSEBands|BSEBands]]&lt;br /&gt;
  6 | 10 |       &lt;br /&gt;
 %&lt;br /&gt;
 % [[Variables#BEnRange|BEnRange]]&lt;br /&gt;
   2.00000 | 8.00000 | eV    &lt;br /&gt;
 %&lt;br /&gt;
 [[Variables#BEnSteps|BEnSteps]]= 100      &lt;br /&gt;
 % [[Variables#BDmRange|BDmRange]]&lt;br /&gt;
   0.10000 |  0.10000 | eV    &lt;br /&gt;
 %&lt;br /&gt;
 % [[Variables#BLongDir|BLongDir]]&lt;br /&gt;
  1.000000 | 1.000000 | 0.000000 | &lt;br /&gt;
 %&lt;br /&gt;
 % [[Variables#KfnQP_E|KfnQP_E]] &lt;br /&gt;
  1.440000 | 1.000000 | 1.000000 |&lt;br /&gt;
 %&lt;br /&gt;
* Launch the calculation:&lt;br /&gt;
 &amp;gt; yambo -F 03_bse.in -J 3D_4Ry_GBlk&lt;br /&gt;
This produces the file with the optical spectrum &amp;lt;code&amp;gt;o-3D_4Ry_GBlk.eps_q1_diago_bse&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Open the &amp;lt;code&amp;gt;03_bse.in&amp;lt;/code&amp;gt; in an editor and changes:&lt;br /&gt;
 [[Variables#BSENGBlk|BSENGBlk]] = &#039;&#039;&#039;3 Ry&#039;&#039;&#039;&lt;br /&gt;
while leaving the rest untouched.&lt;br /&gt;
* Launch the calculation:&lt;br /&gt;
 &amp;gt; yambo -F 03_bse.in -J 3D_3Ry_GBlk&lt;br /&gt;
This produces the file with the optical spectrum &amp;lt;code&amp;gt;o-3D_3Ry_GBlk.eps_q1_diago_bse&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* Repeat this operation for &amp;lt;code&amp;gt;BSENGBlk= &#039;&#039;&#039;2 Ry&#039;&#039;&#039;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;BSENGBlk= &#039;&#039;&#039;1 Ry&#039;&#039;&#039;&amp;lt;/code&amp;gt;. Remember to change the prefix correspondingly so that you can later on identify the job, e.g. &amp;lt;code&amp;gt;-J 3D_2Ry_GBlk&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;BSENGBlk=&#039;&#039;&#039;2 Ry&#039;&#039;&#039;&amp;lt;/code&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
* Finally plot the obtained optical spectra:&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 plot  &#039;o-3D_4Ry_GBlk.eps_q1_diago_bse&#039; w l t &#039;4 Ry&#039;,&#039;o-3D_3Ry_GBlk.eps_q1_diago_bse&#039; w l t &#039;3 Ry&#039;,  &#039;o-3D_2Ry_GBlk.eps_q1_diago_bse&#039; w l t &#039;2 Ry&#039;, &#039;o-3D_1Ry_GBlk.eps_q1_diago_bse&#039; w l t &#039;1 Ry&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:03 bse conv GBlk.png|500px|center|convergence with Gblk ]]&lt;br /&gt;
&lt;br /&gt;
This shows that &amp;lt;code&amp;gt;BSENGBlk= &#039;&#039;&#039;2 Ry&#039;&#039;&#039;&amp;lt;/code&amp;gt; gives already a results close to convergence and we can confidently lower &amp;lt;code&amp;gt;BSENGBlk&amp;lt;/code&amp;gt; to 2 or 3 Ry. &lt;br /&gt;
&lt;br /&gt;
* Repeat now the same procedure with &amp;lt;code&amp;gt;BSENGexx&amp;lt;/code&amp;gt;. Change the value to 10 Ry and 20 Ry. Remember to change the prefix correspondingly so that you can later on identify the job, e.g. &amp;lt;code&amp;gt;-J 3D_10Ry_Gexx&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;BSENGexx= &#039;&#039;&#039;10 Ry&#039;&#039;&#039;&amp;lt;/code&amp;gt; etc., and remember to keep the value of &amp;lt;code&amp;gt;BSENGBlk&amp;lt;/code&amp;gt; the same throughout these calculations.&lt;br /&gt;
&lt;br /&gt;
* Finally plot the obtained optical spectra:&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
  plot  &#039;o-3D_4Ry_GBlk.eps_q1_diago_bse&#039; w l t &#039;30 Ry&#039; ls 1,&#039;o-3D_20Ry_Gexx.eps_q1_diago_bse&#039; w l t &#039;20 Ry&#039;,  &#039;o-3D_10Ry_Gexx.eps_q1_diago_bse&#039; w l t &#039;10 Ry&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:03 bse conv Gexx.png|500px|center|convergence with Gexx ]]&lt;br /&gt;
&lt;br /&gt;
The plot shows that already with &amp;lt;code&amp;gt;BSENGexx= &#039;&#039;&#039;10 Ry&#039;&#039;&#039;&amp;lt;/code&amp;gt; the spectrum is converged and the cut-off can be lowered to this value.&lt;br /&gt;
&lt;br /&gt;
===Convergence with the BS bands=== &lt;br /&gt;
You can now repeat the procedure above keeping fixed all parameters to their original values except for&lt;br /&gt;
 % BSEBands&lt;br /&gt;
 6 | 10 |       &lt;br /&gt;
 %&lt;br /&gt;
Typically only the bands which are close to the Fermi energies contributes to the spectrum. If the energy separation between two bands is much larger than the spectral energy range, you can assume the corresponding transitions are not contributing to the spectra. &lt;br /&gt;
&lt;br /&gt;
* Repeat then the calculation for the optical spectrum using the following band ranges: &lt;br /&gt;
 &#039;&#039;7-10&#039;&#039;, &#039;&#039;8-10&#039;&#039;, &#039;&#039;6-9&#039;&#039;, &#039;&#039;7-9&#039;&#039; and &#039;&#039;8-9&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
When launching the job remember to identify your job with a recognizable name, e.g. &amp;lt;code&amp;gt;-J 3D_7-9_BND&amp;lt;/code&amp;gt; for the &#039;&#039;7-9&#039;&#039; range.   &lt;br /&gt;
&lt;br /&gt;
* Plot the optical spectra obtained from the different runs:&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 plot  &#039;o-3D_4Ry_GBlk.eps_q1_diago_bse&#039; w l t &#039;6-10 Bands&#039;,&#039;o-3D_7-10_BND.eps_q1_diago_bse&#039; w l t &#039;7-10 Bands&#039;, &#039;o-3D_8-10_BND.eps_q1_diago_bse&#039; w l t &#039;8-10 Bands&#039;&lt;br /&gt;
 plot  &#039;o-3D_4Ry_GBlk.eps_q1_diago_bse&#039; w l t &#039;6-10 Bands&#039;,&#039;o-3D_6-9_BND.eps_q1_diago_bse&#039; w l t &#039;6-9 Bands&#039;, &#039;o-3D_7-9_BND.eps_q1_diago_bse&#039; w l t &#039;7-9 Bands&#039;, &#039;o-3D_8-9_BND.eps_q1_diago_bse&#039; w l t &#039;8-9 Bands&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:03 band convergence 1.png|500px|left|Band convergence]] [[File:03 band convergence2.png|500px|center|Band convergence 2]]&lt;br /&gt;
&lt;br /&gt;
The plots show that we need to include valence bands from at least 6-7 (those bands are degenerate at several high symmetry points of the Brillouin zone) and conduction at least up to band 10.&lt;br /&gt;
To see if this is sufficient you can try to include more bands.&lt;br /&gt;
&lt;br /&gt;
For example you can prepare and run calculations with the following bands ranges: &#039;&#039;1-12&#039;&#039;, &#039;&#039;4-12&#039;&#039;, &#039;&#039;4-14&#039;&#039; and plot the results: &lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 plot  &#039;o-3D_4Ry_GBlk.eps_q1_diago_bse&#039; w l t &#039;6-10 Bands&#039;,&#039;o-3D_4-12_BND.eps_q1_diago_bse&#039; w l t &#039;4-12 Bands&#039;, &#039;o-3D_4-14_BND.eps_q1_diago_bse&#039; w l t &#039;4-14 Bands&#039;, &#039;o-3D_1-12_BND.eps_q1_diago_bse&#039; w l t &#039;1-12 Bands&#039; ls 4&lt;br /&gt;
&lt;br /&gt;
[[File:03 bse conv Bnds1.png|500px|center|convergence with Bnds]]&lt;br /&gt;
&lt;br /&gt;
The plot is showing that the spectrum changes only marginally when adding those bands.&lt;br /&gt;
&lt;br /&gt;
==Convergence with the k-point mesh==&lt;br /&gt;
As final step you need to study the dependence on the &#039;&#039;&#039;k&#039;&#039;&#039; mesh. This parameter cannot be changed in yambo. For each &#039;&#039;&#039;k&#039;&#039;&#039; mesh you need to run a separate non-self consistent DFT calculation (on top of a converged self-consistent one) and generate the corresponding SAVE folders. Be careful to change &#039;&#039;&#039;only&#039;&#039;&#039; the &#039;&#039;&#039;k&#039;&#039;&#039; mesh.&lt;br /&gt;
 &lt;br /&gt;
For this exercise the SAVE databases for different meshes were generated beforehand in the [http://www.yambo-code.org/educational/tutorials/files/hBN-convergence-kpoints.tar.gz hBN-convergence-kpoints.tar.gz] tarball and are contained in the corresponding folders:&lt;br /&gt;
 &amp;gt; pwd&lt;br /&gt;
 YAMBO_TUTORIALS/hBN-convergence-kpoints/YAMBO&lt;br /&gt;
 &amp;gt; ls&lt;br /&gt;
 9x9x3 12x12x4 15x15x5 18x18x6&lt;br /&gt;
&lt;br /&gt;
By now you should be familiar with the process:&lt;br /&gt;
&lt;br /&gt;
* Enter the 9x9x3 directory &lt;br /&gt;
* Run the initialization &lt;br /&gt;
* Create the input for calculating the screening:&lt;br /&gt;
  &amp;gt; yambo -F 02_screening.in -J 3D_993 -X s&lt;br /&gt;
* Modify the input as follows&lt;br /&gt;
 [[Variables#NGsBlkXs|NGsBlkXs]] = 4 Ry&lt;br /&gt;
 %[[Variables#BndsRnXs|BndsRnXs]]&lt;br /&gt;
 1 | 40 |&lt;br /&gt;
 %&lt;br /&gt;
 %[[Variables#LongDrXS|LongDrXS]]&lt;br /&gt;
 1.000 | 1.000 | 1.000|&lt;br /&gt;
 %&lt;br /&gt;
* Run the calculation for the screening&lt;br /&gt;
 &amp;gt; yambo -F 02_screening.in -J 3D_993&lt;br /&gt;
* Create the input for calculating the macroscopic dielectric function:&lt;br /&gt;
 &amp;gt; yambo -F 03_bse.in -J 3D_993 -o b -k sex -y h -V qp&lt;br /&gt;
Which combines the BS kernel + BS solver (Lanczos-Haydock) runlevels&lt;br /&gt;
* Modify the input as follows&lt;br /&gt;
 [[Variables#BSENGexx|BSENGexx]] = 30 Ry&lt;br /&gt;
 [[Variables#BSENGBlk|BSENGBlk]] = 4 Ry&lt;br /&gt;
 % [[Variables#BSEBands|BSEBands]]&lt;br /&gt;
  6 | 10 |       &lt;br /&gt;
 %&lt;br /&gt;
 % [[Variables#BEnRange|BEnRange]]&lt;br /&gt;
   2.00000 | 8.00000 | eV    &lt;br /&gt;
 %&lt;br /&gt;
 [[Variables#BEnSteps|BEnSteps]]= 200      &lt;br /&gt;
 % [[Variables#BDmRange|BDmRange]]&lt;br /&gt;
   0.10000 |  0.10000 | eV    &lt;br /&gt;
 %&lt;br /&gt;
 % [[Variables#BLongDir|BLongDir]]&lt;br /&gt;
  1.000000 | 1.000000 | 0.000000 | &lt;br /&gt;
 %&lt;br /&gt;
 % [[Variables#KfnQP_E|KfnQP_E]] &lt;br /&gt;
  1.440000 | 1.000000 | 1.000000 |&lt;br /&gt;
 %&lt;br /&gt;
 [[Variables#BSHayTrs|BSHayTrs]]= 0.02000&lt;br /&gt;
* Launch the calculation:&lt;br /&gt;
 &amp;gt; yambo -F 03_bse.in -J 3D_993&lt;br /&gt;
* Repeat the procedure for the &amp;lt;code&amp;gt;12x12x4&amp;lt;/code&amp;gt; (it will take few minutes) with the difference you will use a different prefix: &amp;lt;code&amp;gt;-J 3D_12124&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The convergence on the k-point is certainly the most tedious and expensive part. Note that for the two larger meshes the calculations of both the screening and kernel take about 10 to 30 minutes each. &lt;br /&gt;
If short of time/resources postpone these calculations. If you have the time and computational resources repeat the above procedure for &amp;lt;code&amp;gt;15x15x5&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;18x18x6&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that for those meshes the BS kernel database is becoming very/too large and you need to fragment it. To do that &#039;&#039;&#039;after&#039;&#039;&#039; you generated and modified the input invoke yambo again as:&lt;br /&gt;
 &amp;gt; yambo -F 03_bse.in -J 3D_15155 -o b -k sex -y h &#039;&#039;&#039;-V io&#039;&#039;&#039;&lt;br /&gt;
and modify the variable &lt;br /&gt;
  [[Variables#DBsFRAGpm|DBsFRAGpm]]= &amp;quot;+BS&amp;quot;&lt;br /&gt;
Then launch the calculation  &lt;br /&gt;
 &amp;gt; yambo -F 03_bse.in -J 3D_15155&lt;br /&gt;
&lt;br /&gt;
If you correctly followed the above procedure you should have a file with the optical absorption spectrum for each mesh, e.g. &amp;lt;code&amp;gt;o-3D_993.eps_q1_haydock_bse&amp;lt;/code&amp;gt;.&lt;br /&gt;
To see the effect of k-points plot those files with &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; (remember to include the 6x6x2 calculation which should still be inside &amp;lt;code&amp;gt;hBN/YAMBO&amp;lt;/code&amp;gt;, if the parameters don&#039;t match you simply rerun it here by creating a &amp;lt;code&amp;gt;6x6x2&amp;lt;/code&amp;gt; directory and copying the SAVE there):&lt;br /&gt;
 &amp;gt; gnuplot&lt;br /&gt;
 plot &#039;18x18x6/o-3D_18186.eps_q1_haydock_bse&#039; w l t &#039;18x18x6, &#039;15x15x5/o-3D_15155.eps_q1_haydock_bse&#039; w l t &#039;15x15x5&#039;,&#039;12x12x4/o-3D_12124.eps_q1_haydock_bse&#039; w l t &#039;12x12x4, &lt;br /&gt;
 &#039;9x9x3/o-3D_993.eps_q1_haydock_bse&#039; w l t &#039;9x9x3&#039;, &#039;6x6x2/o-3D_662.eps_q1_haydock_bse&#039; w l t &#039;6x6x2&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:03 bse conv k.png|500px|center|convergence with k points]]&lt;br /&gt;
&lt;br /&gt;
From this plot you can notice that:&lt;br /&gt;
* results with the 6x6x2 mesh are clearly not converged: the first peak is too red shifted, the peak at 6 eV too sharp and intense and there is an &#039;extra&#039; peak at 7 eV.&lt;br /&gt;
* both the position and shape of the first peak are practically converged with the 9x9x3 mesh.&lt;br /&gt;
* conversely the second peak is still not fully converged with the 18x18x6.&lt;br /&gt;
The different behavior in the convergence of the two features depends on the localization of the exciton. The sharp first peak suggests a localized exciton. The shape of the second peak a much more delocalized exciton. A finer &#039;&#039;&#039;k&#039;&#039;&#039; mesh, corresponds in direct space, to considering a larger amount of unit cells. Then when the excitation is delocalized over a large number of unit cells a very fine &#039;&#039;&#039;k&#039;&#039;&#039; mesh is needed. &lt;br /&gt;
Typically a too coarse &#039;&#039;&#039;k&#039;&#039;&#039; mesh induces an artificial localization of the excitons which then correspond to artefacts in the spectrum (similar to what is observed for the 6x6x9). A nice, instructive discussion on wrong deductions from unconverged &#039;&#039;&#039;k&#039;&#039;&#039; mesh calculations can be found in the Appendix of Molina-Sanchez et al. (2013).&amp;lt;ref&amp;gt;Alejandro Molina-Sánchez, Davide Sangalli, Kerstin Hummer, Andrea Marini, and Ludger Wirtz Phys. Rev. B 88, 045412 (2013)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
To sum-up the results from this tutorial you have found that for the system under study:&lt;br /&gt;
* &amp;lt;code&amp;gt;BSENGBlk= &#039;&#039;&#039;3 Ry&#039;&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;BSENGexx= &#039;&#039;&#039;10 Ry&#039;&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;BSEBands &#039;&#039;&#039;from 6 to 10&#039;&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
* To converge the position and shape of the first exciton peak a 12x12x4 mesh is sufficient. For the second exciton peak a mesh larger than 18x18x6 would be needed (indeed Wirtz and co-workers found a k-mesh 24x24x10 was needed.&amp;lt;ref&amp;gt;Ludger Wirtz, Andrea Marini, Myrta Gruning, Angel Rubio in arXiv:cond-mat/0508421 [cond-mat.mtrl-sci]&amp;lt;/ref&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* Go to [[Calculating optical spectra including excitonic effects: a step-by-step guide]] module&lt;br /&gt;
* Back to [[Modena 2025]]&lt;br /&gt;
* Back to [[Rome 2023#Tutorials]]&lt;br /&gt;
* Back to [[BSE hBN Yambo Virtual 2021 version|BSE tutorial sections]]&lt;br /&gt;
* Back to [[ICTP 2022]]&lt;br /&gt;
* Back to [[CECAM VIRTUAL 2021]]&lt;br /&gt;
* [[Modules|Back to technical modules menu]]&lt;br /&gt;
* [[Tutorials|Back to tutorials menu]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=BSE_solvers_overview&amp;diff=8796</id>
		<title>BSE solvers overview</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=BSE_solvers_overview&amp;diff=8796"/>
		<updated>2025-05-21T14:12:18Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Navigate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial explores the options available in Yambo for the numerical solution of the Bethe-Salpeter equation. Before running this tutorial, you should have carried out the tutorial &#039;&#039;&#039;[[Calculating optical spectra including excitonic effects: a step-by-step guide]]&#039;&#039;&#039;. We will use the same example system (bulk hBN). The various options correspond to different numerical methods for solving (large) eigenvalue problems. The numerical methods are not covered in this tutorial and the interested user is directed to the references.&lt;br /&gt;
&lt;br /&gt;
After completion of this tutorial, you are expected to recognize which solver to use depending on the system, computational load and desired output. Also, for each of the solver, you should be able to choose the values for the key input parameters. &lt;br /&gt;
&lt;br /&gt;
Three main solvers are available in Yambo:&lt;br /&gt;
__TOC__&lt;br /&gt;
===Full diagonalization solver===&lt;br /&gt;
Diagonalization of the full Hamiltonian using the standard LAPACK library.  &lt;br /&gt;
&lt;br /&gt;
This solver outputs the macroscopic dielectric function over a range of energies chosen by the user. It also calculates all exciton energies and composition in terms of electron-hole pairs. Upon user&#039;s choice, the latter is stored on disk for use in postprocessing for exciton analysis and plotting as seen in the tutorial &#039;&#039;&#039;[[How to analyse excitons - CECAM 2021 school|How to analyse excitons]]&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Unfortunately, the computational cost of full diagonalization is cubic in the number of electron-hole pairs so this solver can be used for small system only (few light atoms per unit cell).   &lt;br /&gt;
 &lt;br /&gt;
You should have already carried out the  &#039;&#039;&#039;[[Bethe-Salpeter solver: diagonalization]]&#039;&#039;&#039;. If you wish, you can run again this part and then &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Lanczos-Haydock solver===&lt;br /&gt;
Subspace iterative [https://en.wikipedia.org/wiki/Lanczos_algorithm | Lanczos algorithm] which by-pass diagonalization with the Haydock approach&amp;lt;ref&amp;gt;R. Haydock, in&lt;br /&gt;
 &#039;&#039;Solid State Phys.&#039;&#039;, &#039;&#039;&#039;35&#039;&#039;&#039; 215 (1980) edited by H. Ehrenfest, F. Seitz, and D. Turnbull, Academic Press&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This solver outputs the macroscopic dielectric function over a range of energies chosen by the user. It can be applied to medium-large systems as it is substantially cheaper than the full diagonalization (quadratic with the number of electron-hole pairs). However, this approach &#039;&#039;does not provide&#039;&#039; the individual exciton energies and composition in terms of electron-hole pairs.&lt;br /&gt;
&lt;br /&gt;
Follow the link to &#039;&#039;&#039;[[Bethe-Salpeter solver: Lanczos-Haydock]]&#039;&#039;&#039; then  &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===SLEPc solver ===&lt;br /&gt;
Subspace iterative algorithm using the [https://slepc.upv.es SLEPc library]&amp;lt;ref&amp;gt;V. Hernandez, J.E. Roman and V. Vidal in &#039;&#039; ACM Transactions on Mathematical Software&#039;&#039;, &#039;&#039;&#039;31&#039;&#039;&#039; 315 (2005)&amp;lt;/ref&amp;gt; (SLEPC solver).&lt;br /&gt;
&lt;br /&gt;
This solver outputs the individual exciton energies and composition about an energy value chosen by the user. It can be applied to medium-large systems but does not provide the overall spectrum. This solver is typically used after obtaining the spectra from the Lanczos-Haydock solver to either analyze a specific peak or getting the energy and composition of a few low-lying excitons. It can be used for large-medium systems. The computational cost grows with the number of excitons one asks to compute.  &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Optional:&#039;&#039;&#039;&lt;br /&gt;
Advanced users can recompile Yambo with the &#039;&#039;--enable-slepc-linalg&#039;&#039; option if they hadn&#039;t done so. &lt;br /&gt;
If/Once you have a Yambo version compiled with the SLEPc, or you have the Virtual Machine or the Docker (with the yambo-gcc_openmp_petsc [[CECAM_VIRTUAL_2021 | container]]), follow the link to &#039;&#039;&#039;[[Bethe-Salpeter solver: SLEPC]]&#039;&#039;&#039; then  &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
To summarise, the output (dielectric function, exciton energies and composition) and cost of the three solvers are summarized in this table.&lt;br /&gt;
&lt;br /&gt;
[[File:Solver.png|Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Navigate==&lt;br /&gt;
* Back to [[Modena 2025]]&lt;br /&gt;
* Back to [[Rome 2023#Tutorials]]&lt;br /&gt;
* Back to [[BSE hBN Yambo Virtual 2021 version|BSE tutorial sections]]&lt;br /&gt;
* Back to [[ICTP 2022]]&lt;br /&gt;
* Back to [[CECAM VIRTUAL 2021]]&lt;br /&gt;
* [[Modules|Back to technical modules menu]]&lt;br /&gt;
* [[Tutorials|Back to tutorials menu]]&lt;br /&gt;
&lt;br /&gt;
=References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_analyse_excitons_-_ICTP_2022_school&amp;diff=8795</id>
		<title>How to analyse excitons - ICTP 2022 school</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_analyse_excitons_-_ICTP_2022_school&amp;diff=8795"/>
		<updated>2025-05-21T14:11:02Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Navigate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial you will learn how to:&lt;br /&gt;
* analyze an optical spectrum obtained from BSE in terms of excitonic energies and composition&lt;br /&gt;
* look at the spatial distribution of the exciton&lt;br /&gt;
&lt;br /&gt;
This is demonstrated for 3D hBN, for which you should have obtained the needed data from previous calculations. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: for this demonstration, we did not use converged parameters (in particular they are not converged for the k-grid). Note that one needs to converge carefully all parameters to obtain scientific relevant results. This will be the topic of [[How to choose the input parameters | one of the next tutorials]]. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&#039;&#039;&#039;Previous modules&#039;&#039;&#039;&lt;br /&gt;
* You must have completed the [[Calculating optical spectra including excitonic effects: a step-by-step guide]] tutorial.&lt;br /&gt;
&#039;&#039;&#039;You will need&#039;&#039;&#039;:&lt;br /&gt;
* The &amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt; databases for 3D hBN &lt;br /&gt;
* The &amp;lt;code&amp;gt;3D_BSE&amp;lt;/code&amp;gt; directory containing the &amp;lt;code&amp;gt;ndb.BS_diago*&amp;lt;/code&amp;gt; databases for 3D hBN&lt;br /&gt;
* &amp;lt;code&amp;gt;ypp &amp;lt;/code&amp;gt; executable&lt;br /&gt;
* &amp;lt;code&amp;gt;xcrysden&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;VESTA&amp;lt;/code&amp;gt; executables&lt;br /&gt;
* &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; executable&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All the databases required for this tutorial should be in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS/hBN/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Recall that in order to plot excitonic wave functions, you need to have done a BSE calculation with either the &amp;lt;code&amp;gt;diago&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;slepc&amp;lt;/code&amp;gt; solvers and explicitly set the flag &amp;lt;code&amp;gt;WRbsWF&amp;lt;/code&amp;gt; to print the wave function databases to disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== YAMBO calculations ==&lt;br /&gt;
Enter the &amp;lt;code&amp;gt;YAMBO_TUTORIALS/hBN/&amp;lt;/code&amp;gt; directory. In there you have the &amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
 $ ls ./SAVE&lt;br /&gt;
 ndb.gops ndb.kindx ns.db1 ns.kb_pp_pwscf_fragment_1 ....&lt;br /&gt;
&lt;br /&gt;
and the &amp;lt;code&amp;gt;3D_BSE&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
 $ ls ./3D_BSE&lt;br /&gt;
 ndb.BS_Q1_CPU_0 ndb.BS_diago_Q1 ndb.dip_iR_and_P_fragment_1 ndb.em1s_fragment_1 ...&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==List the excitonic energies==&lt;br /&gt;
&lt;br /&gt;
First, we will obtain the list of all the exciton energies (that is the eigenvalues of the two-particle Hamiltonian) sorted both by energy and strength. The exciton strengths or intensities are defined from the expression of the optical absorption spectrum as&lt;br /&gt;
&lt;br /&gt;
[[File:strengh.png|none|x150px|]]&lt;br /&gt;
&lt;br /&gt;
That is, they are given by the linear combination of the square of the dipole transition matrix elements between electron-hole pairs, where A&amp;lt;sup&amp;gt;&amp;amp;lambda;&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;&#039;&#039;eh&#039;&#039;&amp;lt;/sub&amp;gt;  is the exciton composition in terms of electron-hole pairs. &lt;br /&gt;
&lt;br /&gt;
To read this information from the Yambo databases produced in [[Bethe-Salpeter solver: diagonalization| this previous step]], we use the Yambo pre- and post-processing utility &amp;lt;code&amp;gt;ypp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Type:&lt;br /&gt;
&lt;br /&gt;
 $ ypp -J 3D_BSE -e s 1&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This instructs the code to list the excitons (&amp;lt;code&amp;gt;-e s&amp;lt;/code&amp;gt;) in the database &#039;&#039;3D_BSE&#039;&#039; (&amp;lt;code&amp;gt;-J 3D_BSE&amp;lt;/code&amp;gt;) for the q-index = 1 (optical limit q=0). &lt;br /&gt;
&lt;br /&gt;
The results are output in the files &#039;&#039;o-3D_BSE.exc_qpt1_E_sorted&#039;&#039; and &#039;&#039;o-3D_BSE.exc_qpt1_I_sorted&#039;&#039;. &lt;br /&gt;
They report the energies of the excitons and their strengths. The strengths are normalised to the largest strength. Thus in the list, the brightest exciton has strength 1. &lt;br /&gt;
In &#039;&#039;o-3D_BSE.exc_qpt1_E_sorted&#039;&#039; the exciton energies are sorted by energy  (lower to higher), in &#039;&#039;o-3D_BSE.exc_qpt1_I_sorted&#039;&#039; by the oscillator strength (larger to smaller).&lt;br /&gt;
&lt;br /&gt;
Inspect &#039;&#039;o-3D_BSE.exc_qpt1_E_sorted&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
The exciton with the lowest energy (4.98 eV) is doubly degenerate. The strength is ~0, thus this exciton is dark, does not contribute to the absorption spectrum. &lt;br /&gt;
&lt;br /&gt;
The second-lowest exciton is also doubly degenerate and it is the brightest (one of the components has strength 1, the other ~0.03). The latter exciton is the one responsible for the largest peak in the optical absorption plots of the [[Bethe-Salpeter solver: diagonalization|previous tutorials]].&lt;br /&gt;
&lt;br /&gt;
To better visualize these results, we plot the exciton strength (normalized to 1, arbitrary units) versus the energy (in eV):&lt;br /&gt;
 $ gnuplot&lt;br /&gt;
 gnuplot&amp;gt; set style line 2 lc rgb &#039;black&#039; pt 7   # circle&lt;br /&gt;
 gnuplot&amp;gt; plot &#039;o-3D_BSE.exc_qpt1_E_sorted&#039; with points ls 2 title &#039;Strengths&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Exc weights3DhBN2.png|none|600px]]&lt;br /&gt;
&lt;br /&gt;
== Calculate the exciton oscillator strength and amplitude ==&lt;br /&gt;
&lt;br /&gt;
Once inspected the list of excitons sorted by energies and strengths, we will look at the composition of some of these excitons in terms of single-particle states (electron-hole pairs). &lt;br /&gt;
&lt;br /&gt;
Type: &lt;br /&gt;
 $ ypp -F ypp_AMPL.in -J 3D_BSE -e a 1 &lt;br /&gt;
&lt;br /&gt;
This instructs the code to create the the input file &#039;&#039;ypp_AMPL.in&#039;&#039; (&amp;lt;code&amp;gt;-F ypp_AMPL.in&amp;lt;/code&amp;gt;) to analyze the composition of the excitons (&amp;lt;code&amp;gt;-e a&amp;lt;/code&amp;gt;) in the database &#039;&#039;3D_BSE&#039;&#039; (&amp;lt;code&amp;gt;-J 3D_BSE&amp;lt;/code&amp;gt;) for the q-index = 1 (optical limit q=0). &lt;br /&gt;
&lt;br /&gt;
You can now edit the input file &#039;&#039;ypp_AMPL.in&#039;&#039;. From the list of excitons, we should have got an idea of which excitons we wish to analyze. The ordering from the list of exciton sorted by energies in &#039;&#039;o-3D_BSE.exc_qpt1_E_sorted&#039;&#039; is used to identify the excitons to analyse.&lt;br /&gt;
&lt;br /&gt;
For example, to analyse the 4 lowest-energy excitons (i.e., the first 2 doubly-degenerate excitons of which the first is dark and the second is bright) change this line as:&lt;br /&gt;
 States= &amp;quot;1 - 4&amp;quot;              # Index of the BS state(s)&lt;br /&gt;
&lt;br /&gt;
Close the input file and run &amp;lt;code&amp;gt;ypp&amp;lt;/code&amp;gt; again by typing&lt;br /&gt;
&lt;br /&gt;
 $ ypp -F ypp_AMPL.in -J 3D_BSE&lt;br /&gt;
&lt;br /&gt;
This carries out the analysis for the specified excitons. The results are output in &#039;&#039;o-3D_BSE.exc_qpt1_amplitude_at_*&#039;&#039; and  &#039;&#039;o-3D_BSE.exc_qpt1_weights_at_*&#039;&#039;, where &#039;&#039;*&#039;&#039; identifies the exciton according to the order in &#039;&#039;o-3D_BSE.exc_qpt1_E_sorted&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
 $ ls  o*exc*at*&lt;br /&gt;
 o-3D_BSE.exc_qpt1_amplitude_at_1 o-3D_BSE.exc_qpt1_weights_at_1 ...&lt;br /&gt;
 &lt;br /&gt;
For an exciton  &amp;lt;math&amp;gt;|\lambda&amp;gt;&amp;lt;/math&amp;gt; , &#039;&#039;o-3D_BSE.exc_qpt1_weights_at_*&#039;&#039; reports the weights defined as &lt;br /&gt;
[[File:Weights.png|none|x60px|]]&lt;br /&gt;
and &#039;&#039;o-3D_BSE.exc_qpt1_amplitude_* &#039;&#039; reports the amplitudes defined as &lt;br /&gt;
[[File:Ampl.png|none|x70px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Inspect, for example, the file &#039;&#039;o-3D_BSE.exc_weights_at_3&#039;&#039; (which we learned from &#039;&#039;o-3D_BSE.exc_qpt1_E_sorted&#039;&#039; has the largest strength) &lt;br /&gt;
&lt;br /&gt;
 # Band_V          Band_C          Kv-q ibz        Symm_kv         Kc ibz          Symm_kc         Weight          Energy&lt;br /&gt;
 #    &lt;br /&gt;
   7.00000000      10.0000000      14.0000000      2.00000000      14.0000000      2.00000000     0.395135850      4.35248947   &lt;br /&gt;
   7.00000000      10.0000000      14.0000000      1.00000000      14.0000000      1.00000000     0.394993663      4.35248947   &lt;br /&gt;
   8.00000000      9.00000000      14.0000000      2.00000000      14.0000000      2.00000000     0.391943455      4.35241365   &lt;br /&gt;
   8.00000000      9.00000000      14.0000000      1.00000000      14.0000000      1.00000000     0.391800284      4.35241365   &lt;br /&gt;
   7.00000000      10.0000000      13.0000000      2.00000000      13.0000000      2.00000000     0.745555162E-1   4.81094742   &lt;br /&gt;
   7.00000000      10.0000000      13.0000000      1.00000000      13.0000000      1.00000000     0.745274872E-1   4.81094742   &lt;br /&gt;
   8.00000000      9.00000000      13.0000000      2.00000000      13.0000000      2.00000000     0.739243180E-1   4.81087065   &lt;br /&gt;
   8.00000000      9.00000000      13.0000000      1.00000000      13.0000000      1.00000000     0.738964081E-1   4.81087065   &lt;br /&gt;
&lt;br /&gt;
The third exciton is mostly composed of single-particle transitions from VBM to CBM at point H (last k-point of the grid, number 14) of the 3D hexagonal Brillouin zone, with contributions also coming from point K (number 13). All the contributions weighing less than 5% are not shown by default. &lt;br /&gt;
&lt;br /&gt;
Recall from the previous analysis that of the first 4 exciton states, exciton states 3 and 4 (degenerate) are the optically active ones. We plot then the amplitude of the lowest energy bright exciton:&lt;br /&gt;
 $ paste o-3D_BSE.exc_qpt1_amplitude_at_3 o-3D_BSE.exc_qpt1_amplitude_at_4 &amp;gt; o-3D_BSE.exc_qpt1_amplitude_at_3_4&lt;br /&gt;
 $ gnuplot&lt;br /&gt;
 gnuplot&amp;gt; set xlabel &#039;Energy (eV)&#039; &lt;br /&gt;
 gnuplot&amp;gt; set ylabel &#039;Amplitude&#039; &lt;br /&gt;
 gnuplot&amp;gt; p &#039;o-3D_BSE.exc_qpt1_amplitude_at_3_4&#039; u 1:($2+$4)/2 w l t &#039;Bright exciton&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:ExcAmp3DhBN.png|none|600px]]&lt;br /&gt;
&lt;br /&gt;
Note that while this plot is related to the peaks in the optical absorption spectrum, it does not take into account the dipole matrix elements and the peaks appear at the energies of the single-particle transitions rather than the exciton energies.&lt;br /&gt;
&lt;br /&gt;
== Plot the exciton spatial distribution ==&lt;br /&gt;
&lt;br /&gt;
A further analysis we carry out is on the spatial distribution of the exciton, specifically of the probability of finding the electron at a certain position r when the hole is fixed in a position r&#039;.&lt;br /&gt;
&lt;br /&gt;
Create the input file ``ypp_WF.in`` using the command below and change the various parameters as shown below: &lt;br /&gt;
&lt;br /&gt;
 $ ypp -F ypp_WF.in -J 3D_BSE -e w&lt;br /&gt;
&lt;br /&gt;
 excitons                     # [R] Excitons&lt;br /&gt;
 wavefunction                 # [R] Wavefunction&lt;br /&gt;
 Format= &amp;quot;x&amp;quot;                  # Output format [(c)ube/(g)nuplot/(x)crysden]&lt;br /&gt;
 Direction= &amp;quot;123&amp;quot;               # [rlu] [1/2/3] for 1d or [12/13/23] for 2d [123] for 3D&lt;br /&gt;
 FFTGvecs=  30        Ry    # [FFT] Plane-waves&lt;br /&gt;
 States= &amp;quot;3 - 3&amp;quot;              # Index of the BS state(s)&lt;br /&gt;
 Degen_Step=   0.0100   eV    # Maximum energy separation of two degenerate states&lt;br /&gt;
 % Cells&lt;br /&gt;
  5 | 5 | 1 |                             # Number of cell repetitions in each direction (odd or 1)&lt;br /&gt;
 %&lt;br /&gt;
 % Hole&lt;br /&gt;
 2.35800028 | 1.36139178 | 7.08835602 # [cc] Hole position in unit cell (positive)&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Cells&amp;lt;/code&amp;gt;, is the size of the cell where the exciton will be visualised.&lt;br /&gt;
If the k-grid used for the BSE calculations is XxYxZ, then the exciton has an induced fictitious periodicity for every XxYxZ cells of the simulation.&lt;br /&gt;
For hBN, this is not a problem because the first bright exciton is strongly localized, but in other systems, where excitons are more delocalized, one must use very large k-grids for the BSE calculation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Degen_Step&amp;lt;/code&amp;gt;, tells the maximum energy separation of two degenerate states. Since this value is small enough, the code will automatically recognize excitons 3 and 4 are degenerate and merge them: you can check this in the log file.&lt;br /&gt;
&lt;br /&gt;
Plots can be in 1, 2 or 3D (&amp;lt;code&amp;gt;Direction&amp;lt;/code&amp;gt;) and the output format is chosen with &amp;lt;code&amp;gt;Format&amp;lt;/code&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
A non-trivial input parameter is the hole position. The best position for the hole is where the valence electrons contributing to the exciton are localised. In the case of hBN, they are on the nitrogen atoms. We can obtain the Cartesian coordinates of these atoms from our previously generated &#039;&#039;o-3D_BSE.exc_qpt1_E_sorted&#039;&#039; file:&lt;br /&gt;
 # Atom 1 with Z 5 [cc]:  2.35800028      1.36139178      0.00000000   &lt;br /&gt;
 # Atom 2 with Z 5 [cc]: -2.35800028     -1.36139178      6.08835602   &lt;br /&gt;
 # Atom 1 with Z 7 [cc]: -2.35800028     -1.36139178      0.00000000   &lt;br /&gt;
 # Atom 2 with Z 7 [cc]:  2.35800028      1.36139178      6.08835602 &lt;br /&gt;
We take the positive values of the nitrogen (Z=7, last line) and shift the vertical position of the hole from 6.088 to 7.088 so that the hole does not end up in the center of the atom (and therefore, possibly in a node of the wave function).  &lt;br /&gt;
&lt;br /&gt;
Close the input file and run &amp;lt;code&amp;gt;ypp&amp;lt;/code&amp;gt; by typing &lt;br /&gt;
 $ ypp -F ypp_WF.in -J 3D_BSE&lt;br /&gt;
&lt;br /&gt;
After the calculation is completed, we can visualise the output with xcrysden or with VESTA (if you are running this tutorial on a remote cluster, you should download the *.xsf file using &amp;lt;code&amp;gt;scp&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 $ xcrysden --xsf o-3D_BSE.exc_qpt1_3d_3.xsf&lt;br /&gt;
&lt;br /&gt;
 $ VESTA o-3D_BSE.exc_qpt1_3d_3.xsf&lt;br /&gt;
&lt;br /&gt;
[[File:ExcWF3DhBN.jpg|none|600px]]&lt;br /&gt;
&lt;br /&gt;
We notice that the electron is completely confined on the boron atoms and on the same layer of the hole. For comparison, see for example ref. &amp;lt;ref&amp;gt;Huge Excitonic Effects in Layered Hexagonal Boron Nitride, B. Arnaud et al., [https://arxiv.org/abs/cond-mat/0503390 preprint ArXiv]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Plot electron/hole average density (only in Yambo 5.x)==&lt;br /&gt;
&lt;br /&gt;
Another way to analyze the spatial character of excitons is to plot the average electron/hole densities defined as:&lt;br /&gt;
&lt;br /&gt;
[[File:Electron hole density.png|400px]]&lt;br /&gt;
&lt;br /&gt;
To generate the input file ypp_WF.in type&lt;br /&gt;
&lt;br /&gt;
 ypp -F ypp_WF.in -e w -avehole&lt;br /&gt;
&lt;br /&gt;
and choose the exciton you want to plot according to the list of energy-sorted excitons. The electron/hole average densities correspond to generalized valence/conduction orbitals for a given exciton. They are interesting in particular for molecular crystals because they allow distinguishing charge-transfer versus Frenkel excitons, from the relative position of the electron/hole densities.&lt;br /&gt;
&lt;br /&gt;
If you want to see an example of hole/electron density of excitons please have a look at Ref. &amp;lt;ref&amp;gt;Strongly Bound Excitons in Metal-Organic Framework MOF-5: A Many-Body Perturbation Theory Study, A. R. Kshirsagar et al., [https://doi.org/10.26434/chemrxiv.14034917.v1 preprint ChemRxiv]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
From this tutorial you&#039;ve learned:&lt;br /&gt;
* How sort excitonic states by energy and intensity&lt;br /&gt;
* Analyse their composition in reciprocal space and in terms of single-particle transitions&lt;br /&gt;
* Visualize the exciton wave function in real space&lt;br /&gt;
&lt;br /&gt;
=References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Navigate==&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide]] tutorial&lt;br /&gt;
* Back to [[Modena 2025]]&lt;br /&gt;
* Back to [[Rome 2023#Tutorials]]&lt;br /&gt;
* Back to [[ICTP 2022]]&lt;br /&gt;
* [[BSE hBN Yambo Virtual 2021 version|Back to CECAM 2021 tutorial page for the BSE]]&lt;br /&gt;
* [[Tutorials|Back to tutorials menu]]&lt;br /&gt;
* [[Modules|Back to technical modules menu]]&lt;br /&gt;
* Similar tutorial for 2D-hBN and including finite-momentum BSE: [[How to analyse excitons|this page]].&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Calculating_optical_spectra_including_excitonic_effects:_a_step-by-step_guide&amp;diff=8794</id>
		<title>Calculating optical spectra including excitonic effects: a step-by-step guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Calculating_optical_spectra_including_excitonic_effects:_a_step-by-step_guide&amp;diff=8794"/>
		<updated>2025-05-21T14:09:35Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial guides you through the workflow of a calculation of the optical spectrum of a given material by solving the Bethe-Salpeter equation.&lt;br /&gt;
Specifically, we will use [[Bulk material: h-BN|bulk h-BN]] as an example.&lt;br /&gt;
&lt;br /&gt;
[[File:HBN-bulk-3x3-annotated.png|x200px|center|Atomic structure of bulk hBN]]&lt;br /&gt;
&lt;br /&gt;
Before starting, you need to obtain the tarballs for hBN. See instructions on the [[Tutorials|main tutorials page]].&lt;br /&gt;
&lt;br /&gt;
The target quantity in a Bethe-Salpeter calculation is the macroscopic dielectric matrix &amp;amp;epsilon;&amp;lt;sub&amp;gt;M&amp;lt;/sub&amp;gt;. The following quantities/steps are needed to obtain &amp;amp;epsilon;&amp;lt;sub&amp;gt;M&amp;lt;/sub&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
[[File:Scheme1b.png|500px|center|BSE calculation scheme]]&lt;br /&gt;
&lt;br /&gt;
The optical absorption spectrum corresponds to Im&amp;amp;epsilon;&amp;lt;sub&amp;gt;M&amp;lt;/sub&amp;gt;(&amp;amp;omega;). Following this scheme we go through the flow of a calculation:&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Step 1: Static screening===&lt;br /&gt;
Use the &#039;&#039;SAVE&#039;&#039; folders that are already provided and type:&lt;br /&gt;
 $ cd YAMBO_TUTORIALS/hBN/YAMBO&lt;br /&gt;
&lt;br /&gt;
Follow the &#039;&#039;&#039;[[Static screening]]&#039;&#039;&#039; module and then &#039;&#039;&#039;return to this tutorial &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Step 2: Bethe-Salpeter kernel===&lt;br /&gt;
Follow the module on &#039;&#039;&#039;[[Bethe-Salpeter kernel]]&#039;&#039;&#039; and &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
===Step 3: Diagonalisation of the excitonic Hamiltonian ===&lt;br /&gt;
This is the step in which you obtain the spectra. Mathematically this implies solving a large eigenvalue problem. In this tutorial, we diagonalise the whole Bethe-Salpeter matrix, but there are other numerical approaches available in Yambo. The difference between these approaches and when they should be used is the object of [[BSE solvers overview|one of the next tutorials]]. &lt;br /&gt;
&lt;br /&gt;
Follow the module on &#039;&#039;&#039;[[Bethe-Salpeter solver: diagonalization]]&#039;&#039;&#039; then &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Include previous quasiparticle (GW) results ===&lt;br /&gt;
In Step 3, we included the quasiparticle corrections to the Kohn-sham energies as a scissor operator. An alternative is to use the results from a previous run of Yambo.&lt;br /&gt;
&lt;br /&gt;
Follow the module on &#039;&#039;&#039;[[Bethe-Salpeter on top of quasiparticle energies]]&#039;&#039;&#039; and &#039;&#039;&#039;return to this tutorial&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* Back to [[Modena 2025]]&lt;br /&gt;
* [[Modules|Back to technical modules menu]]&lt;br /&gt;
* [[Tutorials|Back to tutorials menu]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
= Calculating the effective two-particle Hamiltonian =  &lt;br /&gt;
&lt;br /&gt;
This first part calculates and stores the two-particle Hamiltonian matrix elements:&lt;br /&gt;
[[File:BSE1-Eq1.png|none|x50px]]&lt;br /&gt;
where &#039;&#039;vc&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039; indicates the pair of quasiparticle states &#039;&#039;v&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039; and &#039;&#039;c&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039;.&lt;br /&gt;
The first term on the RHS is the quasiparticle energy differences (diagonal only). The second term is the kernel which is the sum of the electron-hole exchange part &#039;&#039;V&#039;&#039; (which stems from the Hartree potential) and the electron-hole attraction part &#039;&#039;W&#039;&#039; (which stems from the screened exchange potential).  The kernel both shifts (diagonal contributions) and couples (off-diagonal contributions) the quasiparticle energy differences. &lt;br /&gt;
&lt;br /&gt;
We start the calculation by running the [[Initialization|initialization step]] (i.e. invoke yambo from the command line in the directory containing the relevant SAVE directory).&lt;br /&gt;
 &lt;br /&gt;
== Step1: Calculation of the static dielectric screening.==&lt;br /&gt;
&lt;br /&gt;
Next, to calculate the correlation part of the kernel &#039;&#039;W&#039;&#039; we need the static dielectric screening. This is a calculation of the linear response of the system analogous to the calculation of the [[RPA/IP]] dielectric function. One important difference is that here we consider the static dielectric function.       &lt;br /&gt;
[[File:BSE1-Eq2.png|none|x50px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start by [[Input file generation|generating the input]] by invoking yambo with the option &amp;quot;-b&amp;quot;  from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ yambo -b -F 01_3D_BSE_screening.in&lt;br /&gt;
&lt;br /&gt;
The input opens in the standard editor. Similarly to the other linear response calculations the relevant input variables to be changed are: &lt;br /&gt;
&lt;br /&gt;
 % [[Variables#BndsRnXs|BndsRnXs]]&lt;br /&gt;
   1 | 40 |                 &lt;br /&gt;
 %&lt;br /&gt;
  [[Variables#NGsBlkXs|NGsBlkXs]]= 4 Ry&lt;br /&gt;
&lt;br /&gt;
The first variable gives how many bands are included in the sum to calculate the static response function. The second is a cutoff for the dimension of the static dielectric matrix.&lt;br /&gt;
&lt;br /&gt;
In the [[How to choose the input parameters|next tutorial]] you will see how to choose these two parameters. Another relevant input parameter to change is&lt;br /&gt;
&lt;br /&gt;
 % [[Variables#LongDrXs|LongDrXs]]&lt;br /&gt;
  1.000 | 1.000| 1.000&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
so that the perturbing electric field has component in each direction.&lt;br /&gt;
&lt;br /&gt;
Run the calculation by invoking yambo:&lt;br /&gt;
 $ yambo -F 01_3D_BSE_screening.in -J 3D_BSE &lt;br /&gt;
&lt;br /&gt;
In the log (l_em1s) of the calculation you can see that after calculating the dipole matrix elements, for each q vector yambo calculates the IP response function and by inversion the RPA response function &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;02s&amp;gt; Xo@q[1] |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;02s&amp;gt; X@q[1] |########################################| [100%] --(E) --(X)&lt;br /&gt;
&lt;br /&gt;
In the report, r_em1s, the details of the calculations are reported under the 5th section&lt;br /&gt;
&lt;br /&gt;
 [05] Static Dielectric Matrix&lt;br /&gt;
 =============================&lt;br /&gt;
&lt;br /&gt;
This calculation does not produce any human readable output, but both the dipole matrix elements and the static screening dielectric function are saved in a database in the 3D_BSE directory:&lt;br /&gt;
&lt;br /&gt;
 3D_BSE/ndb.dip_iR_and_P&lt;br /&gt;
 3D_BSE/ndb.em1s&lt;br /&gt;
&lt;br /&gt;
which are needed and read by the following yambo runlevels.&lt;br /&gt;
&lt;br /&gt;
== Step2: Calculation of matrix elements of the BSE kernel ==&lt;br /&gt;
&lt;br /&gt;
You have now all ingredients to calculate the kernel &lt;br /&gt;
&lt;br /&gt;
[[File:BSE1_Eq3.png|none|x100px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(and thus the two-particle Hamiltonian matrix elements).&lt;br /&gt;
&lt;br /&gt;
Start by generating the input by invoking yambo with the option &amp;quot;-o b -k bse -V qp&amp;quot;  from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ yambo -o b -k bse -V qp -F 02_3D_BSE_kernel.in&lt;br /&gt;
&lt;br /&gt;
The input opens in the standard editor. The relevant input parameters to be changed are &lt;br /&gt;
&lt;br /&gt;
 [[Variables#BSENGexx|BSENGexx]] = 30 Ry&lt;br /&gt;
 [[Variables#BSENGBlk|BSENGBlk]] = 4 Ry&lt;br /&gt;
 % [[Variables#BSEBands|BSEBands]]&lt;br /&gt;
  6 | 10 |       &lt;br /&gt;
 %&lt;br /&gt;
The first two are the cutoff for the summations on the reciprocal lattice vectors which appear in the expressions for &#039;&#039;V&#039;&#039; (BSENGexx) and &#039;&#039;W&#039;&#039; (BSENGBlk) here above.   &lt;br /&gt;
&lt;br /&gt;
The third parameter gives the range of quasiparticle states (their band index) that define the basis of quasiparticle pairs that we need to describe the excitons (in the energy range of interest).&lt;br /&gt;
For example since we have 8 occupied bands, here we consider the pairs of bands: &#039;&#039;6-9&#039;&#039;, &#039;&#039;6-10&#039;&#039;, &#039;&#039;7-9&#039;&#039;, &#039;&#039;7-10&#039;&#039;, &#039;&#039;8-9&#039;&#039;, &#039;&#039;8-10&#039;&#039; (those are 6 pairs of bands = 2 valence times 3 conduction bands). &lt;br /&gt;
&lt;br /&gt;
For each of those pairs we then consider all &#039;&#039;&#039;k&#039;&#039;&#039; points in the Brillouin zone available from the DFT calculations. Since we have a &#039;&#039;6 x 6 x 2&#039;&#039; grid, this amounts to 72 &#039;&#039;&#039;k&#039;&#039;&#039; points in the Brillouin zone. &lt;br /&gt;
&lt;br /&gt;
Then finally we are using a basis of &#039;&#039;6 x 72 = 432&#039;&#039; &#039;&#039;vc&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039; pairs to represent the excitons of the system.  &lt;br /&gt;
  &lt;br /&gt;
The values for these 3 parameters are chosen from convergence studies, as discussed in the [[How to choose the input parameters|next tutorial]].&lt;br /&gt;
&lt;br /&gt;
Another parameter to modify is&lt;br /&gt;
 % [[Variables#KfnQP_E|KfnQP_E]] &lt;br /&gt;
  1.440000 | 1.000000 | 1.000000 |&lt;br /&gt;
 %&lt;br /&gt;
This gives the quasiparticle corrections to the Kohn-Sham eigenvalues and  is deduced either from experiment or previous [[How to obtain the quasi-particle band structure of a bulk material: h-BN|GW calculations]]. &lt;br /&gt;
The corrections consist in a shift (first value) of the conduction bands in eV and renormalization of the conduction and valence bandwidths (second and third value). &lt;br /&gt;
Alternatively we can directly input corrections calculated from a previous GW calculation as we will learn later in this tutorial.&lt;br /&gt;
&lt;br /&gt;
Run the calculation by invoking yambo in the command line:&lt;br /&gt;
 $ yambo -F 02_3D_BSE_kernel.in -J 3D_BSE &lt;br /&gt;
In the log (either in standard output or in l_optics_bse_bsk), after various setup/loading, the kernel is calculated:  &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;01s&amp;gt; [05.04.03] Kernel loop&lt;br /&gt;
 &amp;lt;02s&amp;gt; Kernel |########################################| [100%] --(E) --(X)&lt;br /&gt;
&lt;br /&gt;
In the report r_optics_bse_bsk the information relative to this runlevel are reported under the section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [05] Response Functions in Transition space&lt;br /&gt;
 ===========================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the log and the report. For example try to find where the input parameters are reported, the dimension of the 2-particle hamiltonian and if these match your expectations.&lt;br /&gt;
&lt;br /&gt;
This run does not produce any human readable output. The kernel is stored in a database in the 3D_BSE directory&lt;br /&gt;
&lt;br /&gt;
 3D_BSE/ndb.BS_Q1&lt;br /&gt;
&lt;br /&gt;
= Obtaining the optical spectrum from the two-particle Hamiltonian =&lt;br /&gt;
The macroscopic dielectric function (from which the absorption and EEL spectra can be computed) is obtained from the eigenvalues &#039;&#039;E&#039;&#039;&amp;lt;sub&amp;gt;&amp;amp;lambda;&amp;lt;/sub&amp;gt; (excitonic energies) and eigenvectors A&amp;lt;sup&amp;gt;&amp;amp;lambda;&amp;lt;/sup&amp;gt;&amp;lt;sub&amp;gt;&#039;&#039;cv&#039;&#039;&#039;&#039;&#039;k&#039;&#039;&#039;&amp;lt;/sub&amp;gt; (exciton composition in terms of electron-hole pairs) of the two-particle Hamiltonian:&lt;br /&gt;
&lt;br /&gt;
[[File:BSE1-Eq4.png|none|x50px]]&lt;br /&gt;
&lt;br /&gt;
To get the two-particle Hamiltonian eigensolutions you can either &lt;br /&gt;
&lt;br /&gt;
(1) diagonalize the full Hamiltonian (diagonalization solver) &lt;br /&gt;
&lt;br /&gt;
(2) use the subspace iterative [https://en.wikipedia.org/wiki/Lanczos_algorithm | Lanczos algorithm] and by-pass diagonalization with the Haydock approach&amp;lt;ref&amp;gt;R. Haydock, in&lt;br /&gt;
 &#039;&#039;Solid State Phys.&#039;&#039;, &#039;&#039;&#039;35&#039;&#039;&#039; 215 (1980)&lt;br /&gt;
 edited by H. Ehrenfest, F. Seitz, and D. Turnbull, Academic Press&amp;lt;/ref&amp;gt; (Lanczos-Haydock solver)&lt;br /&gt;
&lt;br /&gt;
Both approaches are detailed here below.&lt;br /&gt;
&lt;br /&gt;
== Diagonalization solver ==&lt;br /&gt;
&lt;br /&gt;
Invoke yambo with the &amp;quot;-y d&amp;quot; option in the command line:&lt;br /&gt;
&lt;br /&gt;
 $ yambo -y d -F 03_3D_BSE_diago_solver.in&lt;br /&gt;
&lt;br /&gt;
The input is open in the editor. The input variable to be changed are &lt;br /&gt;
 % [[Variables#BEnRange|BEnRange]]&lt;br /&gt;
   2.00000 | 8.00000 | eV    &lt;br /&gt;
 %&lt;br /&gt;
 [[Variables#BEnSteps|BEnSteps]]= 200      &lt;br /&gt;
 &lt;br /&gt;
which define 200 evenly spaced points between 2 and 8 eV at which the spectrum is calculated (&amp;amp;omega; in the equation for the macroscopic dielectric function),&lt;br /&gt;
  &lt;br /&gt;
 % [[Variables#BDmRange|BDmRange]]&lt;br /&gt;
   0.10000 |  0.10000 | eV    &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
which defines the spectral broadening (Lorentzian model), &lt;br /&gt;
&lt;br /&gt;
 % [[Variables#BLongDir|BLongDir]]&lt;br /&gt;
  1.000000 | 1.000000 | 0.000000 | &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
which defines the direction of the perturbing electric field (in this case the in-plane direction).&lt;br /&gt;
&lt;br /&gt;
Run yambo: &lt;br /&gt;
 $ yambo -F 03_3D_BSE_diago_solver.in -J 3D_BSE  &lt;br /&gt;
In the log (either in standard output or in l-3d_BSE_optics_bse_bsk_bss), after various setup/loading, the BSE is diagonalized using the linked linear algebra libraries: &lt;br /&gt;
 &amp;lt;01s&amp;gt; [06] BSE solver(s)&lt;br /&gt;
 &amp;lt;01s&amp;gt; [LA] SERIAL linear algebra&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06.01] Diagonalization solver&lt;br /&gt;
 &amp;lt;01s&amp;gt; BSK diagonalize |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;01s&amp;gt; EPS   residuals |########################################| [100%] --(E) --(X)&lt;br /&gt;
 &amp;lt;01s&amp;gt; BSK     epsilon |########################################| [100%] --(E) --(X)&lt;br /&gt;
The report r-3d_BSE_optics_bse_bsk_bss contains information relative to this runlevel in section 6:&lt;br /&gt;
&lt;br /&gt;
 [06] BSE solver(s)&lt;br /&gt;
 ==================&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the log and the report to check the consistency with the input variables. This run produces a new database in the 3D_BSE directory&lt;br /&gt;
 3D_BSE/ndb.BS_diago_Q01&lt;br /&gt;
So if you need the spectrum on a different energy range, direction, with a different broadening or on more points the diagonalization is not repeated, just the spectrum is recalculated.&lt;br /&gt;
    &lt;br /&gt;
This run produces as well human readable files (o-*). Specifically o-3D_BSE.eps_q1_diago_bse contains the real and imaginary part of the macroscopic dielectric function &lt;br /&gt;
  &lt;br /&gt;
 $ less o-3D_BSE.eps_q1_diago_bse &lt;br /&gt;
 ...&lt;br /&gt;
 #&lt;br /&gt;
 #  E/ev[1]    EPS-Im[2]  EPS-Re[3]  EPSo-Im[4] EPSo-Re[5]&lt;br /&gt;
 #&lt;br /&gt;
   2.00000    0.16162    5.83681    0.04959    4.14127&lt;br /&gt;
   2.03015    0.16787    5.88612    0.05090    4.15638&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
which is in the format &lt;br /&gt;
 Energy in eV | Imaginary part BSE | Real part BSE |Imaginary part IPA | Real part IPA |  &lt;br /&gt;
&lt;br /&gt;
where real and imaginary parts refer to the macroscopic dielectric function. The imaginary part corresponds to the optical absorption. The latter (column 2) can be plotted versus the photon energy (column 1) and compared with the independent particle approximation (IPA, column 4), e.g.: &lt;br /&gt;
 &lt;br /&gt;
 $ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 plot &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:2 w l t &#039;BSE&#039;, &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:4 w l  t &#039;IPA&#039;&lt;br /&gt;
&lt;br /&gt;
[[file:03_bse_diago.png |none|600px]]&lt;br /&gt;
The addition of the kernel has the effect to red-shift the spectrum onset and to redistribute the oscillator strengths. Note that the convergence with respect to k-points smooths out the low energy peaks in the IPA (which are an artifact of poor convergence with k-points producing an artificial confinement) to give the shoulder corresponding to the van Hove singularity in the band structure. On the other hand the low energy peak in the BSE is genuine and it is the signature of a bound exciton.&lt;br /&gt;
&lt;br /&gt;
== Lanczos-Haydock solver ==&lt;br /&gt;
&lt;br /&gt;
You can avoid the full matrix diagonalization (which rapidly become expensive as it scales as N&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;) by using the Lanczos-Haydock solver mentioned above. While for small matrices these two methods have similar computational cost, for matrices of the size 10000 by 10000 and larger, the Haydock solver is remarkably faster. The drawback is that excitonic functions cannot be calculated.&lt;br /&gt;
Within the Lanczos-Haydock approach the macroscopic dielectric function is rewritten as continued fraction&amp;lt;ref&amp;gt;L. X. Benedict and E. L. Shirley, Phys. Rev. B &#039;&#039;&#039;59&#039;&#039;&#039;, 5441 (1999)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[file:BSE1-Eq5.png|none|x100px]]&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;a&#039;&#039; &#039;s and &#039;&#039;b&#039;&#039; &#039;s result from the [https://en.wikipedia.org/wiki/Lanczos_algorithm#Lanczos_method| Lanczos iterative algorithm]. &lt;br /&gt;
&lt;br /&gt;
To use the Lanczos-Haydock solver invoke yambo with &amp;quot;-y h&amp;quot; option in the command line:&lt;br /&gt;
&lt;br /&gt;
 $ yambo -y h -F 03_3D_BSE_haydock_solver.in&lt;br /&gt;
Beside the same input parameters defined for the diagonalization solver, the parameter&lt;br /&gt;
 [[Variables#BSHayTrs|BSHayTrs]]= -0.02000          &lt;br /&gt;
defines the threshold accuracy for the Lanczos-Haydock iterative process: the calculation stops when the difference between two consecutive calculated spectra is smaller than the absolute value of the threshold.    &lt;br /&gt;
The minus sign indicates that the average difference over the specified energy range is considered (i.e. that means that cancellations of error may occur) as opposed to the maximum absolute difference over the specified energy range (plus sign). For the moment we leave this variable unchanged. This parameter ultimately determines the terms are included in the continued fraction here above. Later we explore how this variable influences the final result.   &lt;br /&gt;
&lt;br /&gt;
Invoke yambo to run the calculation:&lt;br /&gt;
 $ yambo -F 03_3D_BSE_haydock_solver.in -J &amp;quot;3D_BSE-low,3D_BSE&amp;quot;  &lt;br /&gt;
This outputs the following log:&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06] BSE solver(s)&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06.01] Haydock solver&lt;br /&gt;
 &amp;lt;01s&amp;gt; [Haydock] Iteration 1&lt;br /&gt;
 &amp;lt;03s&amp;gt; [Haydock] Iteration 21 Accuracy :  0.01647| -0.02000&lt;br /&gt;
 ...&lt;br /&gt;
The Lanczos-Haydock iterative procedure converged to the desired accuracy in 21 iterations.&lt;br /&gt;
&lt;br /&gt;
This runs only produces human readable files. That means that if you changes the input parameters (such as the broadening or the energy range) the Lanczos-Haydock procedure has to be repeated. &lt;br /&gt;
Among the human readable files, o-3D_BSE-low.eps_q1_haydock_bse contains the real and imaginary part of the macroscopic dielectric function:&lt;br /&gt;
 $ less o-3D_BSE-low.eps_q1_haydock_bse&lt;br /&gt;
 ...&lt;br /&gt;
 #&lt;br /&gt;
 #  E/ev[1]    EPS-Im[2]  EPS-Re[3]  EPSo-Im[4] EPSo-Re[5] EPS`-Im[6] EPS`-Re[7]&lt;br /&gt;
 #&lt;br /&gt;
    2.00000    0.16089    5.81293    0.04945    4.12727    0.16089    5.81293&lt;br /&gt;
    2.03015    0.16711    5.86203    0.05076    4.14234    0.16711    5.86203&lt;br /&gt;
 ...&lt;br /&gt;
This file has a slightly different data structure with respect to the diagonalization solver:&lt;br /&gt;
 Energy in eV | Imaginary part BSE | Real part BSE |Imaginary part IPA | Real part IPA |Imaginary part BSE (it-1) | Real part BSE (it-1)|&lt;br /&gt;
&lt;br /&gt;
We can plot the second and sixth columns and compare with the result from diagonalization:&lt;br /&gt;
 $gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
  plot &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:2 w l t &#039;Diagonalization&#039;, &#039;o-3D_BSE-low.eps_q1_haydock_bse&#039; u 1:2 w l t &#039;Haydock (27 its)&#039;, &#039;o-3D_BSE-low.eps_q1_haydock_bse&#039; u 1:6 w l t &#039;Haydock (26 its)&#039;&lt;br /&gt;
[[file:03_bse_haydock.png|none|600px]]&lt;br /&gt;
Except for the peak at higher energy, the results on this scale are identical to those obtained via the diagonalization solver. By comparing the results for the Lanczos-Haydock solver at 27 and 26 iterations, it is clear that the difference with the diagonalization results can be eliminated by lowering the threshold for the iterative process.&lt;br /&gt;
&lt;br /&gt;
Repeat now the calculation by changing the input variable:&lt;br /&gt;
 [[Variables#BSHayTrs|BSHayTrs]]= 0.02000          &lt;br /&gt;
which enforces a stricter condition on the convergence of the iterative process (see above)&lt;br /&gt;
&lt;br /&gt;
Running yambo: &lt;br /&gt;
 $ yambo -F 03_3D_BSE_haydock_solver.in -J &amp;quot;3D_BSE-high,3D_BSE&amp;quot;  &lt;br /&gt;
outputs the following log &lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06] BSE solver(s)&lt;br /&gt;
 &amp;lt;01s&amp;gt; [06.01] Haydock solver&lt;br /&gt;
 &amp;lt;01s&amp;gt; [Haydock] Iteration 1&lt;br /&gt;
 &amp;lt;06s&amp;gt; [Haydock] Iteration 45 Accuracy :   0.0098|  0.02000&lt;br /&gt;
 ...&lt;br /&gt;
Now 45 iterations, rather than 21, were needed to reach the desired accuracy.&lt;br /&gt;
By plotting these results:&lt;br /&gt;
 $ gnuplot&lt;br /&gt;
 plot &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:2 w l ls 1 t &#039;Diagonalization&#039;, &#039;o-3D_BSE-high.eps_q1_haydock_bse&#039; u 1:2 w l ls 2 t &#039;Haydock (high)&#039;, &#039;o-3D_BSE-low.eps_q1_haydock_bse&#039; u 1:2 w l ls 3 t &#039;Haydock (low)&#039;&lt;br /&gt;
[[file:03_bse_haydock_high.png|none|600px]]&lt;br /&gt;
Which shows that the Lanczos-Haydock solver with the stricter convergence criterion and the diagonalization solver are identical on this scale.&lt;br /&gt;
&lt;br /&gt;
=Some more advanced options =&lt;br /&gt;
&lt;br /&gt;
==Reading the QP corrections from a previous &#039;&#039;GW&#039;&#039; calculation==&lt;br /&gt;
In the above calculation we have used a simple scissor operator to correct the Kohn-Sam DFT energies. In this part we see how we can instead take the corrections from a previous Yambo Gw calculation.&lt;br /&gt;
We create and edit the input. This time instead of proceeding in three steps as before, we create one input performing all three steps:&lt;br /&gt;
 $yambo -o b -k sex -y d -V qp -F Ins/05_3D_QP_BSE.in&lt;br /&gt;
We set all parameters as in the previous calculation, except for the part regarding the QP correction:&lt;br /&gt;
  [[Variables#KfnQPdb|KfnQPdb]]= &amp;quot;E &amp;lt; 3D_QP_BSE/ndb.QP&amp;quot;              # [EXTQP BSK BSS] Database&lt;br /&gt;
  [[Variables#KfnQP_N|KfnQP_N]]= 1                   # [EXTQP BSK BSS] Interpolation neighbours&lt;br /&gt;
  % [[Variables#KfnQP_E|KfnQP_E]]&lt;br /&gt;
   0.000000 | 1.000000 | 1.000000 |        # [EXTQP BSK BSS] E parameters  (c/v) eV|adim|adim&lt;br /&gt;
 %&lt;br /&gt;
Instead of setting the values for the scissor, we give the path to a database (3D_QP_BSE/ndb.QP) which contains the QP corrections. This has been created by running a GW calculation as in the [[How to obtain the quasi-particle band structure of a bulk material: h-BN |GW tutorial]].&lt;br /&gt;
Run Yambo:&lt;br /&gt;
 $ yambo -F Ins/05_3D_QP_BSE.in -J &amp;quot;3D_QP_BSE,3D_BSE&amp;quot;&lt;br /&gt;
This produces the following log in the standard output. Note Section 4 (regarding external QP corrections to the kernel):&lt;br /&gt;
 &amp;lt;01s&amp;gt; [04.01] External QP corrections (K)&lt;br /&gt;
 &amp;lt;01s&amp;gt; [QP@K] E&amp;lt;3D_QP_BSE/ndb.QP[ PPA XG:39 Xb:1   40 Scb:1   40]&lt;br /&gt;
 &amp;lt;01s&amp;gt; [QP] Kpts covered exactly  [o/o]: 100.0000&lt;br /&gt;
This tells you that the file was found, read correctly and that the &#039;&#039;&#039;k&#039;&#039;&#039; points found in the file matched the ones you are using for the current calculation (otherwise interpolation would be needed).&lt;br /&gt;
It is crucial to check that the file has been read, since if not Yambo gives a warning but continues the calculation (with no QP corrections at all!).&lt;br /&gt;
As in the previous calculation the final results of the calculation are the files with the spectral functions. Let&#039;s compare the results for the optical absorption spectrum with those obtained previously with a simple scissor:&lt;br /&gt;
 $ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 plot &#039;o-3D_QP_BSE.eps_q1_diago_bse&#039; u 1:2 w l t &#039;Explicit QP&#039;, &#039;o-3D_BSE.eps_q1_diago_bse&#039; u 1:2 w l t &#039;Scissor&#039; &lt;br /&gt;
[[File:03 bse diago qp.png|none|600px]]&lt;br /&gt;
It is clear that this makes a difference in the peak distribution and intensity. Note that beside a simple shift you can renormalise as well the bandwidth of the valence and conduction bands in KfnQP_E (respectively the third and second value). You can try as an exercise to set up a new calculation using e.g. 1.440000 | 1.200000 | 0.900000 | for KfnQP_E.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8761</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8761"/>
		<updated>2025-05-19T13:01:17Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Be aware that when running the &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt; command, after typing &amp;quot;yes&amp;quot; at the prompt, you might see an error message like the one shown below. Don’t worry—just follow the instructions provided in this CINECA [https://wiki.u-gov.it/confluence/display/SCAIUS/FAQ#FAQ-Ikeepreceivingtheerrormessage%22WARNING:REMOTEHOSTIDENTIFICATIONHASCHANGED!%22evenifImodifyknown_hostfile guide to resolve the issue]. Once done, run the &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt; command again.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 /usr/bin/ssh-copy-id: &lt;br /&gt;
 ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;
 ERROR: @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @&lt;br /&gt;
 ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;
 ERROR: IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 &lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first activate the python environment:&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 source /leonardo_work/tra25_yambo/env_yambopy/bin/activate&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
set the environment variable for openMP &lt;br /&gt;
&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
and load yambo or yambopy as explained above in the general instructions.&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ rsync -avzP /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS/yambopy_tutorial_Modena_2025.tar.gz .&lt;br /&gt;
 $ tar --strip-components=1 -xvzf yambopy_tutorial_Modena_2025.tar.gz&lt;br /&gt;
&lt;br /&gt;
Then, follow part 1 of the tutorial, which is related to DFT band structures, YAMBO initialization and linear response.&lt;br /&gt;
* [[Modena 2025 : Yambopy part 1]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 $ cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBO_TUTORIALS&lt;br /&gt;
 $ cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
As for yambopy, the tutorial related to GW calculations is contained in the first section of Part 2&lt;br /&gt;
&lt;br /&gt;
* [[Modena 2025 : Yambopy part 2#GW calculations| Modena 2025 : Yambopy part 2 (GW calculations)]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Modena 2025 : Yambopy part 2#Excitons| Modena 2025 : Yambopy part 2 (BSE calculations)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo (5.3)|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics (5.3)|Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN (5.3)|Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [https://drive.google.com/file/d/1Z6GCjP4K1dM28ULsyYg2eckgUdYUSRph/view?usp=share_link First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [https://drive.google.com/file/d/1ITddkGTM12Gw5QxnZjAQpfZgYH0FvJL1/view?usp=share_link A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [https://drive.google.com/file/d/1mBTcPrnfoqwcA5wXE8gXQMO_qttClHAd/view?usp=share_link Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, [https://drive.google.com/file/d/1HTIPHkH2sBaVDLFwwS34T-fJ9x8FhVPq/view?usp=share_link Introduction to Many-Body Perturbation Theory]&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini, [https://drive.google.com/file/d/1dgcdHMfA0b7jjyrCs4r9OrG6qpiu1v39/view?usp=share_link GW in practice: algorithms and approximations]&lt;br /&gt;
* G. Sesti, [https://drive.google.com/file/d/1te_85k9jgSymr3Av86rKOu0-tA-7sGWq/view?usp=sharing  GW advanced algorithms]&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, [https://drive.google.com/file/d/1pQ491hqpETVLchL92QPy4f_jWqfMK5xf/view?usp=share_link Optical absorption and excitons via the Bethe-Salpeter Equation]&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8643</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8643"/>
		<updated>2025-05-17T09:28:58Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Connect to the cluster using ssh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Be aware that when running the &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt; command, after typing &amp;quot;yes&amp;quot; at the prompt, you might see an error message like the one shown below. Don’t worry—just follow the instructions provided in this CINECA [https://wiki.u-gov.it/confluence/display/SCAIUS/FAQ#FAQ-Ikeepreceivingtheerrormessage%22WARNING:REMOTEHOSTIDENTIFICATIONHASCHANGED!%22evenifImodifyknown_hostfile guide to resolve the issue]. Once done, run the &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt; command again.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 /usr/bin/ssh-copy-id: &lt;br /&gt;
 ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;
 ERROR: @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @&lt;br /&gt;
 ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;
 ERROR: IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 &lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first activate the python environment:&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module load python/3.11.7&lt;br /&gt;
 source /leonardo_work/tra25_yambo/env_yambopy/bin/activate&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
set the environment variable for openMP &lt;br /&gt;
&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
and load yambo or yambopy as explained above in the general instructions.&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8642</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8642"/>
		<updated>2025-05-17T09:24:58Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Use CINECA computational resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Be aware that when running the &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt; command, after typing &amp;quot;yes&amp;quot; at the prompt, you might see an error message like the one shown below. Don’t worry—just follow the instructions provided in this CINECA [https://wiki.u-gov.it/confluence/display/SCAIUS/FAQ#FAQ-Ikeepreceivingtheerrormessage%22WARNING:REMOTEHOSTIDENTIFICATIONHASCHANGED!%22evenifImodifyknown_hostfile guide to resolve the issue]. Once done, run the &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt; command again.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 /usr/bin/ssh-copy-id: &lt;br /&gt;
 ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;
 ERROR: @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @&lt;br /&gt;
 ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;
 ERROR: IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 &lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first activate the python environment:&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module load python/3.11.7&lt;br /&gt;
 source /leonardo_work/tra25_yambo/env_yambopy/bin/activate&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
set the environment variable for openMP &lt;br /&gt;
&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
and load yambo or yambopy as explained above in the general instructions.&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8641</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8641"/>
		<updated>2025-05-17T09:21:18Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Connect to the cluster using ssh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Be aware that when running the ssh-copy-id command, after typing yes at the prompt, you might see an error message like the one shown below. Don’t worry—just follow the instructions provided in this CINECA guide to resolve the issue. Once done, run the ssh-copy-id command again.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 /usr/bin/ssh-copy-id: &lt;br /&gt;
 ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;
 ERROR: @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @&lt;br /&gt;
 ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;
 ERROR: IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 &lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first activate the python environment:&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module load python/3.11.7&lt;br /&gt;
 source /leonardo_work/tra25_yambo/env_yambopy/bin/activate&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
set the environment variable for openMP &lt;br /&gt;
&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
and load yambo or yambopy as explained above in the general instructions.&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8640</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8640"/>
		<updated>2025-05-17T08:58:03Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 &lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first activate the python environment:&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module load python/3.11.7&lt;br /&gt;
 source /leonardo_work/tra25_yambo/env_yambopy/bin/activate&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
set the environment variable for openMP &lt;br /&gt;
&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
and load yambo or yambopy as explained above in the general instructions.&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8639</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8639"/>
		<updated>2025-05-17T08:57:11Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first activate the python environment:&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module load python/3.11.7&lt;br /&gt;
 source /leonardo_work/tra25_yambo/env_yambopy/bin/activate&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
set the environment variable for openMP &lt;br /&gt;
&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
and load yambo or yambopy as explained above in the general instructions.&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8637</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8637"/>
		<updated>2025-05-16T08:57:04Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first activate the python environment:&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module load python/3.11.7&lt;br /&gt;
 source /leonardo_work/tra25_yambo/env_yambopy/bin/activate&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8636</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8636"/>
		<updated>2025-05-16T08:54:54Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 cd&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda init bash&lt;br /&gt;
 source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module load python/3.11.7&lt;br /&gt;
 source /leonardo_work/tra25_yambo/env_yambopy/bin/activate&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8635</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8635"/>
		<updated>2025-05-15T14:29:12Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 cd&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda init bash&lt;br /&gt;
 source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8634</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8634"/>
		<updated>2025-05-15T14:28:40Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 cd&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda init bash&lt;br /&gt;
 source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8633</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8633"/>
		<updated>2025-05-15T08:15:51Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 #SBATCH --reservation=s_tra_yambo       # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resources]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh username  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hours:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod --reservation=s_tra_yambo -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 cd&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda init bash&lt;br /&gt;
 source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8629</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8629"/>
		<updated>2025-05-14T14:39:47Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=TBD             # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 cd&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda init bash&lt;br /&gt;
 source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8628</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8628"/>
		<updated>2025-05-14T14:39:16Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=TBD             # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 squeue --me&lt;br /&gt;
            JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
         15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 cd&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda init bash&lt;br /&gt;
 source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 module load anaconda3/2023.09-0&lt;br /&gt;
 conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8627</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8627"/>
		<updated>2025-05-14T14:35:47Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=TBD             # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
Since the compute nodes are not connected to the external network, the tarballs must be downloaded before starting the interactive session.&lt;br /&gt;
Alternatively, once the interactive session has started, it is possible to access the tarballs by copying them from the following directories:&lt;br /&gt;
&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBO_TUTORIALS&lt;br /&gt;
 /leonardo_work/tra25_yambo/YAMBOPY_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
After that you can start the interactive session&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 cd YAMBOPY_TUTORIALS&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8626</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8626"/>
		<updated>2025-05-14T13:34:38Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* DAY 1 - Monday, 19 May */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=TBD             # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar.gz&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8625</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8625"/>
		<updated>2025-05-14T12:52:51Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* DAY 1 - Monday, 19 May */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=TBD             # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;srun&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8624</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8624"/>
		<updated>2025-05-13T10:19:40Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=TBD             # Reservation specific to this school&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal --reservation=TBD -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8623</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8623"/>
		<updated>2025-05-13T09:35:57Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8622</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8622"/>
		<updated>2025-05-13T09:34:25Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Use CINECA computational resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8621</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8621"/>
		<updated>2025-05-13T09:33:01Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Use CINECA computational resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8620</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8620"/>
		<updated>2025-05-13T09:32:21Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Use CINECA computational resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8618</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8618"/>
		<updated>2025-05-13T09:25:27Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Use CINECA computational resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP partition. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8617</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8617"/>
		<updated>2025-05-13T09:25:02Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Connect to the cluster using ssh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8616</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8616"/>
		<updated>2025-05-13T09:24:46Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8615</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8615"/>
		<updated>2025-05-13T09:23:18Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* DAY 1 - Monday, 19 May */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir -p YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8614</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8614"/>
		<updated>2025-05-13T09:21:14Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Connect to the cluster using ssh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8613</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8613"/>
		<updated>2025-05-13T09:18:32Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FROM HERE IS A PLACEHOLDER: NICOLA WILL FILL THIS PART&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir -p YAMBO_TUTORIALS &#039;&#039;&#039;#(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8612</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8612"/>
		<updated>2025-05-13T09:16:05Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FROM HERE IS A PLACEHOLDER: NICOLA WILL FILL THIS PART&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on Leonardo, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh leonardo&lt;br /&gt;
 cd $SCRATCH&lt;br /&gt;
 mkdir YAMBO_TUTORIALS &#039;&#039;&#039;(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 [...]&lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
 cd $SCRATCH/YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8610</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8610"/>
		<updated>2025-05-13T09:11:37Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FROM HERE IS A PLACEHOLDER: NICOLA WILL FILL THIS PART&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on Leonardo, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/4%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD) !!!!!!!!!&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on Leonardo, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to Leonardo enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X leonardo&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on Leonardo, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda3/2023.09-0&lt;br /&gt;
 $ conda activate !!!!!!!! TBD !!!!!!!!&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on m100, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh m100&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 mkdir YAMBO_TUTORIALS &#039;&#039;&#039;(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 salloc -A tra23_Yambo -p m100_sys_test -q qos_test --reservation=s_tra_yambo --nodes=1 --ntasks-per-node=1 --cpus-per-task=4 -t 04:00:00&lt;br /&gt;
 ssh &#039;&#039;&#039;PUT HERE THE ASSIGNED NODE NAME AFTER salloc COMMAND&#039;&#039;&#039;&lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-cpu/bin:$PATH&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8609</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8609"/>
		<updated>2025-05-13T09:05:17Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Connect to the cluster using ssh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FROM HERE IS A PLACEHOLDER: NICOLA WILL FILL THIS PART&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to Leonardo. To do so, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen -t rsa -b 4096 -f ~/.ssh/leonardo_rsa&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Created directory &#039;/home/username/.ssh&#039;.&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in /home/username/.ssh/leonardo_rsa&lt;br /&gt;
 Your public key has been saved in /home/username/.ssh/leonardo_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 [...]&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to Leonardo. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to Leonardo without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i ~/.ssh/leonardo_rsa username@login.leonardo.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting the username:&lt;br /&gt;
 Host leonardo &lt;br /&gt;
  HostName login.leonardo.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile ~/.ssh/leonardo_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh leonardo&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on M100, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$CINECA_SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/UG2.5%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $CINECA_SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD)&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on M100, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to M100 enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X m100&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on m100, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda/2020.11&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda/2020.11&lt;br /&gt;
 $ conda activate /m100_work/tra23_Yambo/softwares/YAMBO/env_yambopy&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on m100, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh m100&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 mkdir YAMBO_TUTORIALS &#039;&#039;&#039;(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 salloc -A tra23_Yambo -p m100_sys_test -q qos_test --reservation=s_tra_yambo --nodes=1 --ntasks-per-node=1 --cpus-per-task=4 -t 04:00:00&lt;br /&gt;
 ssh &#039;&#039;&#039;PUT HERE THE ASSIGNED NODE NAME AFTER salloc COMMAND&#039;&#039;&#039;&lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-cpu/bin:$PATH&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8608</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8608"/>
		<updated>2025-05-13T08:34:52Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh ...&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FROM HERE IS A PLACEHOLDER: NICOLA WILL FILL THIS PART&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to M100. To do so, go to your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory (usually located in the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory):&lt;br /&gt;
 $ cd $HOME/.ssh&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have this directory, you can create it with &amp;lt;code&amp;gt;mkdir $HOME/.ssh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once you are in the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Enter file in which to save the key: m100_id_rsa&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa&lt;br /&gt;
 Your public key has been saved in &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to M100. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa.pub &amp;lt;username&amp;gt;@login.m100.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to M100 without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa username@login.m100.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting username and path:&lt;br /&gt;
 Host m100 &lt;br /&gt;
  HostName login.m100.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh m100&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on M100, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$CINECA_SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/UG2.5%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $CINECA_SCRATCH&lt;br /&gt;
 /leonardo_scratch/large/userexternal/username&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on Leonardo are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD)&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on M100, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to M100 enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X m100&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on m100, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda/2020.11&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda/2020.11&lt;br /&gt;
 $ conda activate /m100_work/tra23_Yambo/softwares/YAMBO/env_yambopy&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on m100, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh m100&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 mkdir YAMBO_TUTORIALS &#039;&#039;&#039;(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 salloc -A tra23_Yambo -p m100_sys_test -q qos_test --reservation=s_tra_yambo --nodes=1 --ntasks-per-node=1 --cpus-per-task=4 -t 04:00:00&lt;br /&gt;
 ssh &#039;&#039;&#039;PUT HERE THE ASSIGNED NODE NAME AFTER salloc COMMAND&#039;&#039;&#039;&lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-cpu/bin:$PATH&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8607</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8607"/>
		<updated>2025-05-13T08:33:20Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh ...&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FROM HERE IS A PLACEHOLDER: NICOLA WILL FILL THIS PART&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to M100. To do so, go to your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory (usually located in the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory):&lt;br /&gt;
 $ cd $HOME/.ssh&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have this directory, you can create it with &amp;lt;code&amp;gt;mkdir $HOME/.ssh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once you are in the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Enter file in which to save the key: m100_id_rsa&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa&lt;br /&gt;
 Your public key has been saved in &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to M100. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa.pub &amp;lt;username&amp;gt;@login.m100.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to M100 without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa username@login.m100.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting username and path:&lt;br /&gt;
 Host m100 &lt;br /&gt;
  HostName login.m100.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh m100&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on M100, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$CINECA_SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/UG2.5%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $CINECA_SCRATCH&lt;br /&gt;
 /m100_scratch/userexternal/username&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on M100 are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD)&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on M100, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to M100 enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X m100&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on m100, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda/2020.11&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda/2020.11&lt;br /&gt;
 $ conda activate /m100_work/tra23_Yambo/softwares/YAMBO/env_yambopy&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on m100, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh m100&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 mkdir YAMBO_TUTORIALS &#039;&#039;&#039;(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 salloc -A tra23_Yambo -p m100_sys_test -q qos_test --reservation=s_tra_yambo --nodes=1 --ntasks-per-node=1 --cpus-per-task=4 -t 04:00:00&lt;br /&gt;
 ssh &#039;&#039;&#039;PUT HERE THE ASSIGNED NODE NAME AFTER salloc COMMAND&#039;&#039;&#039;&lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-cpu/bin:$PATH&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8606</id>
		<title>Modena 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8606"/>
		<updated>2025-05-13T08:32:29Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* General instructions to run tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A general description of the goal(s) of the school can be found on the [https://www.yambo-code.eu/2025/01/17/yambo-school-modena-2025/ Yambo main website]&lt;br /&gt;
&lt;br /&gt;
== Use CINECA computational resources ==&lt;br /&gt;
Yambo tutorials will be run on the Leonardo-DCGP. You can find info about Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section here].&lt;br /&gt;
In order to access computational resources provided by CINECA you need your personal username and password that were sent you by the organizers.&lt;br /&gt;
&lt;br /&gt;
=== Connect to the cluster using ssh ===&lt;br /&gt;
&lt;br /&gt;
You can access Leonardo-DCGP via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; protocol in different ways.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using username and password &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command replacing your username:&lt;br /&gt;
 $ ssh ...&lt;br /&gt;
&lt;br /&gt;
However, in this way you have to type your password each time you want to connect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FROM HERE IS A PLACEHOLDER: NICOLA WILL FILL THIS PART&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Connect using ssh key &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can setup a ssh key pair to avoid typing the password each time you want to connect to M100. To do so, go to your &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory (usually located in the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory):&lt;br /&gt;
 $ cd $HOME/.ssh&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have this directory, you can create it with &amp;lt;code&amp;gt;mkdir $HOME/.ssh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once you are in the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory, run the &amp;lt;code&amp;gt;ssh-keygen&amp;lt;/code&amp;gt; command to generate a private/public key pair:&lt;br /&gt;
 $ ssh-keygen&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Enter file in which to save the key: m100_id_rsa&lt;br /&gt;
 Enter passphrase (empty for no passphrase): &lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 Your identification has been saved in &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa&lt;br /&gt;
 Your public key has been saved in &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa.pub&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
 The key&#039;s randomart image is:&lt;br /&gt;
 &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to copy the &#039;&#039;&#039;public&#039;&#039;&#039; key to M100. You can do that with the following command (for this step you need to type your password):&lt;br /&gt;
 $ ssh-copy-id -i &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa.pub &amp;lt;username&amp;gt;@login.m100.cineca.it&lt;br /&gt;
&lt;br /&gt;
Once the public key has been copied, you can connect to M100 without having to type the password using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -i &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa username@login.m100.cineca.it&lt;br /&gt;
&lt;br /&gt;
To simplify even more, you can paste the following lines in a file named &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; located inside the &amp;lt;code&amp;gt;.ssh&amp;lt;/code&amp;gt; directory adjusting username and path:&lt;br /&gt;
 Host m100 &lt;br /&gt;
  HostName login.m100.cineca.it&lt;br /&gt;
  User username&lt;br /&gt;
  IdentityFile &amp;lt;your_.ssh_dir&amp;gt;/m100_id_rsa&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file setup you can connect simply with&lt;br /&gt;
 $ ssh m100&lt;br /&gt;
&lt;br /&gt;
=== General instructions to run tutorials ===&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it is useful to know the different workspaces you have available on M100, which can be accessed using environment variables. The main ones are:&lt;br /&gt;
* &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;home&amp;lt;/code&amp;gt; directory associated to your username; &lt;br /&gt;
* &amp;lt;code&amp;gt;$WORK&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;work&amp;lt;/code&amp;gt; directory associated to the account where the computational resources dedicated to this school are allocated;&lt;br /&gt;
* &amp;lt;code&amp;gt;$CINECA_SCRATCH&amp;lt;/code&amp;gt;: it&#039;s the &amp;lt;code&amp;gt;scratch&amp;lt;/code&amp;gt; directory associated to your username.&lt;br /&gt;
You can find more details about storage and FileSystems [https://wiki.u-gov.it/confluence/display/SCAIUS/UG2.5%3A+Data+storage+and+FileSystems here].&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to &#039;&#039;&#039;run all tutorials in your scratch directory&#039;&#039;&#039;:&lt;br /&gt;
 $ echo $CINECA_SCRATCH&lt;br /&gt;
 /m100_scratch/userexternal/username&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
&lt;br /&gt;
Computational resources on M100 are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Run a job using a batch script &#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;, whose generic structure is the following:&lt;br /&gt;
 $ more job.sh&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #SBATCH --account=tra25_yambo           # Charge resources used by this job to specified account&lt;br /&gt;
 #SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss&lt;br /&gt;
 #SBATCH --job-name=JOB                  # Specify a name for the job allocation&lt;br /&gt;
 #SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --gres=tmpfs:10g                # List of generic consumable resources&lt;br /&gt;
 #SBATCH --qos=normal                    # Quality of service &lt;br /&gt;
 ###SBATCH --reservation=s_tra_yambo     # Reservation specific to this school (TBD)&lt;br /&gt;
 #          &lt;br /&gt;
 #SBATCH --nodes=&amp;lt;N&amp;gt;                     # Number of nodes to be allocated for the job&lt;br /&gt;
 #SBATCH --ntasks-per-node=&amp;lt;n&amp;gt;           # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;n/2&amp;gt;       # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;c&amp;gt;             # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load profile/candidate&lt;br /&gt;
 module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
 module load yambo/5.3.0--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0&lt;br /&gt;
 export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
 mpirun -np ${SLURM_NTASKS} \&lt;br /&gt;
        yambo -F &amp;lt;input&amp;gt; -J &amp;lt;output&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script &amp;lt;code&amp;gt;job.sh&amp;lt;/code&amp;gt;. Please note that the instructions in the batch script must be compatible with the specific Leonardo-DCGP [https://wiki.u-gov.it/confluence/display/SCAIUS/DCGP+Section#DCGPSection-SLURMpartitions resourses]. The complete list of Slurm options can be found [https://slurm.schedmd.com/sbatch.html here]. However you will find &#039;&#039;&#039;ready-to-use&#039;&#039;&#039; batch scripts in locations specified during the tutorials. &lt;br /&gt;
&lt;br /&gt;
To submit the job, use the &amp;lt;code&amp;gt;sbatch&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ $ sbatch job.sh&lt;br /&gt;
 Submitted batch job 15696508&lt;br /&gt;
&lt;br /&gt;
To check the job status, use the &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 $ squeue --me&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           15696508 dcgp_usr_   job.sh nspallan  R       0:01      1 lrdn4135&lt;br /&gt;
&lt;br /&gt;
If you need to cancel your job, do:&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Open an interactive session &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 4 hour:&lt;br /&gt;
 $ srun -A tra25_yambo -p dcgp_usr_prod -q normal -N 1 -n 1 -c 4 -t 04:00:00 --gres=tmpfs:10g --pty /bin/bash&lt;br /&gt;
 srun: job 15694182 queued and waiting for resources&lt;br /&gt;
 srun: job 15694182 has been allocated resources&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task (-c) because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
Then, you need to manually load &amp;lt;code&amp;gt;yambo&amp;lt;/code&amp;gt; as in the batch script above:&lt;br /&gt;
 $ module purge&lt;br /&gt;
 $ module load profile/candidate&lt;br /&gt;
 $ module use /leonardo/pub/userexternal/nspallan/spack-0.22.2-06/modules&lt;br /&gt;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 using the appropriate Slurm environment variable:&lt;br /&gt;
 $ export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}&lt;br /&gt;
&lt;br /&gt;
To close the interactive session when you have finished, log out of the compute node with the &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; command, and then cancel the job:&lt;br /&gt;
 $ exit&lt;br /&gt;
 $ scancel &amp;lt;JOBID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Plot results with gnuplot &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
During the tutorials you will often need to plot the results of the calculations. In order to do so on M100, &#039;&#039;&#039;open a new terminal window&#039;&#039;&#039; and connect to M100 enabling X11 forwarding with the &amp;lt;code&amp;gt;-X&amp;lt;/code&amp;gt; option:&lt;br /&gt;
 $ ssh -X m100&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;code&amp;gt;gnuplot&amp;lt;/code&amp;gt; can be used in this way only from the login nodes:&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ cd &amp;lt;directory_with_data&amp;gt;&lt;br /&gt;
 username@&#039;&#039;&#039;login01&#039;&#039;&#039;$ gnuplot&lt;br /&gt;
 ...&lt;br /&gt;
 Terminal type is now &#039;...&#039;&lt;br /&gt;
 gnuplot&amp;gt; plot &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; - Set up yambopy &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run yambopy on m100, you must first setup the conda environment (to be done only once):&lt;br /&gt;
 $ cd&lt;br /&gt;
 $ module load anaconda/2020.11&lt;br /&gt;
 $ conda init bash&lt;br /&gt;
 $ source .bashrc&lt;br /&gt;
&lt;br /&gt;
After this, every time you want to use yambopy you need to load its module and environment:&lt;br /&gt;
 $ module load anaconda/2020.11&lt;br /&gt;
 $ conda activate /m100_work/tra23_Yambo/softwares/YAMBO/env_yambopy&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
Quick recap.&lt;br /&gt;
Before every tutorial, if you run on m100, do the following steps&lt;br /&gt;
&lt;br /&gt;
 ssh m100&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 mkdir YAMBO_TUTORIALS &#039;&#039;&#039;(Only if you didn&#039;t before)&#039;&#039;&#039;&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
&lt;br /&gt;
At this point you can download the needed files for the tutorial.&lt;br /&gt;
After that you can open the interactive session and login into the node&lt;br /&gt;
&lt;br /&gt;
 salloc -A tra23_Yambo -p m100_sys_test -q qos_test --reservation=s_tra_yambo --nodes=1 --ntasks-per-node=1 --cpus-per-task=4 -t 04:00:00&lt;br /&gt;
 ssh &#039;&#039;&#039;PUT HERE THE ASSIGNED NODE NAME AFTER salloc COMMAND&#039;&#039;&#039;&lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-cpu/bin:$PATH&lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS &lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May === &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN&#039;&#039;&#039; hBN-2D.tar.gz  hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now that you have all the files, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; as explained above and proceed with the tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[First steps: walk through from DFT(standalone)|First steps: Initialization and more ]]&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
At this point, you may learn about the python pre-postprocessing capabilities offered by yambopy, our python interface to yambo and QE. First of all, let&#039;s create a dedicated directory, download and extract the related files.&lt;br /&gt;
 &lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ mkdir YAMBOPY_TUTORIALS&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar&lt;br /&gt;
 $ tar -xvf databases_yambopy.tar&lt;br /&gt;
 $ cd databases_yambopy&lt;br /&gt;
&lt;br /&gt;
Then, follow &#039;&#039;&#039;the first three sections&#039;&#039;&#039; of this link, which are related to initialization and linear response.&lt;br /&gt;
* [[Yambopy tutorial: Yambo databases|Reading databases with yambopy]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get all the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz&lt;br /&gt;
 wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 tar -xvf hBN.tar.gz&lt;br /&gt;
 tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz&lt;br /&gt;
 cd hBN&lt;br /&gt;
&lt;br /&gt;
Now you can start the first tutorial:&lt;br /&gt;
&lt;br /&gt;
* [[GW tutorial Rome 2023 | GW computations on practice: how to obtain the quasi-particle band structure of a bulk material ]]&lt;br /&gt;
&lt;br /&gt;
If you have gone through the first tutorial, pass now to the second one:&lt;br /&gt;
 &lt;br /&gt;
 cd $CINECA_SCRATCH&lt;br /&gt;
 cd YAMBO_TUTORIALS&lt;br /&gt;
 cd MoS2_HPC_tutorial&lt;br /&gt;
&lt;br /&gt;
* [[Quasi-particles of a 2D system | Quasi-particles of a 2D system ]]&lt;br /&gt;
&lt;br /&gt;
To conclude, you can learn an other method to plot the band structure in Yambo&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy tutorial: band structures| Yambopy tutorial: band structures]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Bethe-Salpeter equation (BSE)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
To get the tutorial files needed for the following tutorials, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz # NOTE: YOU SHOULD ALREADY HAVE THIS FROM DAY 1&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-convergence-kpoints.tar.gz &lt;br /&gt;
 $ tar -xvf hBN-convergence-kpoints.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now, you may open the interactive job session with &amp;lt;code&amp;gt;salloc&amp;lt;/code&amp;gt; and proceed with the following tutorials.&lt;br /&gt;
&lt;br /&gt;
* [[Calculating optical spectra including excitonic effects: a step-by-step guide|Perform a BSE calculation from beginning to end ]]&lt;br /&gt;
* [[How to analyse excitons - ICTP 2022 school|Analyse your results (exciton wavefunctions in real and reciprocal space, etc.) ]]&lt;br /&gt;
* [[BSE solvers overview|Solve the BSE eigenvalue problem with different numerical methods]]&lt;br /&gt;
* [[How to choose the input parameters|Choose the input parameters for a meaningful converged calculation]]&lt;br /&gt;
Now, go into the yambopy tutorial directory to learn about python analysis tools for the BSE:&lt;br /&gt;
 $ cd $CINECA_SCRATCH&lt;br /&gt;
 $ cd YAMBOPY_TUTORIALS/databases_yambopy&lt;br /&gt;
&lt;br /&gt;
* [[Yambopy_tutorial:_Yambo_databases#Exciton_intro_1:_read_and_sort_data|Visualization of excitonic properties with yambopy]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Bethe-Salpeter equation in real time (TD-HSEX)&#039;&#039;&#039; Fulvio Paleari (CNR-Nano, Italy), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
The files needed for the following tutorials can be downloaded following these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Introduction_to_Real_Time_propagation_in_Yambo#Time_Dependent_Equation_for_the_Reduced_One--Body_Density--Matrix|Read the introductive section to real-time propagation for the one-body density matrix]] (the part about time-dependent Schrödinger equation will be covered on DAY 4 and you can skip it for now)&lt;br /&gt;
* [[Prerequisites for Real Time propagation with Yambo|Perform the setup for a real-time calculation]]&lt;br /&gt;
* [[Linear response from real time simulations (density matrix only)|Calculate the linear response in real time]]&lt;br /&gt;
* [[Real time Bethe-Salpeter Equation (density matrix only)|Calculate the BSE in real time]]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:30 Real-time approach with the time dependent berry phase&#039;&#039;&#039; Myrta Gruning (Queen&#039;s University Belfast), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the tutorials we will use first the &amp;lt;code&amp;gt;hBN-2D-RT&amp;lt;/code&amp;gt; folder (k-sampling 10x10x1) and then the &amp;lt;code&amp;gt;hBN-2D&amp;lt;/code&amp;gt; folder (k-sampling 6x6x1)&lt;br /&gt;
You may already have them in the &amp;lt;code&amp;gt;YAMBO_TUTORIALS&amp;lt;/code&amp;gt; folder&lt;br /&gt;
 $ ls&lt;br /&gt;
 &#039;&#039;&#039;hBN-2D&#039;&#039;&#039; &#039;&#039;&#039;hBN-2D-RT&#039;&#039;&#039; hBN-2D.tar.gz  hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
If you need to downoload again the tutorial files, follow these steps:&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz&lt;br /&gt;
 $ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D.tar.gz&lt;br /&gt;
 $ tar -xvf hBN-2D-RT.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Dielectric function from Bloch-states dynamics]]&lt;br /&gt;
* [[Second-harmonic generation of 2D-hBN]]&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]] (additional tutorial)&lt;br /&gt;
* [[Correlation effects in the non-linear response]] (additional tutorial)&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
== Lectures ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DAY 1 - Monday, 19 May ===&lt;br /&gt;
&lt;br /&gt;
* D. Varsano, [Description and goal of the school].&lt;br /&gt;
* C. Franchini, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
* E. Cannuccia, [Electronic screening and linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Marini, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti,  GW in practice: algorithms, approximations and W-averaged GW in metals&lt;br /&gt;
* M. Govoni, GW without empty states and investigation of neutral excitations by embedding full configuration interaction in DFT+GW&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* M. Palummo, Optical absorption and excitons via the Bethe-Salpeter Equation&lt;br /&gt;
* D. Sangalli, Real-time simulations&lt;br /&gt;
* F. Paleari, Introduction to YamboPy (automation and post-processing)&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Luppi, An introduction to Non-linear spectroscopy&lt;br /&gt;
* M. Grüning, Non-linear spectroscopy in Yambo&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint_with_NVfortran_compiler&amp;diff=8441</id>
		<title>Install Yambo on Ubuntu/LinuxMint with NVfortran compiler</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint_with_NVfortran_compiler&amp;diff=8441"/>
		<updated>2025-03-11T09:50:53Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The NVIDIA compiler are freely available on Linux machines.&lt;br /&gt;
You can download Fortran,C, C++ compiler and debugger from:&lt;br /&gt;
[https://developer.nvidia.com/hpc-sdk-downloads NVIDIA HPC Software Development Kit (SDK) ] &amp;lt;br&amp;gt;&lt;br /&gt;
On Ubuntu, it can be easely installed via the following procedure&lt;br /&gt;
 sudo apt-get update -y &amp;amp;&amp;amp; sudo apt-get upgrade -y&lt;br /&gt;
 sudo apt-get install -y build-essential automake autoconf libtool zlib1g-dev curl gpg wget git tar cmake&lt;br /&gt;
 curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg&lt;br /&gt;
 echo &#039;deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /&#039; | sudo tee /etc/apt/sources.list.d/nvhpc.list&lt;br /&gt;
 sudo apt-get update -y &amp;amp;&amp;amp; sudo apt-get install -y nvhpc-25-1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup NVIDIA compilers &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once you downloaded and installed the NVIDIA SDK it is suggested avoiding manually setting environment variables for compilers and MPI wrappers. The safest approach is to use the module files provided by Nvidia, located at: `/opt/nvidia/hpc_sdk/modulefiles`&lt;br /&gt;
&lt;br /&gt;
Before using module files, you need to install the module management tool:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install environment-modules&lt;br /&gt;
 echo &amp;quot;source /etc/profile.d/modules.sh&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo &amp;quot;module use /opt/nvidia/hpc_sdk/modulefiles&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
The commands above only need to be used the first time. Now, you can load the Nvidia SDK module, which will correctly set up all environment variables for both compilers and MPI:&lt;br /&gt;
&lt;br /&gt;
 module load nvhpc/25.1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Configure Yambo with NVfortran and openMPI &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then you can configure Yambo with the command:&lt;br /&gt;
&lt;br /&gt;
 ./configure MPIFC=mpif90 MPICC=mpicc FC=nvfortran F77=nvfortran CPP=&amp;quot;cpp -E&amp;quot;  FPP=&amp;quot;nvfortran -Mpreprocess -E&amp;quot; F90SUFFIX=&amp;quot;.f90&amp;quot; \&lt;br /&gt;
 --enable-memory-profile  --enable-open-mp --enable-par-linalg  --enable-hdf5-par-io  --enable-slepc-linalg &lt;br /&gt;
&lt;br /&gt;
If you have an installed CUDA GPU on your machine you can compile Yambo to use it, by adding the flag&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#0000FF&amp;quot;&amp;gt;&#039;&#039;--enable-cuda-fortran&amp;lt;/span&amp;gt; &lt;br /&gt;
and then specify your GPU architecture and the CUDA runtime version, look at configure help for more info.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check that your Nvidia graphic card is properly installed&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To be sure that the code will run fine on your GPU card, you need the proper driver installed on your machine. If you have the nvidia drivers, just run&lt;br /&gt;
 $nvidia-smi&lt;br /&gt;
 Mon Sep  9 16:20:02 2024       &lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | NVIDIA-SMI 560.35.03              Driver Version: 560.35.03      CUDA Version: 12.6     |&lt;br /&gt;
 |-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |&lt;br /&gt;
 | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |&lt;br /&gt;
 |                                         |                        |               MIG M. |&lt;br /&gt;
 |=========================================+========================+======================|&lt;br /&gt;
 |   0  NVIDIA GeForce GTX 1650        Off |   00000000:01:00.0  On |                  N/A |&lt;br /&gt;
 | 20%   39C    P8              8W /   75W |     280MiB /   4096MiB |      0%      Default |&lt;br /&gt;
 |                                         |                        |                  N/A |&lt;br /&gt;
 +-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
&#039;&#039;CUDA Version: V.S&#039;&#039; should be lower or equal to what you set in your &#039;&#039;cuda-runtime&#039;&#039; in the configure. In this case we are running with driver 560, which supports cuda version 12.6 or newer via the CUDA Forward Compatibility Package (see [https://docs.nvidia.com/deploy/cuda-compatibility/ https://docs.nvidia.com/deploy/cuda-compatibility/]).&lt;br /&gt;
&lt;br /&gt;
More info on Yambo on NVIDIA graphic cards can be found here: [https://www.nvidia.com/en-us/on-demand/session/gtcspring21-e32448/ Materials Design Toward the Exascale: Porting Electronic Structure Community Codes to GPUs]&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint_with_NVfortran_compiler&amp;diff=8440</id>
		<title>Install Yambo on Ubuntu/LinuxMint with NVfortran compiler</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint_with_NVfortran_compiler&amp;diff=8440"/>
		<updated>2025-03-11T09:48:38Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The NVIDIA compiler are freely available on Linux machines.&lt;br /&gt;
You can download Fortran,C, C++ compiler and debugger from:&lt;br /&gt;
[https://developer.nvidia.com/hpc-sdk-downloads NVIDIA HPC Software Development Kit (SDK) ] &amp;lt;br&amp;gt;&lt;br /&gt;
On Ubuntu, it can be easely installed via the following procedure&lt;br /&gt;
 sudo apt-get update -y&lt;br /&gt;
 sudo apt-get upgrade -y&lt;br /&gt;
 sudo apt-get install -y build-essential automake autoconf libtool zlib1g-dev curl gpg wget git tar cmake&lt;br /&gt;
 curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg&lt;br /&gt;
 echo &#039;deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /&#039; | sudo tee /etc/apt/sources.list.d/nvhpc.list&lt;br /&gt;
 sudo apt-get update -y&lt;br /&gt;
 sudo apt-get install -y nvhpc-25-1 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup NVIDIA compilers &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once you downloaded and installed the NVIDIA SDK it is suggested avoiding manually setting environment variables for compilers and MPI wrappers. The safest approach is to use the module files provided by Nvidia, located at: `/opt/nvidia/hpc_sdk/modulefiles`&lt;br /&gt;
&lt;br /&gt;
Before using module files, you need to install the module management tool:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install environment-modules&lt;br /&gt;
 echo &amp;quot;source /etc/profile.d/modules.sh&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo &amp;quot;module use /opt/nvidia/hpc_sdk/modulefiles&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
The commands above only need to be used the first time. Now, you can load the Nvidia SDK module, which will correctly set up all environment variables for both compilers and MPI:&lt;br /&gt;
&lt;br /&gt;
 module load nvhpc/25.1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Configure Yambo with NVfortran and openMPI &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then you can configure Yambo with the command:&lt;br /&gt;
&lt;br /&gt;
 ./configure MPIFC=mpif90 MPICC=mpicc FC=nvfortran F77=nvfortran CPP=&amp;quot;cpp -E&amp;quot;  FPP=&amp;quot;nvfortran -Mpreprocess -E&amp;quot; F90SUFFIX=&amp;quot;.f90&amp;quot; \&lt;br /&gt;
 --enable-memory-profile  --enable-open-mp --enable-par-linalg  --enable-hdf5-par-io  --enable-slepc-linalg &lt;br /&gt;
&lt;br /&gt;
If you have an installed CUDA GPU on your machine you can compile Yambo to use it, by adding the flag&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#0000FF&amp;quot;&amp;gt;&#039;&#039;--enable-cuda-fortran&amp;lt;/span&amp;gt; &lt;br /&gt;
and then specify your GPU architecture and the CUDA runtime version, look at configure help for more info.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check that your Nvidia graphic card is properly installed&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To be sure that the code will run fine on your GPU card, you need the proper driver installed on your machine. If you have the nvidia drivers, just run&lt;br /&gt;
 $nvidia-smi&lt;br /&gt;
 Mon Sep  9 16:20:02 2024       &lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | NVIDIA-SMI 560.35.03              Driver Version: 560.35.03      CUDA Version: 12.6     |&lt;br /&gt;
 |-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |&lt;br /&gt;
 | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |&lt;br /&gt;
 |                                         |                        |               MIG M. |&lt;br /&gt;
 |=========================================+========================+======================|&lt;br /&gt;
 |   0  NVIDIA GeForce GTX 1650        Off |   00000000:01:00.0  On |                  N/A |&lt;br /&gt;
 | 20%   39C    P8              8W /   75W |     280MiB /   4096MiB |      0%      Default |&lt;br /&gt;
 |                                         |                        |                  N/A |&lt;br /&gt;
 +-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
&#039;&#039;CUDA Version: V.S&#039;&#039; should be lower or equal to what you set in your &#039;&#039;cuda-runtime&#039;&#039; in the configure. In this case we are running with driver 560, which supports cuda version 12.6 or newer via the CUDA Forward Compatibility Package (see [https://docs.nvidia.com/deploy/cuda-compatibility/ https://docs.nvidia.com/deploy/cuda-compatibility/]).&lt;br /&gt;
&lt;br /&gt;
More info on Yambo on NVIDIA graphic cards can be found here: [https://www.nvidia.com/en-us/on-demand/session/gtcspring21-e32448/ Materials Design Toward the Exascale: Porting Electronic Structure Community Codes to GPUs]&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint_with_NVfortran_compiler&amp;diff=8417</id>
		<title>Install Yambo on Ubuntu/LinuxMint with NVfortran compiler</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint_with_NVfortran_compiler&amp;diff=8417"/>
		<updated>2025-03-10T12:21:30Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The NVIDIA compiler are freely available on Linux machines.&lt;br /&gt;
You can download Fortran,C, C++ compiler and debugger from:&lt;br /&gt;
[https://developer.nvidia.com/hpc-sdk-downloads NVIDIA HPC Software Development Kit (SDK) ] &amp;lt;br&amp;gt;&lt;br /&gt;
On Ubuntu, it can be easely installed via the following procedure&lt;br /&gt;
 curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg&lt;br /&gt;
 echo &#039;deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /&#039; | sudo tee /etc/apt/sources.list.d/nvhpc.list&lt;br /&gt;
 sudo apt-get update -y&lt;br /&gt;
 sudo apt-get install -y nvhpc-25-1 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup NVIDIA compilers &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once you downloaded and installed the NVIDIA SDK it is suggested avoiding manually setting environment variables for compilers and MPI wrappers. The safest approach is to use the module files provided by Nvidia, located at: `/opt/nvidia/hpc_sdk/modulefiles`&lt;br /&gt;
&lt;br /&gt;
Before using module files, you need to install the module management tool:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install environment-modules&lt;br /&gt;
 echo &amp;quot;source /etc/profile.d/modules.sh&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo &amp;quot;module use /opt/nvidia/hpc_sdk/modulefiles&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
The commands above only need to be used the first time. Now, you can load the Nvidia SDK module, which will correctly set up all environment variables for both compilers and MPI:&lt;br /&gt;
&lt;br /&gt;
 module load nvhpc/25.1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Configure Yambo with NVfortran and openMPI &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then you can configure Yambo with the command:&lt;br /&gt;
&lt;br /&gt;
 ./configure MPIFC=mpif90 MPICC=mpicc FC=nvfortran F77=nvfortran CPP=&amp;quot;cpp -E&amp;quot;  FPP=&amp;quot;nvfortran -Mpreprocess -E&amp;quot; F90SUFFIX=&amp;quot;.f90&amp;quot; \&lt;br /&gt;
 --enable-memory-profile  --enable-open-mp --enable-par-linalg  --enable-hdf5-par-io  --enable-slepc-linalg &lt;br /&gt;
&lt;br /&gt;
If you have an installed CUDA GPU on your machine you can compile Yambo to use it, by adding the flag&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#0000FF&amp;quot;&amp;gt;&#039;&#039;--enable-cuda-fortran&amp;lt;/span&amp;gt; &lt;br /&gt;
and then specify your GPU architecture and the CUDA runtime version, look at configure help for more info.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check that your Nvidia graphic card is properly installed&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To be sure that the code will run fine on your GPU card, you need the proper driver installed on your machine. If you have the nvidia drivers, just run&lt;br /&gt;
 $nvidia-smi&lt;br /&gt;
 Mon Sep  9 16:20:02 2024       &lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | NVIDIA-SMI 560.35.03              Driver Version: 560.35.03      CUDA Version: 12.6     |&lt;br /&gt;
 |-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |&lt;br /&gt;
 | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |&lt;br /&gt;
 |                                         |                        |               MIG M. |&lt;br /&gt;
 |=========================================+========================+======================|&lt;br /&gt;
 |   0  NVIDIA GeForce GTX 1650        Off |   00000000:01:00.0  On |                  N/A |&lt;br /&gt;
 | 20%   39C    P8              8W /   75W |     280MiB /   4096MiB |      0%      Default |&lt;br /&gt;
 |                                         |                        |                  N/A |&lt;br /&gt;
 +-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
&#039;&#039;CUDA Version: V.S&#039;&#039; should be lower or equal to what you set in your &#039;&#039;cuda-runtime&#039;&#039; in the configure. In this case we are running with driver 560, which supports cuda version 12.6 or newer via the CUDA Forward Compatibility Package (see [https://docs.nvidia.com/deploy/cuda-compatibility/ https://docs.nvidia.com/deploy/cuda-compatibility/]).&lt;br /&gt;
&lt;br /&gt;
More info on Yambo on NVIDIA graphic cards can be found here: [https://www.nvidia.com/en-us/on-demand/session/gtcspring21-e32448/ Materials Design Toward the Exascale: Porting Electronic Structure Community Codes to GPUs]&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint_with_NVfortran_compiler&amp;diff=8416</id>
		<title>Install Yambo on Ubuntu/LinuxMint with NVfortran compiler</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint_with_NVfortran_compiler&amp;diff=8416"/>
		<updated>2025-03-10T11:44:22Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The NVIDIA compiler are freely available on Linux machines.&lt;br /&gt;
You can download Fortran,C, C++ compiler and debugger from:&lt;br /&gt;
[https://developer.nvidia.com/hpc-sdk-downloads NVIDIA HPC Software Development Kit (SDK) ] &amp;lt;br&amp;gt;&lt;br /&gt;
On Ubuntu, it can be easely installed via the following procedure&lt;br /&gt;
 curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg&lt;br /&gt;
 echo &#039;deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /&#039; | sudo tee /etc/apt/sources.list.d/nvhpc.list&lt;br /&gt;
 sudo apt-get update -y&lt;br /&gt;
 sudo apt-get install -y nvhpc-25-1 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup NVIDIA compilers &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once you downloaded and installed the NVIDIA SDK it is suggested avoiding manually setting environment variables for compilers and MPI wrappers. The safest approach is to use the module files provided by Nvidia, located at: `/opt/nvidia/hpc_sdk/modulefiles`&lt;br /&gt;
&lt;br /&gt;
Before using module files, you need to install the module management tool:&lt;br /&gt;
&lt;br /&gt;
 sudo apt install environment-modules&lt;br /&gt;
 echo &amp;quot;source /etc/profile.d/modules.sh&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo &amp;quot;module use /opt/nvidia/hpc_sdk/modulefiles&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
The commands above only need to be used the first time. Now, you can load the Nvidia SDK module, which will correctly set up all environment variables for both compilers and MPI:&lt;br /&gt;
&lt;br /&gt;
 module load nvhpc/25.1&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Configure Yambo with NVfortran and openMPI &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then you can configure Yambo with the command:&lt;br /&gt;
&lt;br /&gt;
 ./configure MPIFC=mpif90 MPICC=mpicc FC=nvfortran F77=nvfortran CPP=&amp;quot;cpp -E&amp;quot;  FPP=&amp;quot;nvfortran -Mpreprocess -E&amp;quot; F90SUFFIX=&amp;quot;.f90&amp;quot; \&lt;br /&gt;
 --enable-memory-profile  --enable-open-mp --enable-par-linalg  --enable-hdf5-par-io  --enable-slepc-linalg &lt;br /&gt;
&lt;br /&gt;
If you have an installed CUDA GPU on your machine you can compile Yambo to use it, by adding the flag&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#0000FF&amp;quot;&amp;gt;&#039;&#039;--enable-cuda-fortran&amp;lt;/span&amp;gt; &lt;br /&gt;
and then specify your GPU architecture and the CUDA runtime version, look at configure help for more info.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check that your Nvidia graphic card is properly installed&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To be sure that the code will run fine on your GPU card, you need the proper driver installed on your machine. If you have the nvidia drivers, just run&lt;br /&gt;
 $nvidia-smi&lt;br /&gt;
 Mon Sep  9 16:20:02 2024       &lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | NVIDIA-SMI 560.35.03              Driver Version: 560.35.03      CUDA Version: 12.6     |&lt;br /&gt;
 |-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |&lt;br /&gt;
 | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |&lt;br /&gt;
 |                                         |                        |               MIG M. |&lt;br /&gt;
 |=========================================+========================+======================|&lt;br /&gt;
 |   0  NVIDIA GeForce GTX 1650        Off |   00000000:01:00.0  On |                  N/A |&lt;br /&gt;
 | 20%   39C    P8              8W /   75W |     280MiB /   4096MiB |      0%      Default |&lt;br /&gt;
 |                                         |                        |                  N/A |&lt;br /&gt;
 +-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
&#039;&#039;CUDA Version: V.S&#039;&#039; should be lower or equal to what you set in your &#039;&#039;cuda-runtime&#039;&#039; in the configure. In this case we are running with driver 560, which supports cuda version 12.6 or greater via the CUDA Forward Compatibility Package (see [https://docs.nvidia.com/deploy/cuda-compatibility/ https://docs.nvidia.com/deploy/cuda-compatibility/]).&lt;br /&gt;
&lt;br /&gt;
More info on Yambo on NVIDIA graphic cards can be found here: [https://www.nvidia.com/en-us/on-demand/session/gtcspring21-e32448/ Materials Design Toward the Exascale: Porting Electronic Structure Community Codes to GPUs]&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_MacOS_(ARM)&amp;diff=8321</id>
		<title>Install Yambo on MacOS (ARM)</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_MacOS_(ARM)&amp;diff=8321"/>
		<updated>2024-12-12T11:04:47Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to install YAMBO on a Mac computer with ARM architecture, it is first necessary to set up a development environment on the target computer. At a minimum, this requires Fortran and C/C++ compilers suitable for compiling code on ARM architectures, such as the GNU Compiler Collection (GCC). HomeBrew, a package manager for macOS (or Linux), can be used to install the compilers and some of the libraries needed. For libraries not available in the HomeBrew repository or those that did not meet the necessary requirements, the installation can be handled by the automated procedure developed within YAMBO itself.&lt;br /&gt;
&lt;br /&gt;
==== Preparing of the development environment ====&lt;br /&gt;
&lt;br /&gt;
The software HomeBrew needs to be installed first:&lt;br /&gt;
&lt;br /&gt;
  /bin/bash -c &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
And to install the compiler and the libraries is possible to use these commands:&lt;br /&gt;
&lt;br /&gt;
  brew install gcc&lt;br /&gt;
  brew install open-mpi&lt;br /&gt;
  brew install openblas fftw libxc&lt;br /&gt;
  brew install hdf5 netcdf netcdf-fortran&lt;br /&gt;
&lt;br /&gt;
In a first test machine (MacBook Air M1, macOS Sonoma v14.6.1) this is a partial list of the installed packages and versions:&lt;br /&gt;
&lt;br /&gt;
  % brew list --versions&lt;br /&gt;
  [...]&lt;br /&gt;
  cmake 3.26.4&lt;br /&gt;
  fftw 3.3.10_1&lt;br /&gt;
  gcc 14.2.0_1&lt;br /&gt;
  hdf5 1.14.4.3&lt;br /&gt;
  libxc 6.2.0&lt;br /&gt;
  netcdf 4.9.2_2&lt;br /&gt;
  netcdf-fortran 4.6.1_1&lt;br /&gt;
  open-mpi 5.0.5&lt;br /&gt;
  openblas 0.3.28&lt;br /&gt;
  scalapack 2.2.0_1&lt;br /&gt;
  gcc-aarch64-embedded 12.2.rel1&lt;br /&gt;
&lt;br /&gt;
==== Installing YAMBO ====&lt;br /&gt;
&lt;br /&gt;
The features required to compile YAMBO on ARM architectures will be publicly released in the next version, 5.3.&lt;br /&gt;
Nevertheless, you can already experiment with the installation using the tech-master development branch of the official GitHub code repository:&lt;br /&gt;
&lt;br /&gt;
  git clone https://github.com/yambo-code/yambo.git&lt;br /&gt;
  cd yambo&lt;br /&gt;
  git checkout tech-master&lt;br /&gt;
&lt;br /&gt;
Finally YAMBO can be successfully compiled with the following configuration:&lt;br /&gt;
&lt;br /&gt;
  export OMPI_CC=/opt/homebrew/bin/gcc-14&lt;br /&gt;
  OPT=/opt/homebrew/opt&lt;br /&gt;
  ./configure \&lt;br /&gt;
    CC=gcc-14 \&lt;br /&gt;
    CPP=&amp;quot;gcc-14 -E -P&amp;quot; \&lt;br /&gt;
    MPICC=mpicc \&lt;br /&gt;
    FC=gfortran-14 \&lt;br /&gt;
    F77=gfortran-14 \&lt;br /&gt;
    FPP=&amp;quot;gfortran-14 -E -P&amp;quot; \&lt;br /&gt;
    MPIFC=mpifort \&lt;br /&gt;
    --enable-mpi \&lt;br /&gt;
    --enable-open-mp \&lt;br /&gt;
    --disable-hdf5-par-io \&lt;br /&gt;
    --enable-time-profile \&lt;br /&gt;
    --enable-memory-profile \&lt;br /&gt;
    --enable-msgs-comps \&lt;br /&gt;
    --with-blas-libs=&amp;quot;-L$OPT/openblas/lib -lopenblas&amp;quot; \&lt;br /&gt;
    --with-lapack-libs=&amp;quot;-L$OPT/openblas/lib -lopenblas&amp;quot; \&lt;br /&gt;
    --with-libxc-path=$OPT/libxc \&lt;br /&gt;
    --with-fft-path=$OPT/fftw \&lt;br /&gt;
    --with-hdf5-path=$OPT/hdf5 \&lt;br /&gt;
    --with-netcdf-path=$OPT/netcdf \&lt;br /&gt;
    --with-netcdff-path=$OPT/netcdf-fortran \&lt;br /&gt;
    --enable-par-linalg \&lt;br /&gt;
    --with-scalapack-libs=&amp;quot;-L$OPT/scalapack/lib -lscalapack&amp;quot; \&lt;br /&gt;
    --with-blacs-libs=&amp;quot;-L$OPT/scalapack/lib -lscalapack&amp;quot; \&lt;br /&gt;
    --enable-slepc-linalg \&lt;br /&gt;
    --with-extlibs-path=$HOME/opt/ext-libs&lt;br /&gt;
  make -j4 all&lt;br /&gt;
&lt;br /&gt;
gcc-14 and gfortran-14 can be substituted with the compiler version used, see below how to check the version of the packages installed with HomeBrew.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting: ====&lt;br /&gt;
&lt;br /&gt;
An issue was identified with the mpicc wrapper. It was expected to use the gcc-14 C compiler internally; however, it was found to be using the Apple Clang compiler instead:&lt;br /&gt;
&lt;br /&gt;
  mpicc -show&lt;br /&gt;
  clang -I/opt/homebrew/Cellar/open-mpi/5.0.5/include -L/opt/homebrew/Cellar/open-mpi/5.0.5/lib -lmpi&lt;br /&gt;
&lt;br /&gt;
The issue was solved using the OMPI_CC environment variable to specify the C compiler:&lt;br /&gt;
&lt;br /&gt;
  export OMPI_CC=/opt/homebrew/bin/gcc-14 &lt;br /&gt;
  mpicc --show&lt;br /&gt;
  /opt/homebrew/bin/gcc-14 -I/opt/homebrew/Cellar/open-mpi/5.0.5/include -L/opt/homebrew/Cellar/open-mpi/5.0.5/lib -lmpi&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_MacOS_(ARM)&amp;diff=8320</id>
		<title>Install Yambo on MacOS (ARM)</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_MacOS_(ARM)&amp;diff=8320"/>
		<updated>2024-12-12T11:03:46Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: Created page with &amp;quot;In order to install YAMBO on Mac with ARM architecture, it is first necessary to set up a development environment on the target computer. At a minimum, this requires Fortran and C/C++ compilers suitable for compiling code on ARM architectures, such as the GNU Compiler Collection (GCC). HomeBrew, a package manager for macOS (or Linux), can be used to install the compilers and some of the libraries needed. For libraries not available in the HomeBrew repository or those tha...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to install YAMBO on Mac with ARM architecture, it is first necessary to set up a development environment on the target computer. At a minimum, this requires Fortran and C/C++ compilers suitable for compiling code on ARM architectures, such as the GNU Compiler Collection (GCC). HomeBrew, a package manager for macOS (or Linux), can be used to install the compilers and some of the libraries needed. For libraries not available in the HomeBrew repository or those that did not meet the necessary requirements, the installation can be handled by the automated procedure developed within YAMBO itself.&lt;br /&gt;
&lt;br /&gt;
==== Preparing of the development environment ====&lt;br /&gt;
&lt;br /&gt;
The software HomeBrew needs to be installed first:&lt;br /&gt;
&lt;br /&gt;
  /bin/bash -c &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
And to install the compiler and the libraries is possible to use these commands:&lt;br /&gt;
&lt;br /&gt;
  brew install gcc&lt;br /&gt;
  brew install open-mpi&lt;br /&gt;
  brew install openblas fftw libxc&lt;br /&gt;
  brew install hdf5 netcdf netcdf-fortran&lt;br /&gt;
&lt;br /&gt;
In a first test machine (MacBook Air M1, macOS Sonoma v14.6.1) this is a partial list of the installed packages and versions:&lt;br /&gt;
&lt;br /&gt;
  % brew list --versions&lt;br /&gt;
  [...]&lt;br /&gt;
  cmake 3.26.4&lt;br /&gt;
  fftw 3.3.10_1&lt;br /&gt;
  gcc 14.2.0_1&lt;br /&gt;
  hdf5 1.14.4.3&lt;br /&gt;
  libxc 6.2.0&lt;br /&gt;
  netcdf 4.9.2_2&lt;br /&gt;
  netcdf-fortran 4.6.1_1&lt;br /&gt;
  open-mpi 5.0.5&lt;br /&gt;
  openblas 0.3.28&lt;br /&gt;
  scalapack 2.2.0_1&lt;br /&gt;
  gcc-aarch64-embedded 12.2.rel1&lt;br /&gt;
&lt;br /&gt;
==== Installing YAMBO ====&lt;br /&gt;
&lt;br /&gt;
The features required to compile YAMBO on ARM architectures will be publicly released in the next version, 5.3.&lt;br /&gt;
Nevertheless, you can already experiment with the installation using the tech-master development branch of the official GitHub code repository:&lt;br /&gt;
&lt;br /&gt;
  git clone https://github.com/yambo-code/yambo.git&lt;br /&gt;
  cd yambo&lt;br /&gt;
  git checkout tech-master&lt;br /&gt;
&lt;br /&gt;
Finally YAMBO can be successfully compiled with the following configuration:&lt;br /&gt;
&lt;br /&gt;
  export OMPI_CC=/opt/homebrew/bin/gcc-14&lt;br /&gt;
  OPT=/opt/homebrew/opt&lt;br /&gt;
  ./configure \&lt;br /&gt;
    CC=gcc-14 \&lt;br /&gt;
    CPP=&amp;quot;gcc-14 -E -P&amp;quot; \&lt;br /&gt;
    MPICC=mpicc \&lt;br /&gt;
    FC=gfortran-14 \&lt;br /&gt;
    F77=gfortran-14 \&lt;br /&gt;
    FPP=&amp;quot;gfortran-14 -E -P&amp;quot; \&lt;br /&gt;
    MPIFC=mpifort \&lt;br /&gt;
    --enable-mpi \&lt;br /&gt;
    --enable-open-mp \&lt;br /&gt;
    --disable-hdf5-par-io \&lt;br /&gt;
    --enable-time-profile \&lt;br /&gt;
    --enable-memory-profile \&lt;br /&gt;
    --enable-msgs-comps \&lt;br /&gt;
    --with-blas-libs=&amp;quot;-L$OPT/openblas/lib -lopenblas&amp;quot; \&lt;br /&gt;
    --with-lapack-libs=&amp;quot;-L$OPT/openblas/lib -lopenblas&amp;quot; \&lt;br /&gt;
    --with-libxc-path=$OPT/libxc \&lt;br /&gt;
    --with-fft-path=$OPT/fftw \&lt;br /&gt;
    --with-hdf5-path=$OPT/hdf5 \&lt;br /&gt;
    --with-netcdf-path=$OPT/netcdf \&lt;br /&gt;
    --with-netcdff-path=$OPT/netcdf-fortran \&lt;br /&gt;
    --enable-par-linalg \&lt;br /&gt;
    --with-scalapack-libs=&amp;quot;-L$OPT/scalapack/lib -lscalapack&amp;quot; \&lt;br /&gt;
    --with-blacs-libs=&amp;quot;-L$OPT/scalapack/lib -lscalapack&amp;quot; \&lt;br /&gt;
    --enable-slepc-linalg \&lt;br /&gt;
    --with-extlibs-path=$HOME/opt/ext-libs&lt;br /&gt;
  make -j4 all&lt;br /&gt;
&lt;br /&gt;
gcc-14 and gfortran-14 can be substituted with the compiler version used, see below how to check the version of the packages installed with HomeBrew.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting: ====&lt;br /&gt;
&lt;br /&gt;
An issue was identified with the mpicc wrapper. It was expected to use the gcc-14 C compiler internally; however, it was found to be using the Apple Clang compiler instead:&lt;br /&gt;
&lt;br /&gt;
  mpicc -show&lt;br /&gt;
  clang -I/opt/homebrew/Cellar/open-mpi/5.0.5/include -L/opt/homebrew/Cellar/open-mpi/5.0.5/lib -lmpi&lt;br /&gt;
&lt;br /&gt;
The issue was solved using the OMPI_CC environment variable to specify the C compiler:&lt;br /&gt;
&lt;br /&gt;
  export OMPI_CC=/opt/homebrew/bin/gcc-14 &lt;br /&gt;
  mpicc --show&lt;br /&gt;
  /opt/homebrew/bin/gcc-14 -I/opt/homebrew/Cellar/open-mpi/5.0.5/include -L/opt/homebrew/Cellar/open-mpi/5.0.5/lib -lmpi&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Installation&amp;diff=8319</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Installation&amp;diff=8319"/>
		<updated>2024-12-12T10:14:01Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Download ===&lt;br /&gt;
&lt;br /&gt;
The Yambo source code can be downloaded from several sources. Refer to the [[Download|dedicated page]] for further informations.&lt;br /&gt;
&lt;br /&gt;
=== Quick Configuration (with long compilation) ===&lt;br /&gt;
&lt;br /&gt;
Yambo can make good use of external libraries like FFTW, LAPACK, netCDF, HDF5, IOTK, LIBXC and so on. It is worth identifying if they are already installed on your system, especially for HPC machines.&lt;br /&gt;
&lt;br /&gt;
If you are lucky, the configure script will successfully find the best compiler options. Moving in the source directory you can configure quickly Yambo and start the compilation simply with these two commands:&lt;br /&gt;
 $ ./configure&lt;br /&gt;
 $ make core&lt;br /&gt;
&lt;br /&gt;
This leads to a very long compilation because Yambo will download and compile all the required libraries. Executables are found in the &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; folder. To check that it works:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplest install of yambo is the one using internal libraries and compiled with gfortran. This is useful to test the code on your local machine, or in order to easily follow the [[Tutorials|yambo tutorials]].&lt;br /&gt;
 $ ./bin/yambo&lt;br /&gt;
 &lt;br /&gt;
 Cannot access CORE database (SAVE/*db1 and/or SAVE/*wf)&lt;br /&gt;
&lt;br /&gt;
This is the expected error message since we didn&#039;t provide the input database needed by Yambo.&lt;br /&gt;
&lt;br /&gt;
=== Custom Configuration ===&lt;br /&gt;
&lt;br /&gt;
In general, however, some fine-tuning will be necessary to link the requested libraries. &lt;br /&gt;
It is also possible to customize the configurazion using configure options that allow you to enable or disable some features. In order to have a complete list of all those options use the command&lt;br /&gt;
&lt;br /&gt;
 $./configure --help&lt;br /&gt;
&lt;br /&gt;
After configure, you can also edit the &amp;lt;code&amp;gt;config/setup&amp;lt;/code&amp;gt; file. You can run the following configure script (named for example &amp;lt;code&amp;gt;yambo_install.sh&amp;lt;/code&amp;gt;) which should work for &#039;&#039;&#039;yambo 5.0&#039;&#039;&#039; on &#039;&#039;&#039;Linux machines&#039;&#039;&#039;:&lt;br /&gt;
 YAMBO_EXT_LIBS=&amp;quot;/user/defined/path/for/internal/libs&amp;quot;&lt;br /&gt;
 ./configure FC=gfortran \&lt;br /&gt;
  --with-extlibs-path=$YAMBO_EXT_LIBS \&lt;br /&gt;
  --enable-keep-extlibs \&lt;br /&gt;
  --enable-time-profile \&lt;br /&gt;
  --enable-msgs-comps \&lt;br /&gt;
  --enable-keep-src \&lt;br /&gt;
  --enable-memory-profile \&lt;br /&gt;
  --enable-int-linalg \&lt;br /&gt;
  --enable-par-linalg \&lt;br /&gt;
  --enable-netcdf-output \&lt;br /&gt;
  --enable-slepc-linalg&lt;br /&gt;
&lt;br /&gt;
==== Specific Configuration options ====&lt;br /&gt;
&lt;br /&gt;
Here some info about the different configuration options:&lt;br /&gt;
* [[configure-suggested|Details on configure options for yambo]]&lt;br /&gt;
&lt;br /&gt;
Here is a list of specific configuration options.&lt;br /&gt;
* [[configure-5.0|Configure options for yambo 5.0]] &lt;br /&gt;
* [[configure-4.4.0|Configure options for Yambo 4.4]]&lt;br /&gt;
* [[configure options for Yambo v4|Configure options for Yambo v4 and v3]]&lt;br /&gt;
&lt;br /&gt;
=== Further informations ===&lt;br /&gt;
&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint]] (2021, Yambo 5.1)&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint with Intel compiler]] (2021, Yambo 5.1)&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint with NVfortran compiler]] (2024, Yambo 5.2)&lt;br /&gt;
* [[Install Yambo on MacOS (ARM)]] (2024, Yambo 5.3)&lt;br /&gt;
* [[Install Yambo in IRENE machine (TGCC Joliot Curie)]]&lt;br /&gt;
* [[Compile the libraries in Yambo independently]]&lt;br /&gt;
* [[Install Yambo with external HDF5 and NetCDF libraries]]&lt;br /&gt;
* [[Static Yambo]]&lt;br /&gt;
* [[Machine specific configure scripts]]&lt;br /&gt;
* [[Compiler specific flags]]&lt;br /&gt;
&lt;br /&gt;
=== Known Issues ===&lt;br /&gt;
* &#039;&#039;&#039;[https://gcc.gnu.org/wiki/GFortran gfortran] 4.4 or earlier versions&#039;&#039;&#039;&amp;lt;br&amp;gt;Yambo 5.x uses different Fortran constructs, as for example &amp;quot;allocate(x, source=y)&amp;quot;, that are not supported by gfortran 4.4 and its earlier versions, please update your gfortran or use a different compiler.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;NetCDF/HDF5 in Ubuntu 20.4&#039;&#039;&#039;&amp;lt;br&amp;gt;System provided NetCDF and HDF5 libraries in LinuxMint 20.1/Ubuntu 20.4 have problems with Yambo  please use internal Yambo libraries&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quantum-Espresso at GAMMA point&#039;&#039;&#039;&amp;lt;br&amp;gt;  In Quantum-Espresso if you perform a SCF calculation using the option &amp;quot;KPOINTS gamma&amp;quot;   you should use the same option for the NSCF otherwise Yambo gets confused with the g-vectors. If you need more k-points in the NSCF just re-run the SCF with &amp;quot;KPOINTS automatic /1 1 1 0 0 0&amp;quot;     and the run NSCF with a finite k-grid&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Internal MAC-OSX libraries&#039;&#039;&#039;&amp;lt;br&amp;gt;  At present it is no possible to compile Yambo with internal macos libraries  Indeed, no include/system/netcdf.mod file is present in the system.    The problem is due to  Autoconf setting which automatically searches for versions     of the needed libraries in your system despite the specific options given to configure.    Then, it would compile the internal hdf5, then find an external netcdf,    then try to compile netcdf-fortran creating various conflicts. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;gfortran compiler on MAC-OSX&#039;&#039;&#039;&amp;lt;br&amp;gt; There are different problems compiling Yambo with &amp;quot;gfortran&amp;quot;  variant of the compiler/libraries with MacPorts,    a possible solution it is to install the &amp;quot;gcc8&amp;quot; variant of these libraries and compilters. &amp;lt;br&amp;gt;More details here: [http://www.yambo-code.eu/forum/viewtopic.php?t=1767 http://www.yambo-code.eu/forum/viewtopic.php?t=1767]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Input file generation on MacOSX&#039;&#039;&#039;&amp;lt;br&amp;gt; There are two issues on input file generation: 1) when you generate an input file on MacOSX Yambo is not able to read values already present in the input file, and reset them to the default value; 2) if yambo and ypp have the same option to generate an input file the code get confused. Please use long input strings, for example &amp;quot;yambo -optics&amp;quot; instead of &amp;quot;yambo -o&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Parallel compilation with nvfortran for nproc &amp;gt;=8 &#039;&#039;&#039; &amp;lt;br&amp;gt; Compiling yambo in parallel with nvfortran and 8 or more processor give some problem. Please compile with less processors&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Installation&amp;diff=6278</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Installation&amp;diff=6278"/>
		<updated>2023-03-29T10:18:15Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Custom Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Download ===&lt;br /&gt;
&lt;br /&gt;
The Yambo source code can be downloaded from several sources. Refer to the [[Download|dedicated page]] for further informations.&lt;br /&gt;
&lt;br /&gt;
=== Quick Configuration (with long compilation) ===&lt;br /&gt;
&lt;br /&gt;
Yambo can make good use of external libraries like FFTW, LAPACK, netCDF, HDF5, IOTK, LIBXC and so on. It is worth identifying if they are already installed on your system, especially for HPC machines.&lt;br /&gt;
&lt;br /&gt;
If you are lucky, the configure script will successfully find the best compiler options. Moving in the source directory you can configure quickly Yambo and start the compilation simply with these two commands:&lt;br /&gt;
&lt;br /&gt;
 % ./configure&lt;br /&gt;
 % make core&lt;br /&gt;
&lt;br /&gt;
This leads to a very long compilation because Yambo will download and compile all the required libraries. Executables are found in the &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; folder. To check that it works:&lt;br /&gt;
&lt;br /&gt;
 % ./bin/yambo&lt;br /&gt;
 &lt;br /&gt;
 Cannot access CORE database (SAVE/*db1 and/or SAVE/*wf)&lt;br /&gt;
&lt;br /&gt;
This is the expected error message since we didn&#039;t provide the input database needed by Yambo.&lt;br /&gt;
&lt;br /&gt;
=== Custom Configuration ===&lt;br /&gt;
&lt;br /&gt;
In general, however, some fine-tuning will be necessary to link the requested libraries. &lt;br /&gt;
It is also possible to customize the configurazion using configure options that allow you to enable or disable some features. In order to have a complete list of all those options use the command&lt;br /&gt;
&lt;br /&gt;
 ./configure --help&lt;br /&gt;
&lt;br /&gt;
After configure, you can also edit the &amp;lt;code&amp;gt;config/setup&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
If you want to install yambo on your local machine or just for testing/tutorial purposes, you can start with the configure options suggested here:&lt;br /&gt;
&lt;br /&gt;
 --enable-mpi              # already enabled by default&lt;br /&gt;
 --enable-open-mp&lt;br /&gt;
&lt;br /&gt;
to enable MPI and OpenMP parallelizarion;&lt;br /&gt;
&lt;br /&gt;
 --enable-time-profile&lt;br /&gt;
 --enable-memory-profile&lt;br /&gt;
&lt;br /&gt;
to enable time and memory profiling (very useful for benchmarking and debugging);&lt;br /&gt;
&lt;br /&gt;
 --enable-par-linalg&lt;br /&gt;
 --enable-slepc-linalg&lt;br /&gt;
&lt;br /&gt;
to enable rispectively the support to the parallel (with ScaLAPACK) linear algebra and the suport for the diagonalization of BSE using SLEPc library;&lt;br /&gt;
&lt;br /&gt;
 --with-extlibs-path=&amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to specify a directory where Yambo will install the needed external libraries (replace &amp;lt;code&amp;gt;&amp;lt;path&amp;gt;&amp;lt;/code&amp;gt; with a valid directory path where you have write permissions);&lt;br /&gt;
&lt;br /&gt;
 --enable-cuda=&amp;lt;opts&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to enable CUDA-Fortran support, where &amp;lt;code&amp;gt;&amp;lt;opts&amp;gt;&amp;lt;/code&amp;gt; are the CUDA version and the compute capability of the NVidia device (e.g. &amp;lt;code&amp;gt;cuda11.0,cc70&amp;lt;/code&amp;gt;). Please consider this last option only if you are sure that your machine have a GPU CUDA-capable.&lt;br /&gt;
&lt;br /&gt;
==== About external libraries ====&lt;br /&gt;
&lt;br /&gt;
Usually in HPC systems you can find already installed the library needed by Yambo. So you can use them through the specific configure options. Here below some examples.&lt;br /&gt;
&lt;br /&gt;
In order to link to a specific installation of a library you can use the relative configure option and specify the path:&lt;br /&gt;
&lt;br /&gt;
 --with-hdf5-path=&amp;lt;/path/to/hdf5&amp;gt;&lt;br /&gt;
 --with-netcdf-path=&amp;lt;/path/to/netcdf-c&amp;gt;&lt;br /&gt;
 --with-netcdff-path=&amp;lt;/path/to/netcdf-fortran&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here and example on how to use an installation of the Intel MKL libraries for the linear algebra and the Fourier transformations:&lt;br /&gt;
&lt;br /&gt;
 --with-blas-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl&amp;quot; \&lt;br /&gt;
 --with-lapack-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl&amp;quot; \&lt;br /&gt;
 --with-scalapack-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64&amp;quot; \&lt;br /&gt;
 --with-blacs-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_blacs_intelmpi_lp64&amp;quot; \&lt;br /&gt;
 --with-fft-includedir=&amp;quot;${MKLROOT}/include&amp;quot; \&lt;br /&gt;
 --with-fft-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== About environment variables ====&lt;br /&gt;
&lt;br /&gt;
Using specific environment variables it is also possible to tell the configuration script the name of the compiler or of the MPI wrapper or other compilation options. Here some examples in case you are using the NVHPC compilers suite:&lt;br /&gt;
&lt;br /&gt;
 ./configure CC=nvc FC=nvfortran FPP=&amp;quot;nvfortran -Mpreprocess -E&amp;quot; MPIFC=mpif90 ...&lt;br /&gt;
&lt;br /&gt;
==== Specific Configuration options ====&lt;br /&gt;
&lt;br /&gt;
Here is a list of specific configuration options.&lt;br /&gt;
&lt;br /&gt;
 * [[configure-5.0|Configure options for yambo 5.0]] &lt;br /&gt;
 * [[configure-4.4.0|Configure options for Yambo 4.4.0]]&lt;br /&gt;
 * [[configure options for Yambo v4|Configure options for Yambo v4 and v3]]&lt;br /&gt;
&lt;br /&gt;
=== Further informations ===&lt;br /&gt;
&lt;br /&gt;
* [[Install Yambo in IRENE machine (TGCC Joliot Curie)]]&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint]]&lt;br /&gt;
* [[Machine specific configure scripts]]&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint with Intel compiler]]&lt;br /&gt;
* [[Install Yambo with external HDF5 and NetCDF libraries]]&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint with NVfortran compiler]]&lt;br /&gt;
* [[Compile the libraries in Yambo independently]]&lt;br /&gt;
&lt;br /&gt;
=== Known Issues ===&lt;br /&gt;
* &#039;&#039;&#039;[https://gcc.gnu.org/wiki/GFortran gfortran] 4.4 or earlier versions&#039;&#039;&#039;&amp;lt;br&amp;gt;Yambo 5.x uses different Fortran constructs, as for example &amp;quot;allocate(x, source=y)&amp;quot;, that are not supported by gfortran 4.4 and its earlier versions, please update your gfortran or use a different compiler.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;NetCDF/HDF5 in Ubuntu 20.4&#039;&#039;&#039;&amp;lt;br&amp;gt;Internal NetCDF and HDF5 libraries in LinuxMint 20.1/Ubuntu 20.4 have problems with Yambo  please use internal Yambo libraries&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quantum-Espresso at GAMMA point&#039;&#039;&#039;&amp;lt;br&amp;gt;  In Quantum-Espresso if you perform a SCF calculation using the option &amp;quot;KPOINTS gamma&amp;quot;   you should use the same option for the NSCF otherwise Yambo gets confused with the g-vectors. If you need more k-points in the NSCF just re-run the SCF with &amp;quot;KPOINTS automatic /1 1 1 0 0 0&amp;quot;     and the run NSCF with a finite k-grid&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Internal MAC-OSX libraries&#039;&#039;&#039;&amp;lt;br&amp;gt;  At present it is no possible to compile Yambo with internal macos libraries  Indeed, no include/system/netcdf.mod file is present in the system.    The problem is due to  Autoconf setting which automatically searches for versions     of the needed libraries in your system despite the specific options given to configure.    Then, it would compile the internal hdf5, then find an external netcdf,    then try to compile netcdf-fortran creating various conflicts. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;gfortran compiler on MAC-OSX&#039;&#039;&#039;&amp;lt;br&amp;gt; There are different problems compiling Yambo with &amp;quot;gfortran&amp;quot;  variant of the compiler/libraries with MacPorts,    a possible solution it is to install the &amp;quot;gcc8&amp;quot; variant of these libraries and compilters. &amp;lt;br&amp;gt;More details here: [http://www.yambo-code.org/forum/viewtopic.php?t=1767 http://www.yambo-code.org/forum/viewtopic.php?t=1767]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Input file generation on MacOSX&#039;&#039;&#039;&amp;lt;br&amp;gt; There are two issues on input file generation: 1) when you generate an input file on MacOSX Yambo is not able to read values already present in the input file, and reset them to the default value; 2) if yambo and ypp have the same option to generate an input file the code get confused. Please use long input strings, for example &amp;quot;yambo -optics&amp;quot; instead of &amp;quot;yambo -o&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint&amp;diff=6277</id>
		<title>Install Yambo on Ubuntu/LinuxMint</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint&amp;diff=6277"/>
		<updated>2023-03-29T10:12:06Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here we can find the instruction to install Yambo 5.1.1 on a standard machine with a [https://ubuntu.com/ Ubuntu]/[https://linuxmint.com/ LinuxMint] distribution.&lt;br /&gt;
&lt;br /&gt;
We suppose you have root permission on your machine to install all the required packages.&lt;br /&gt;
&lt;br /&gt;
Run apt-get to update the package list&lt;br /&gt;
&lt;br /&gt;
 apt-get -yqq update &lt;br /&gt;
&lt;br /&gt;
Install compilers, python, mkl, and all necessary libraries to compile Yambo:&lt;br /&gt;
&lt;br /&gt;
 apt-get install build-essential ca-certificates curl file \&lt;br /&gt;
        make gcc g++ gfortran git gnupg2 iproute2 \&lt;br /&gt;
        unzip m4 wget git zlib1g-dev ssh \&lt;br /&gt;
        libmkl-avx libmkl-avx2 libmkl-avx512 libmkl-core libmkl-def \&lt;br /&gt;
        libmkl-dev libmkl-gf-ilp64 libmkl-gf-lp64 libmkl-gnu-thread&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
download lastest Yambo release, in this case the 5.1.1:&lt;br /&gt;
&lt;br /&gt;
 wget https://github.com/yambo-code/yambo/archive/5.1.1.tar.gz -O yambo-5.1.1.tar.gz &lt;br /&gt;
&lt;br /&gt;
decompress the file &lt;br /&gt;
&lt;br /&gt;
 tar zxfv yambo-5.1.1.tar.gz &amp;amp;&amp;amp; cd yambo-5.1.1 &lt;br /&gt;
&lt;br /&gt;
configure Yambo&lt;br /&gt;
&lt;br /&gt;
 ./configure --disable-mpi --enable-open-mp \&lt;br /&gt;
   --enable-slepc-linalg --disable-hdf5-par-io \&lt;br /&gt;
   --enable-msgs-comps --enable-time-profile --enable-memory-profile \&lt;br /&gt;
   --with-blas-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl&amp;quot; \&lt;br /&gt;
   --with-lapack-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl&amp;quot; &lt;br /&gt;
&lt;br /&gt;
compile the code (where -j4 means that the code is compiled in parallel on 4 cores):&lt;br /&gt;
&lt;br /&gt;
  make -j4 core&lt;br /&gt;
&lt;br /&gt;
The compilation was successful if there are the yambo executables in the &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
From now the instructions are optional but suggested! You may need sudo privileges to install Yambo in a system directory, otherwise install it in your home space.  &lt;br /&gt;
&lt;br /&gt;
Create a folder to install code and libraries:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p /usr/local/yambo-5.1.1/lib &lt;br /&gt;
&lt;br /&gt;
copy code and libraries in Yambo folder:&lt;br /&gt;
&lt;br /&gt;
 cp -r bin /usr/local/yambo-5.1.1/ &lt;br /&gt;
 cp -r lib/external/*/*/lib/*.* /usr/local/yambo-5.1.1/lib/ &lt;br /&gt;
 cp -r lib/external/*/*/v4/serial/lib/*.* /usr/local/yambo-5.1.1/lib/ &lt;br /&gt;
&lt;br /&gt;
you can remove the tar.gz file and the Yambo folder (optional):&lt;br /&gt;
&lt;br /&gt;
  cp ..&lt;br /&gt;
  rm -rf yambo-5.1.1 yambo-5.1.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
set the path to the Yambo bin folder, for tcsh/csh:&lt;br /&gt;
&lt;br /&gt;
 setenv PATH=/usr/local/yambo-5.1.1/bin:$PATH &lt;br /&gt;
 setenv LD_LIBRARY_PATH=/usr/local/yambo-5.1.1/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&lt;br /&gt;
or in bash:&lt;br /&gt;
&lt;br /&gt;
 export PATH=/usr/local/yambo-5.1.1/bin:$PATH &lt;br /&gt;
 export LD_LIBRARY_PATH=/usr/local/yambo-5.1.1/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&lt;br /&gt;
you are ready to use Yambo!!!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Optional for developers&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
you can copy also the include files:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p /usr/local/yambo-5.1.1/include&lt;br /&gt;
 cp -r lib/external/*/*/include/*.* /usr/local/yambo-5.1.1/include/ &lt;br /&gt;
 cp -r lib/external/*/*/v4/serial/include/*.* /usr/local/yambo-5.1.1/include/  &lt;br /&gt;
&lt;br /&gt;
and can add to the configure the following lines:&lt;br /&gt;
&lt;br /&gt;
 export YAMBO_LIBS=/usr/local/yambo-5.1.1&lt;br /&gt;
&lt;br /&gt;
and use the following options in the configure:&lt;br /&gt;
&lt;br /&gt;
 --with-iotk-path=&amp;quot;${YAMBO_LIBS}&amp;quot;  --with-libxc-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-hdf5-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-netcdf-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-netcdff-path=&amp;quot;${YAMBO_LIBS}&amp;quot; \&lt;br /&gt;
 --with-petsc-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-slepc-path=&amp;quot;${YAMBO_LIBS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
so the next time you recompile yambo from scrach it will not recompile the libraries.&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint&amp;diff=6276</id>
		<title>Install Yambo on Ubuntu/LinuxMint</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint&amp;diff=6276"/>
		<updated>2023-03-29T09:54:56Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here we can find the instruction to install Yambo 5.1.1 on a standard machine with a [https://ubuntu.com/ Ubuntu]/[https://linuxmint.com/ LinuxMint] distribution.&lt;br /&gt;
&lt;br /&gt;
We suppose you have root permission on your machine to install all the required packages.&lt;br /&gt;
&lt;br /&gt;
Run apt-get to update the package list&lt;br /&gt;
&lt;br /&gt;
 apt-get -yqq update &lt;br /&gt;
&lt;br /&gt;
Install compilers, python, mkl, and all necessary libraries to compile Yambo:&lt;br /&gt;
&lt;br /&gt;
 apt-get install build-essential ca-certificates curl file \&lt;br /&gt;
        make gcc g++ gfortran git gnupg2 iproute2 \&lt;br /&gt;
        unzip m4 wget git zlib1g-dev ssh \&lt;br /&gt;
        libmkl-avx libmkl-avx2 libmkl-avx512 libmkl-core libmkl-def \&lt;br /&gt;
        libmkl-dev libmkl-gf-ilp64 libmkl-gf-lp64 libmkl-gnu-thread&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
download lastest Yambo release, in this case the 5.1.1:&lt;br /&gt;
&lt;br /&gt;
 wget https://github.com/yambo-code/yambo/archive/5.1.1.tar.gz -O yambo-5.1.1.tar.gz &lt;br /&gt;
&lt;br /&gt;
decompress the file &lt;br /&gt;
&lt;br /&gt;
 tar zxfv yambo-5.1.1.tar.gz &amp;amp;&amp;amp; cd yambo-5.1.1 &lt;br /&gt;
&lt;br /&gt;
configure Yambo&lt;br /&gt;
&lt;br /&gt;
 ./configure --disable-mpi --enable-open-mp \&lt;br /&gt;
   --enable-slepc-linalg --disable-hdf5-par-io \&lt;br /&gt;
   --enable-msgs-comps --enable-time-profile --enable-memory-profile \&lt;br /&gt;
   --with-blas-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl&amp;quot; \&lt;br /&gt;
   --with-lapack-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl&amp;quot; &lt;br /&gt;
&lt;br /&gt;
compile the code (where -j4 means that the code is compiled in parallel on 4 cores):&lt;br /&gt;
&lt;br /&gt;
  make -j4 yambo&lt;br /&gt;
  make -j4 interfaces&lt;br /&gt;
  make -j4 ypp &lt;br /&gt;
&lt;br /&gt;
The compilation was successful if there are the yambo executables in the &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
From now the instructions are optional but suggested! You may need sudo privileges to install Yambo in a system directory, otherwise install it in your home space.  &lt;br /&gt;
&lt;br /&gt;
Create a folder to install code and libraries:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p /usr/local/yambo-5.0.1/lib &lt;br /&gt;
&lt;br /&gt;
copy code and libraries in Yambo folder:&lt;br /&gt;
&lt;br /&gt;
 cp -r bin /usr/local/yambo-5.0.1/ &lt;br /&gt;
 cp -r lib/external/*/*/lib/*.* /usr/local/yambo-5.0.1/lib/ &lt;br /&gt;
 cp -r lib/external/*/*/v4/serial/lib/*.* /usr/local/yambo-5.0.1/lib/ &lt;br /&gt;
&lt;br /&gt;
you can remove the tar.gz file and the Yambo folder (optional):&lt;br /&gt;
&lt;br /&gt;
  cp ..&lt;br /&gt;
  rm -rf yambo-5.0.1 yambo-5.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
set the path to the Yambo bin folder, for tcsh/csh:&lt;br /&gt;
&lt;br /&gt;
 setenv PATH=/usr/local/yambo-5.0.1/bin:$PATH &lt;br /&gt;
 setenv LD_LIBRARY_PATH=/usr/local/yambo-5.0.1/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&lt;br /&gt;
or in bash:&lt;br /&gt;
&lt;br /&gt;
 export PATH=/usr/local/yambo-5.0.1/bin:$PATH &lt;br /&gt;
 export LD_LIBRARY_PATH=/usr/local/yambo-5.0.1/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&lt;br /&gt;
you are ready to use Yambo!!!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Optional for developers&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
you can copy also the include files:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p /usr/local/yambo-5.0.1/include&lt;br /&gt;
 cp -r lib/external/*/*/include/*.* /usr/local/yambo-5.0.1/include/ &lt;br /&gt;
 cp -r lib/external/*/*/v4/serial/include/*.* /usr/local/yambo-5.0.1/include/  &lt;br /&gt;
&lt;br /&gt;
and can add to the configure the following lines:&lt;br /&gt;
&lt;br /&gt;
 export YAMBO_LIBS=/usr/local/yambo-5.0.1/&lt;br /&gt;
&lt;br /&gt;
and use the following options in the configure:&lt;br /&gt;
&lt;br /&gt;
 --with-iotk-path=&amp;quot;${YAMBO_LIBS}&amp;quot;  --with-libxc-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-hdf5-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-netcdf-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-netcdff-path=&amp;quot;${YAMBO_LIBS}&amp;quot; \&lt;br /&gt;
 --with-petsc-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-slepc-path=&amp;quot;${YAMBO_LIBS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
so the next time you recompile yambo from scrach it will not recompile the libraries.&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint&amp;diff=6275</id>
		<title>Install Yambo on Ubuntu/LinuxMint</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_Ubuntu/LinuxMint&amp;diff=6275"/>
		<updated>2023-03-29T09:54:14Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here we can find the instruction to install Yambo 5.0.1 on a standard machine with a [https://ubuntu.com/ Ubuntu]/[https://linuxmint.com/ LinuxMint] distribution.&lt;br /&gt;
&lt;br /&gt;
We suppose you have root permission on your machine to install all the required packages.&lt;br /&gt;
&lt;br /&gt;
Run apt-get to update the package list&lt;br /&gt;
&lt;br /&gt;
 apt-get -yqq update &lt;br /&gt;
&lt;br /&gt;
Install compilers, python, mkl, and all necessary libraries to compile Yambo:&lt;br /&gt;
&lt;br /&gt;
 apt-get install build-essential ca-certificates curl file \&lt;br /&gt;
        make gcc g++ gfortran git gnupg2 iproute2 \&lt;br /&gt;
        unzip m4 wget git zlib1g-dev ssh \&lt;br /&gt;
        libmkl-avx libmkl-avx2 libmkl-avx512 libmkl-core libmkl-def \&lt;br /&gt;
        libmkl-dev libmkl-gf-ilp64 libmkl-gf-lp64 libmkl-gnu-thread&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
download lastest Yambo release, in this case the 5.1.1:&lt;br /&gt;
&lt;br /&gt;
 wget https://github.com/yambo-code/yambo/archive/5.1.1.tar.gz -O yambo-5.1.1.tar.gz &lt;br /&gt;
&lt;br /&gt;
decompress the file &lt;br /&gt;
&lt;br /&gt;
 tar zxfv yambo-5.1.1.tar.gz &amp;amp;&amp;amp; cd yambo-5.1.1 &lt;br /&gt;
&lt;br /&gt;
configure Yambo&lt;br /&gt;
&lt;br /&gt;
 ./configure --disable-mpi --enable-open-mp \&lt;br /&gt;
   --enable-slepc-linalg --disable-hdf5-par-io \&lt;br /&gt;
   --enable-msgs-comps --enable-time-profile --enable-memory-profile \&lt;br /&gt;
   --with-blas-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl&amp;quot; \&lt;br /&gt;
   --with-lapack-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl&amp;quot; &lt;br /&gt;
&lt;br /&gt;
compile the code (where -j4 means that the code is compiled in parallel on 4 cores):&lt;br /&gt;
&lt;br /&gt;
  make -j4 yambo&lt;br /&gt;
  make -j4 interfaces&lt;br /&gt;
  make -j4 ypp &lt;br /&gt;
&lt;br /&gt;
The compilation was successful if there are the yambo executables in the &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
From now the instructions are optional but suggested! You may need sudo privileges to install Yambo in a system directory, otherwise install it in your home space.  &lt;br /&gt;
&lt;br /&gt;
Create a folder to install code and libraries:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p /usr/local/yambo-5.0.1/lib &lt;br /&gt;
&lt;br /&gt;
copy code and libraries in Yambo folder:&lt;br /&gt;
&lt;br /&gt;
 cp -r bin /usr/local/yambo-5.0.1/ &lt;br /&gt;
 cp -r lib/external/*/*/lib/*.* /usr/local/yambo-5.0.1/lib/ &lt;br /&gt;
 cp -r lib/external/*/*/v4/serial/lib/*.* /usr/local/yambo-5.0.1/lib/ &lt;br /&gt;
&lt;br /&gt;
you can remove the tar.gz file and the Yambo folder (optional):&lt;br /&gt;
&lt;br /&gt;
  cp ..&lt;br /&gt;
  rm -rf yambo-5.0.1 yambo-5.0.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
set the path to the Yambo bin folder, for tcsh/csh:&lt;br /&gt;
&lt;br /&gt;
 setenv PATH=/usr/local/yambo-5.0.1/bin:$PATH &lt;br /&gt;
 setenv LD_LIBRARY_PATH=/usr/local/yambo-5.0.1/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&lt;br /&gt;
or in bash:&lt;br /&gt;
&lt;br /&gt;
 export PATH=/usr/local/yambo-5.0.1/bin:$PATH &lt;br /&gt;
 export LD_LIBRARY_PATH=/usr/local/yambo-5.0.1/lib:$LD_LIBRARY_PATH&lt;br /&gt;
&lt;br /&gt;
you are ready to use Yambo!!!!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Optional for developers&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
you can copy also the include files:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p /usr/local/yambo-5.0.1/include&lt;br /&gt;
 cp -r lib/external/*/*/include/*.* /usr/local/yambo-5.0.1/include/ &lt;br /&gt;
 cp -r lib/external/*/*/v4/serial/include/*.* /usr/local/yambo-5.0.1/include/  &lt;br /&gt;
&lt;br /&gt;
and can add to the configure the following lines:&lt;br /&gt;
&lt;br /&gt;
 export YAMBO_LIBS=/usr/local/yambo-5.0.1/&lt;br /&gt;
&lt;br /&gt;
and use the following options in the configure:&lt;br /&gt;
&lt;br /&gt;
 --with-iotk-path=&amp;quot;${YAMBO_LIBS}&amp;quot;  --with-libxc-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-hdf5-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-netcdf-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-netcdff-path=&amp;quot;${YAMBO_LIBS}&amp;quot; \&lt;br /&gt;
 --with-petsc-path=&amp;quot;${YAMBO_LIBS}&amp;quot; --with-slepc-path=&amp;quot;${YAMBO_LIBS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
so the next time you recompile yambo from scrach it will not recompile the libraries.&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Installation&amp;diff=6274</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Installation&amp;diff=6274"/>
		<updated>2023-03-29T09:13:55Z</updated>

		<summary type="html">&lt;p&gt;Nicolaspallanzani: /* Custom Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Download ===&lt;br /&gt;
&lt;br /&gt;
The Yambo source code can be downloaded from several sources. Refer to the [[Download|dedicated page]] for further informations.&lt;br /&gt;
&lt;br /&gt;
=== Quick Configuration (with long compilation) ===&lt;br /&gt;
&lt;br /&gt;
Yambo can make good use of external libraries like FFTW, LAPACK, netCDF, HDF5, IOTK, LIBXC and so on. It is worth identifying if they are already installed on your system, especially for HPC machines.&lt;br /&gt;
&lt;br /&gt;
If you are lucky, the configure script will successfully find the best compiler options. Moving in the source directory you can configure quickly Yambo and start the compilation simply with these two commands:&lt;br /&gt;
&lt;br /&gt;
 % ./configure&lt;br /&gt;
 % make core&lt;br /&gt;
&lt;br /&gt;
This leads to a very long compilation because Yambo will download and compile all the required libraries. Executables are found in the &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; folder. To check that it works:&lt;br /&gt;
&lt;br /&gt;
 % ./bin/yambo&lt;br /&gt;
 &lt;br /&gt;
 Cannot access CORE database (SAVE/*db1 and/or SAVE/*wf)&lt;br /&gt;
&lt;br /&gt;
This is the expected error message since we didn&#039;t provide the input database needed by Yambo.&lt;br /&gt;
&lt;br /&gt;
=== Custom Configuration ===&lt;br /&gt;
&lt;br /&gt;
In general, however, some fine-tuning will be necessary to link the requested libraries. &lt;br /&gt;
It is also possible to customize the configurazion using configure options that allow you to enable or disable some features. In order to have a complete list of all those options use the command&lt;br /&gt;
&lt;br /&gt;
 ./configure --help&lt;br /&gt;
&lt;br /&gt;
After configure, you can also edit the &amp;lt;code&amp;gt;config/setup&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
If you want to install yambo on your local machine or just for testing/tutorial purposes, you can start with the configure options suggested here:&lt;br /&gt;
&lt;br /&gt;
 --enable-mpi              # already enabled by default&lt;br /&gt;
 --enable-open-mp&lt;br /&gt;
&lt;br /&gt;
to enable MPI and OpenMP parallelizarion;&lt;br /&gt;
&lt;br /&gt;
 --enable-time-profile&lt;br /&gt;
 --enable-memory-profile&lt;br /&gt;
&lt;br /&gt;
to enable time and memory profiling (very useful for benchmarking and debugging);&lt;br /&gt;
&lt;br /&gt;
 --enable-par-linalg&lt;br /&gt;
 --enable-slepc-linalg&lt;br /&gt;
&lt;br /&gt;
to enable rispectively the support to the parallel (with ScaLAPACK) linear algebra and the suport for the diagonalization of BSE using SLEPc library;&lt;br /&gt;
&lt;br /&gt;
 --enable-cuda=&amp;lt;opts&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to enable CUDA-Fortran support, where &amp;lt;code&amp;gt;&amp;lt;opts&amp;gt;&amp;lt;/code&amp;gt; are the CUDA version and the compute capability of the NVidia device (e.g. &amp;lt;code&amp;gt;cuda11.0,cc70&amp;lt;/code&amp;gt;). Please consider this last option only if you are sure that your machine have a GPU CUDA-capable.&lt;br /&gt;
&lt;br /&gt;
==== About external libraries ====&lt;br /&gt;
&lt;br /&gt;
Usually in HPC systems you can find already installed the library needed by Yambo. So you can use them through the specific configure options. Here below some examples.&lt;br /&gt;
&lt;br /&gt;
In order to link to a specific installation of a library you can use the relative configure option and specify the path:&lt;br /&gt;
&lt;br /&gt;
 --with-hdf5-path=&amp;lt;/path/to/hdf5&amp;gt;&lt;br /&gt;
 --with-netcdf-path=&amp;lt;/path/to/netcdf-c&amp;gt;&lt;br /&gt;
 --with-netcdff-path=&amp;lt;/path/to/netcdf-fortran&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here and example on how to use an installation of the Intel MKL libraries for the linear algebra and the Fourier transformations:&lt;br /&gt;
&lt;br /&gt;
 --with-blas-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl&amp;quot; \&lt;br /&gt;
 --with-lapack-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl&amp;quot; \&lt;br /&gt;
 --with-scalapack-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64&amp;quot; \&lt;br /&gt;
 --with-blacs-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_blacs_intelmpi_lp64&amp;quot; \&lt;br /&gt;
 --with-fft-includedir=&amp;quot;${MKLROOT}/include&amp;quot; \&lt;br /&gt;
 --with-fft-libs=&amp;quot;-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== About environment variables ====&lt;br /&gt;
&lt;br /&gt;
Using specific environment variables it is also possible to tell the configuration script the name of the compiler or of the MPI wrapper or other compilation options. Here some examples in case you are using the NVHPC compilers suite:&lt;br /&gt;
&lt;br /&gt;
 ./configure CC=nvc FC=nvfortran FPP=&amp;quot;nvfortran -Mpreprocess -E&amp;quot; MPIFC=mpif90 ...&lt;br /&gt;
&lt;br /&gt;
==== Specific Configuration options ====&lt;br /&gt;
&lt;br /&gt;
Here is a list of specific configuration options.&lt;br /&gt;
&lt;br /&gt;
 * [[configure-5.0|Configure options for yambo 5.0]] &lt;br /&gt;
 * [[configure-4.4.0|Configure options for Yambo 4.4.0]]&lt;br /&gt;
 * [[configure options for Yambo v4|Configure options for Yambo v4 and v3]]&lt;br /&gt;
&lt;br /&gt;
=== Further informations ===&lt;br /&gt;
&lt;br /&gt;
* [[Install Yambo in IRENE machine (TGCC Joliot Curie)]]&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint]]&lt;br /&gt;
* [[Machine specific configure scripts]]&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint with Intel compiler]]&lt;br /&gt;
* [[Install Yambo with external HDF5 and NetCDF libraries]]&lt;br /&gt;
* [[Install Yambo on Ubuntu/LinuxMint with NVfortran compiler]]&lt;br /&gt;
* [[Compile the libraries in Yambo independently]]&lt;br /&gt;
&lt;br /&gt;
=== Known Issues ===&lt;br /&gt;
* &#039;&#039;&#039;[https://gcc.gnu.org/wiki/GFortran gfortran] 4.4 or earlier versions&#039;&#039;&#039;&amp;lt;br&amp;gt;Yambo 5.x uses different Fortran constructs, as for example &amp;quot;allocate(x, source=y)&amp;quot;, that are not supported by gfortran 4.4 and its earlier versions, please update your gfortran or use a different compiler.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;NetCDF/HDF5 in Ubuntu 20.4&#039;&#039;&#039;&amp;lt;br&amp;gt;Internal NetCDF and HDF5 libraries in LinuxMint 20.1/Ubuntu 20.4 have problems with Yambo  please use internal Yambo libraries&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quantum-Espresso at GAMMA point&#039;&#039;&#039;&amp;lt;br&amp;gt;  In Quantum-Espresso if you perform a SCF calculation using the option &amp;quot;KPOINTS gamma&amp;quot;   you should use the same option for the NSCF otherwise Yambo gets confused with the g-vectors. If you need more k-points in the NSCF just re-run the SCF with &amp;quot;KPOINTS automatic /1 1 1 0 0 0&amp;quot;     and the run NSCF with a finite k-grid&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Internal MAC-OSX libraries&#039;&#039;&#039;&amp;lt;br&amp;gt;  At present it is no possible to compile Yambo with internal macos libraries  Indeed, no include/system/netcdf.mod file is present in the system.    The problem is due to  Autoconf setting which automatically searches for versions     of the needed libraries in your system despite the specific options given to configure.    Then, it would compile the internal hdf5, then find an external netcdf,    then try to compile netcdf-fortran creating various conflicts. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;gfortran compiler on MAC-OSX&#039;&#039;&#039;&amp;lt;br&amp;gt; There are different problems compiling Yambo with &amp;quot;gfortran&amp;quot;  variant of the compiler/libraries with MacPorts,    a possible solution it is to install the &amp;quot;gcc8&amp;quot; variant of these libraries and compilters. &amp;lt;br&amp;gt;More details here: [http://www.yambo-code.org/forum/viewtopic.php?t=1767 http://www.yambo-code.org/forum/viewtopic.php?t=1767]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Input file generation on MacOSX&#039;&#039;&#039;&amp;lt;br&amp;gt; There are two issues on input file generation: 1) when you generate an input file on MacOSX Yambo is not able to read values already present in the input file, and reset them to the default value; 2) if yambo and ypp have the same option to generate an input file the code get confused. Please use long input strings, for example &amp;quot;yambo -optics&amp;quot; instead of &amp;quot;yambo -o&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Nicolaspallanzani</name></author>
	</entry>
</feed>