<?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=Daniele</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=Daniele"/>
	<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Special:Contributions/Daniele"/>
	<updated>2026-04-11T09:14:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8806</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=8806"/>
		<updated>2025-05-26T07:03:22Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 5 - Friday, 23 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;
&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;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:30 Linear response&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Introduction to Yambopy&#039;&#039;&#039;&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 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;11:30 - 12:30 | 14:30 - 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_Modena2025.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ tar -xvf MoS2_2Dquasiparticle_tutorial_Modena2025.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_2Dquasiparticle_tutorial_Modena2025&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;
&#039;&#039;&#039;17:00 - 18: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;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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, [https://drive.google.com/file/d/1SR9BtFKgz6Y1gaHSKF1s8xzb42D5C1Xg/view?usp=share_link 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, [https://drive.google.com/file/d/1XBa5RgmwKdYSy4mj_COXwbUQd3DPgRe4/view?usp=share_link 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, [https://drive.google.com/file/d/1QC9YBmLIFkIQ-GA_YuC43qTtytCckGAj/view?usp=share_link Real Time Spectroscopy]&lt;br /&gt;
* F. Paleari, [https://drive.google.com/file/d/1LodCoVF9N-11GCSTs-uPfdCzJ86WDX5E/view?usp=share_link 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, [https://drive.google.com/file/d/1bZF0f3AD-WL3M3vCtvrnA_1W94SKt-Gf/view?usp=sharing Non-linear spectroscopy in Yambo]&lt;br /&gt;
* F. Affinito, [https://drive.google.com/file/d/103SIfHmvCFmT3QIOs6BWxm96H3J0fDrM/view?usp=share_link Frontiers in High-Performance Computing]&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
*N. Spallanzani [https://drive.google.com/file/d/1_fVJa7lkUr5FyrAxiPwrb5EVZRi7DdxR/view?usp=share_link Yambo in HPC environment]&lt;br /&gt;
*A. Marini, [https://drive.google.com/file/d/1-X5MABoNH9-KSHso92Y0gmEkNW99Kjdp/view?usp=share_link Electron-Phonon interaction]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8805</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=8805"/>
		<updated>2025-05-26T06:53:55Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* Lectures */&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;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:30 Linear response&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Introduction to Yambopy&#039;&#039;&#039;&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 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;11:30 - 12:30 | 14:30 - 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_Modena2025.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ tar -xvf MoS2_2Dquasiparticle_tutorial_Modena2025.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_2Dquasiparticle_tutorial_Modena2025&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;
&#039;&#039;&#039;17:00 - 18: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;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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, [https://drive.google.com/file/d/1SR9BtFKgz6Y1gaHSKF1s8xzb42D5C1Xg/view?usp=share_link 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, [https://drive.google.com/file/d/1XBa5RgmwKdYSy4mj_COXwbUQd3DPgRe4/view?usp=share_link 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, [https://drive.google.com/file/d/1QC9YBmLIFkIQ-GA_YuC43qTtytCckGAj/view?usp=share_link Real Time Spectroscopy]&lt;br /&gt;
* F. Paleari, [https://drive.google.com/file/d/1LodCoVF9N-11GCSTs-uPfdCzJ86WDX5E/view?usp=share_link 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, [https://drive.google.com/file/d/1bZF0f3AD-WL3M3vCtvrnA_1W94SKt-Gf/view?usp=sharing Non-linear spectroscopy in Yambo]&lt;br /&gt;
* F. Affinito, [https://drive.google.com/file/d/103SIfHmvCFmT3QIOs6BWxm96H3J0fDrM/view?usp=share_link Frontiers in High-Performance Computing]&lt;br /&gt;
&lt;br /&gt;
=== DAY 5 - Friday, 23 May ===&lt;br /&gt;
&lt;br /&gt;
*A. Marini, [https://drive.google.com/file/d/1-X5MABoNH9-KSHso92Y0gmEkNW99Kjdp/view?usp=share_link Electron-Phonon interaction]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8800</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=8800"/>
		<updated>2025-05-22T06:40:30Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 4 - Thursday, 22 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;
&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;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:30 Linear response&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Introduction to Yambopy&#039;&#039;&#039;&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 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;11:30 - 12:30 | 14:30 - 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_Modena2025.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ tar -xvf MoS2_2Dquasiparticle_tutorial_Modena2025.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_2Dquasiparticle_tutorial_Modena2025&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;
&#039;&#039;&#039;17:00 - 18: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;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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, [https://drive.google.com/file/d/1SR9BtFKgz6Y1gaHSKF1s8xzb42D5C1Xg/view?usp=share_link 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, [https://drive.google.com/file/d/1XBa5RgmwKdYSy4mj_COXwbUQd3DPgRe4/view?usp=share_link 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, [https://drive.google.com/file/d/1QC9YBmLIFkIQ-GA_YuC43qTtytCckGAj/view?usp=share_link Real Time Spectroscopy]&lt;br /&gt;
* F. Paleari, [https://drive.google.com/file/d/1LodCoVF9N-11GCSTs-uPfdCzJ86WDX5E/view?usp=share_link 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, [https://drive.google.com/file/d/1bZF0f3AD-WL3M3vCtvrnA_1W94SKt-Gf/view?usp=sharing Non-linear spectroscopy in Yambo]&lt;br /&gt;
* F. Affinito, [https://drive.google.com/file/d/103SIfHmvCFmT3QIOs6BWxm96H3J0fDrM/view?usp=share_link Frontiers in High-Performance Computing]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8790</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=8790"/>
		<updated>2025-05-20T15:55:07Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 3 - Wednesday, 21 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;
&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;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:30 Linear response&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Introduction to Yambopy&#039;&#039;&#039;&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 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;11:30 - 12:30 | 14:30 - 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_Modena2025.tar.gz&lt;br /&gt;
 $ tar -xvf hBN.tar.gz&lt;br /&gt;
 $ tar -xvf MoS2_2Dquasiparticle_tutorial_Modena2025.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_2Dquasiparticle_tutorial_Modena2025&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;
&#039;&#039;&#039;17:00 - 18: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;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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, [https://drive.google.com/file/d/1SR9BtFKgz6Y1gaHSKF1s8xzb42D5C1Xg/view?usp=share_link 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, [https://drive.google.com/file/d/1XBa5RgmwKdYSy4mj_COXwbUQd3DPgRe4/view?usp=share_link 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, [https://drive.google.com/file/d/1LodCoVF9N-11GCSTs-uPfdCzJ86WDX5E/view?usp=share_link 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, [https://drive.google.com/file/d/1bZF0f3AD-WL3M3vCtvrnA_1W94SKt-Gf/view?usp=sharing Non-linear spectroscopy in Yambo]&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8785</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=8785"/>
		<updated>2025-05-20T12:19:26Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:30 Linear response&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[Next steps: RPA calculations (standalone)|Next steps: RPA calculations ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;17:00 - 18:30 Introduction to Yambopy&#039;&#039;&#039;&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 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;11:30 - 12:30 | 14:30 - 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;
&#039;&#039;&#039;17:00 - 18: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;
=== DAY 4 - Thursday, May 22 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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, [https://drive.google.com/file/d/1SR9BtFKgz6Y1gaHSKF1s8xzb42D5C1Xg/view?usp=share_link 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, [https://drive.google.com/file/d/1XBa5RgmwKdYSy4mj_COXwbUQd3DPgRe4/view?usp=share_link 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, [https://drive.google.com/file/d/1bZF0f3AD-WL3M3vCtvrnA_1W94SKt-Gf/view?usp=sharing Non-linear spectroscopy in Yambo]&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8783</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=8783"/>
		<updated>2025-05-20T05:31:33Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 4 - Thursday, 22 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;
&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:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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, [https://drive.google.com/file/d/1SR9BtFKgz6Y1gaHSKF1s8xzb42D5C1Xg/view?usp=share_link 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, [https://drive.google.com/file/d/1bZF0f3AD-WL3M3vCtvrnA_1W94SKt-Gf/view?usp=sharing Non-linear spectroscopy in Yambo]&lt;br /&gt;
* F. Affinito, Frontiers in High-Performance Computing&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8782</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=8782"/>
		<updated>2025-05-20T05:30:50Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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, [https://drive.google.com/file/d/1SR9BtFKgz6Y1gaHSKF1s8xzb42D5C1Xg/view?usp=share_link 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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8781</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=8781"/>
		<updated>2025-05-20T05:30:31Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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, [https://drive.google.com/file/d/1SR9BtFKgz6Y1gaHSKF1s8xzb42D5C1Xg/view?usp=share_link ]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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8766</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=8766"/>
		<updated>2025-05-19T14:59:09Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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;
&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:30 - 16:00 Bethe-Salpeter (part 2)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 17:30 Nonlinear response 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;
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 download again the tutorial files, follow these steps (or see the above instructions):&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, [https://drive.google.com/file/d/1lbY6zF04WCcvZZhQy4TAIBca9wXHVmGG/view?usp=share_link 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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8743</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=8743"/>
		<updated>2025-05-19T10:05:10Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8742</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=8742"/>
		<updated>2025-05-19T10:04:39Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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  GWadvanced 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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8741</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=8741"/>
		<updated>2025-05-19T10:04:16Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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 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, [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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8740</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=8740"/>
		<updated>2025-05-19T10:00:45Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 3 - Wednesday, 21 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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,G. Sesti, [https://drive.google.com/file/d/1te_85k9jgSymr3Av86rKOu0-tA-7sGWq/view?usp=sharing  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, [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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8739</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=8739"/>
		<updated>2025-05-19T10:00:02Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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,G. Sesti, [https://drive.google.com/file/d/1te_85k9jgSymr3Av86rKOu0-tA-7sGWq/view?usp=sharing  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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8738</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=8738"/>
		<updated>2025-05-19T09:59:23Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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, [ Introduction to Many-Body Perturbation Theory]&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti, [https://drive.google.com/file/d/1te_85k9jgSymr3Av86rKOu0-tA-7sGWq/view?usp=sharing  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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8737</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=8737"/>
		<updated>2025-05-19T09:56:56Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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/1mBTcPrnfoqwcA5wXE8gXQMO_qttClHAd/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,G. Sesti, [https://drive.google.com/file/d/1te_85k9jgSymr3Av86rKOu0-tA-7sGWq/view?usp=sharing  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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8736</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=8736"/>
		<updated>2025-05-19T09:55:58Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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, Introduction to Many-Body Perturbation Theory&lt;br /&gt;
* C. Cardoso, Quasiparticles and the GW Approximation&lt;br /&gt;
* A. Guandalini,G. Sesti, [https://drive.google.com/file/d/1te_85k9jgSymr3Av86rKOu0-tA-7sGWq/view?usp=sharing  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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8735</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=8735"/>
		<updated>2025-05-19T09:54:42Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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, [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, [https://drive.google.com/file/d/1te_85k9jgSymr3Av86rKOu0-tA-7sGWq/view?usp=sharing  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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8734</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=8734"/>
		<updated>2025-05-19T09:53:55Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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, [ 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, [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, [https://drive.google.com/file/d/1te_85k9jgSymr3Av86rKOu0-tA-7sGWq/view?usp=sharing  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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8733</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=8733"/>
		<updated>2025-05-19T09:53:05Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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, [ 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, [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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8732</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=8732"/>
		<updated>2025-05-19T09:51:49Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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/1ITddkGTM12Gw5QxnZjAQpfZgYH0FvJL1/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, [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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8731</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=8731"/>
		<updated>2025-05-19T09:51:05Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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, [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, [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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8730</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=8730"/>
		<updated>2025-05-19T09:50:01Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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;
&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_TUTORIALSypp_nl -y ypypp_nl -y ypp_nl -y ypp_nl -y p_nl -y &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, [First principles and data-driven correlated materials]&lt;br /&gt;
* F. Mohamed, [https://drive.google.com/drive/u/0/folders/16dq5FyXn5rwqaBVNEKf2Bbr535WAfJAt 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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8602</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=8602"/>
		<updated>2025-05-12T08:40:53Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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 ...&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=tra23_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= m100_sys_test      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --qos=qos_test                  # qos = 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;nt&amp;gt;          # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;nt/2&amp;gt;      # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;nc&amp;gt;            # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary&lt;br /&gt;
 module load spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH&lt;br /&gt;
 &lt;br /&gt;
 export OMP_NUM_THREADS=&amp;lt;nc&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mpirun --rank-by core -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 M100 [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-SystemArchitecture architecture] and [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-Accounting accounting] systems. 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 &amp;lt;JOBID&amp;gt;&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 -u &amp;lt;username&amp;gt;&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
              &amp;lt;...&amp;gt;  m100_...      JOB username  R       0:01    &amp;lt;N&amp;gt; &amp;lt;...&amp;gt;&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 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):&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 01:00:00&lt;br /&gt;
 salloc: Granted job allocation 10164647&lt;br /&gt;
 salloc: Waiting for resource configuration&lt;br /&gt;
 salloc: Nodes r256n01 are ready for job&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; you can see that there is now a job running:&lt;br /&gt;
 $ squeue -u username&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           10164647 m100_usr_ interact username  R       0:02      1 r256n01&lt;br /&gt;
&lt;br /&gt;
To run the tutorial, &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; into the node specified by the job allocation and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to your scratch directory:&lt;br /&gt;
 username@&#039;&#039;&#039;login02&#039;&#039;&#039;$ ssh r256n01&lt;br /&gt;
 ...&lt;br /&gt;
 username@&#039;&#039;&#039;r256n01&#039;&#039;&#039;$ cd $CINECA_SCRATCH&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. Please note that the serial version of the code is in a different directory and does not need &amp;lt;code&amp;gt;spectrum_mpi&amp;lt;/code&amp;gt;:&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;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 (as in the &amp;lt;code&amp;gt;--cpus-per-task&amp;lt;/code&amp;gt; option):&lt;br /&gt;
 $ export OMP_NUM_THREADS=4&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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_MacOS_(ARM)&amp;diff=8593</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=8593"/>
		<updated>2025-05-01T14:19:43Z</updated>

		<summary type="html">&lt;p&gt;Daniele: &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;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Version 7.0.0 of libxc is currently not supported. It is recommended to either install version 6.2.2 by using an older package formula, or omit the &#039;&#039;--with-libxc-path&#039;&#039; option during configuration, allowing Yambo to compile libxc automatically.&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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_MacOS_(ARM)&amp;diff=8592</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=8592"/>
		<updated>2025-05-01T14:17:48Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* Preparing of the development environment */&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;
Note that ta moment version 7.0.0 of libxc is not supported. So it is suggested to install version 6.2.2 by downloading the old formula of the package or avoid indicating the  --with-libxc-path=$OPT/libxc command in the&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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_on_MacOS_(ARM)&amp;diff=8591</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=8591"/>
		<updated>2025-05-01T14:17:12Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* Preparing of the development environment */&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;
Note that ta moment version 7.0.0 of libxc is not supported. So it is suggested to install version 6.2.2 by downloading the old formula of the package or avoid indicating&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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8589</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=8589"/>
		<updated>2025-04-29T09:17:03Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 4 - Thursday, 22 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 [].&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=tra23_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= m100_sys_test      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --qos=qos_test                  # qos = 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;nt&amp;gt;          # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;nt/2&amp;gt;      # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;nc&amp;gt;            # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary&lt;br /&gt;
 module load spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH&lt;br /&gt;
 &lt;br /&gt;
 export OMP_NUM_THREADS=&amp;lt;nc&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mpirun --rank-by core -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 M100 [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-SystemArchitecture architecture] and [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-Accounting accounting] systems. 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 &amp;lt;JOBID&amp;gt;&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 -u &amp;lt;username&amp;gt;&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
              &amp;lt;...&amp;gt;  m100_...      JOB username  R       0:01    &amp;lt;N&amp;gt; &amp;lt;...&amp;gt;&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 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):&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 01:00:00&lt;br /&gt;
 salloc: Granted job allocation 10164647&lt;br /&gt;
 salloc: Waiting for resource configuration&lt;br /&gt;
 salloc: Nodes r256n01 are ready for job&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; you can see that there is now a job running:&lt;br /&gt;
 $ squeue -u username&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           10164647 m100_usr_ interact username  R       0:02      1 r256n01&lt;br /&gt;
&lt;br /&gt;
To run the tutorial, &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; into the node specified by the job allocation and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to your scratch directory:&lt;br /&gt;
 username@&#039;&#039;&#039;login02&#039;&#039;&#039;$ ssh r256n01&lt;br /&gt;
 ...&lt;br /&gt;
 username@&#039;&#039;&#039;r256n01&#039;&#039;&#039;$ cd $CINECA_SCRATCH&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. Please note that the serial version of the code is in a different directory and does not need &amp;lt;code&amp;gt;spectrum_mpi&amp;lt;/code&amp;gt;:&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;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 (as in the &amp;lt;code&amp;gt;--cpus-per-task&amp;lt;/code&amp;gt; option):&lt;br /&gt;
 $ export OMP_NUM_THREADS=4&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 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;
* [[Linear response 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, [TBD]&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>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8588</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=8588"/>
		<updated>2025-04-29T09:16:05Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 3 - Wednesday, 21 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 [].&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=tra23_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= m100_sys_test      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --qos=qos_test                  # qos = 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;nt&amp;gt;          # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;nt/2&amp;gt;      # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;nc&amp;gt;            # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary&lt;br /&gt;
 module load spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH&lt;br /&gt;
 &lt;br /&gt;
 export OMP_NUM_THREADS=&amp;lt;nc&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mpirun --rank-by core -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 M100 [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-SystemArchitecture architecture] and [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-Accounting accounting] systems. 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 &amp;lt;JOBID&amp;gt;&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 -u &amp;lt;username&amp;gt;&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
              &amp;lt;...&amp;gt;  m100_...      JOB username  R       0:01    &amp;lt;N&amp;gt; &amp;lt;...&amp;gt;&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 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):&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 01:00:00&lt;br /&gt;
 salloc: Granted job allocation 10164647&lt;br /&gt;
 salloc: Waiting for resource configuration&lt;br /&gt;
 salloc: Nodes r256n01 are ready for job&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; you can see that there is now a job running:&lt;br /&gt;
 $ squeue -u username&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           10164647 m100_usr_ interact username  R       0:02      1 r256n01&lt;br /&gt;
&lt;br /&gt;
To run the tutorial, &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; into the node specified by the job allocation and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to your scratch directory:&lt;br /&gt;
 username@&#039;&#039;&#039;login02&#039;&#039;&#039;$ ssh r256n01&lt;br /&gt;
 ...&lt;br /&gt;
 username@&#039;&#039;&#039;r256n01&#039;&#039;&#039;$ cd $CINECA_SCRATCH&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. Please note that the serial version of the code is in a different directory and does not need &amp;lt;code&amp;gt;spectrum_mpi&amp;lt;/code&amp;gt;:&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;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 (as in the &amp;lt;code&amp;gt;--cpus-per-task&amp;lt;/code&amp;gt; option):&lt;br /&gt;
 $ export OMP_NUM_THREADS=4&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 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;
* [[Linear response 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, [TBD]&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;
* S. Mor, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_mor.pdf Time resolved spectroscopy: an  experimental overview]&lt;br /&gt;
* M. Grüning, [https://media.yambo-code.eu/educational/Schools/ROME2023/myrta_Nonlinear_Yschool.pdf Nonlinear optics within Many-Body Perturbation Theory]&lt;br /&gt;
* N. Tancogne-Dejean, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_NicolasTancogne-Dejean.pdf Theory and simulation of High Harmonics Generation]&lt;br /&gt;
* Y. Pavlyukh, [https://media.yambo-code.eu/educational/Schools/ROME2023/yaroslav_Coherent_eph_dynamicsMS.pdf Coherent electron-phonon dynamics within a time-linear GKBA scheme]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8587</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=8587"/>
		<updated>2025-04-29T09:15:05Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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 [].&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=tra23_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= m100_sys_test      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --qos=qos_test                  # qos = 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;nt&amp;gt;          # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;nt/2&amp;gt;      # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;nc&amp;gt;            # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary&lt;br /&gt;
 module load spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH&lt;br /&gt;
 &lt;br /&gt;
 export OMP_NUM_THREADS=&amp;lt;nc&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mpirun --rank-by core -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 M100 [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-SystemArchitecture architecture] and [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-Accounting accounting] systems. 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 &amp;lt;JOBID&amp;gt;&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 -u &amp;lt;username&amp;gt;&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
              &amp;lt;...&amp;gt;  m100_...      JOB username  R       0:01    &amp;lt;N&amp;gt; &amp;lt;...&amp;gt;&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 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):&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 01:00:00&lt;br /&gt;
 salloc: Granted job allocation 10164647&lt;br /&gt;
 salloc: Waiting for resource configuration&lt;br /&gt;
 salloc: Nodes r256n01 are ready for job&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; you can see that there is now a job running:&lt;br /&gt;
 $ squeue -u username&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           10164647 m100_usr_ interact username  R       0:02      1 r256n01&lt;br /&gt;
&lt;br /&gt;
To run the tutorial, &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; into the node specified by the job allocation and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to your scratch directory:&lt;br /&gt;
 username@&#039;&#039;&#039;login02&#039;&#039;&#039;$ ssh r256n01&lt;br /&gt;
 ...&lt;br /&gt;
 username@&#039;&#039;&#039;r256n01&#039;&#039;&#039;$ cd $CINECA_SCRATCH&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. Please note that the serial version of the code is in a different directory and does not need &amp;lt;code&amp;gt;spectrum_mpi&amp;lt;/code&amp;gt;:&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;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 (as in the &amp;lt;code&amp;gt;--cpus-per-task&amp;lt;/code&amp;gt; option):&lt;br /&gt;
 $ export OMP_NUM_THREADS=4&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 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;
* [[Linear response 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, [TBD]&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;
* A. Molina-Sánchez, [https://media.yambo-code.eu/educational/Schools/ROME2023/yambo-talk-alejandro.pdf Modelling excitons: from 2D materials to Pump and Probe experiments]&lt;br /&gt;
* M. Palummo, [https://media.yambo-code.eu/educational/Schools/ROME2023/Palummo_YSCHOOL2023.pdf The Bethe-Salpeter equation: derivations and main physical concepts]&lt;br /&gt;
* F. Paleari, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yambo2023_FulvioPaleari.pdf Real time approach to the Bethe-Salpeter equation]&lt;br /&gt;
* D. Sangalli, [https://www.yambo-code.eu/wiki/index.php/File:RealTime_Propagation_Lecture.pdf TD-HSEX and real-time dynamics]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* S. Mor, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_mor.pdf Time resolved spectroscopy: an  experimental overview]&lt;br /&gt;
* M. Grüning, [https://media.yambo-code.eu/educational/Schools/ROME2023/myrta_Nonlinear_Yschool.pdf Nonlinear optics within Many-Body Perturbation Theory]&lt;br /&gt;
* N. Tancogne-Dejean, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_NicolasTancogne-Dejean.pdf Theory and simulation of High Harmonics Generation]&lt;br /&gt;
* Y. Pavlyukh, [https://media.yambo-code.eu/educational/Schools/ROME2023/yaroslav_Coherent_eph_dynamicsMS.pdf Coherent electron-phonon dynamics within a time-linear GKBA scheme]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8586</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=8586"/>
		<updated>2025-04-29T09:14:50Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* DAY 2 - Tuesday, 20 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 [].&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=tra23_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= m100_sys_test      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --qos=qos_test                  # qos = 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;nt&amp;gt;          # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;nt/2&amp;gt;      # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;nc&amp;gt;            # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary&lt;br /&gt;
 module load spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH&lt;br /&gt;
 &lt;br /&gt;
 export OMP_NUM_THREADS=&amp;lt;nc&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mpirun --rank-by core -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 M100 [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-SystemArchitecture architecture] and [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-Accounting accounting] systems. 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 &amp;lt;JOBID&amp;gt;&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 -u &amp;lt;username&amp;gt;&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
              &amp;lt;...&amp;gt;  m100_...      JOB username  R       0:01    &amp;lt;N&amp;gt; &amp;lt;...&amp;gt;&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 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):&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 01:00:00&lt;br /&gt;
 salloc: Granted job allocation 10164647&lt;br /&gt;
 salloc: Waiting for resource configuration&lt;br /&gt;
 salloc: Nodes r256n01 are ready for job&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; you can see that there is now a job running:&lt;br /&gt;
 $ squeue -u username&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           10164647 m100_usr_ interact username  R       0:02      1 r256n01&lt;br /&gt;
&lt;br /&gt;
To run the tutorial, &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; into the node specified by the job allocation and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to your scratch directory:&lt;br /&gt;
 username@&#039;&#039;&#039;login02&#039;&#039;&#039;$ ssh r256n01&lt;br /&gt;
 ...&lt;br /&gt;
 username@&#039;&#039;&#039;r256n01&#039;&#039;&#039;$ cd $CINECA_SCRATCH&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. Please note that the serial version of the code is in a different directory and does not need &amp;lt;code&amp;gt;spectrum_mpi&amp;lt;/code&amp;gt;:&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;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 (as in the &amp;lt;code&amp;gt;--cpus-per-task&amp;lt;/code&amp;gt; option):&lt;br /&gt;
 $ export OMP_NUM_THREADS=4&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 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;
* [[Linear response 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, [TBD]&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;
* A. Molina-Sánchez, [https://media.yambo-code.eu/educational/Schools/ROME2023/yambo-talk-alejandro.pdf Modelling excitons: from 2D materials to Pump and Probe experiments]&lt;br /&gt;
* M. Palummo, [https://media.yambo-code.eu/educational/Schools/ROME2023/Palummo_YSCHOOL2023.pdf The Bethe-Salpeter equation: derivations and main physical concepts]&lt;br /&gt;
* F. Paleari, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yambo2023_FulvioPaleari.pdf Real time approach to the Bethe-Salpeter equation]&lt;br /&gt;
* D. Sangalli, [https://www.yambo-code.eu/wiki/index.php/File:RealTime_Propagation_Lecture.pdf TD-HSEX and real-time dynamics]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* S. Mor, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_mor.pdf Time resolved spectroscopy: an  experimental overview]&lt;br /&gt;
* M. Grüning, [https://media.yambo-code.eu/educational/Schools/ROME2023/myrta_Nonlinear_Yschool.pdf Nonlinear optics within Many-Body Perturbation Theory]&lt;br /&gt;
* N. Tancogne-Dejean, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_NicolasTancogne-Dejean.pdf Theory and simulation of High Harmonics Generation]&lt;br /&gt;
* Y. Pavlyukh, [https://media.yambo-code.eu/educational/Schools/ROME2023/yaroslav_Coherent_eph_dynamicsMS.pdf Coherent electron-phonon dynamics within a time-linear GKBA scheme]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8585</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=8585"/>
		<updated>2025-04-29T09:13:26Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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 [].&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=tra23_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= m100_sys_test      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --qos=qos_test                  # qos = 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;nt&amp;gt;          # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;nt/2&amp;gt;      # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;nc&amp;gt;            # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary&lt;br /&gt;
 module load spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH&lt;br /&gt;
 &lt;br /&gt;
 export OMP_NUM_THREADS=&amp;lt;nc&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mpirun --rank-by core -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 M100 [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-SystemArchitecture architecture] and [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-Accounting accounting] systems. 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 &amp;lt;JOBID&amp;gt;&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 -u &amp;lt;username&amp;gt;&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
              &amp;lt;...&amp;gt;  m100_...      JOB username  R       0:01    &amp;lt;N&amp;gt; &amp;lt;...&amp;gt;&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 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):&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 01:00:00&lt;br /&gt;
 salloc: Granted job allocation 10164647&lt;br /&gt;
 salloc: Waiting for resource configuration&lt;br /&gt;
 salloc: Nodes r256n01 are ready for job&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; you can see that there is now a job running:&lt;br /&gt;
 $ squeue -u username&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           10164647 m100_usr_ interact username  R       0:02      1 r256n01&lt;br /&gt;
&lt;br /&gt;
To run the tutorial, &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; into the node specified by the job allocation and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to your scratch directory:&lt;br /&gt;
 username@&#039;&#039;&#039;login02&#039;&#039;&#039;$ ssh r256n01&lt;br /&gt;
 ...&lt;br /&gt;
 username@&#039;&#039;&#039;r256n01&#039;&#039;&#039;$ cd $CINECA_SCRATCH&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. Please note that the serial version of the code is in a different directory and does not need &amp;lt;code&amp;gt;spectrum_mpi&amp;lt;/code&amp;gt;:&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;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 (as in the &amp;lt;code&amp;gt;--cpus-per-task&amp;lt;/code&amp;gt; option):&lt;br /&gt;
 $ export OMP_NUM_THREADS=4&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 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;
* [[Linear response 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, [TBD]&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;
* E. Perfetto, [https://media.yambo-code.eu/educational/Schools/ROME2023/Talk_Perfetto.pdf An overview on non-equilibrium Green Functions]&lt;br /&gt;
* R. Frisenda, [https://media.yambo-code.eu/educational/Schools/ROME2023/FRISENDA%20-%20ARPES%20spectroscopy,%20an%20experimental%20overview.pdf ARPES spectroscopy, an experimental overview]&lt;br /&gt;
* A. Marini, [https://media.yambo-code.eu/educational/Schools/ROME2023/GW_marini.pdf The Quasi Particle concept and the GW method]&lt;br /&gt;
* A. Guandalini, [https://media.yambo-code.eu/educational/Schools/ROME2023/alberto_guandalini.pdf The GW method: approximations and algorithms]&lt;br /&gt;
* D.A. Leon, C. Cardoso, [https://media.yambo-code.eu/educational/Schools/ROME2023/Cardoso_YamboSchool2023_Rome.pdf Frequency dependence in GW: origin, modelling and practical implementations]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Molina-Sánchez, [https://media.yambo-code.eu/educational/Schools/ROME2023/yambo-talk-alejandro.pdf Modelling excitons: from 2D materials to Pump and Probe experiments]&lt;br /&gt;
* M. Palummo, [https://media.yambo-code.eu/educational/Schools/ROME2023/Palummo_YSCHOOL2023.pdf The Bethe-Salpeter equation: derivations and main physical concepts]&lt;br /&gt;
* F. Paleari, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yambo2023_FulvioPaleari.pdf Real time approach to the Bethe-Salpeter equation]&lt;br /&gt;
* D. Sangalli, [https://www.yambo-code.eu/wiki/index.php/File:RealTime_Propagation_Lecture.pdf TD-HSEX and real-time dynamics]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* S. Mor, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_mor.pdf Time resolved spectroscopy: an  experimental overview]&lt;br /&gt;
* M. Grüning, [https://media.yambo-code.eu/educational/Schools/ROME2023/myrta_Nonlinear_Yschool.pdf Nonlinear optics within Many-Body Perturbation Theory]&lt;br /&gt;
* N. Tancogne-Dejean, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_NicolasTancogne-Dejean.pdf Theory and simulation of High Harmonics Generation]&lt;br /&gt;
* Y. Pavlyukh, [https://media.yambo-code.eu/educational/Schools/ROME2023/yaroslav_Coherent_eph_dynamicsMS.pdf Coherent electron-phonon dynamics within a time-linear GKBA scheme]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8584</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=8584"/>
		<updated>2025-04-29T09:12:39Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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 [].&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=tra23_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= m100_sys_test      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --qos=qos_test                  # qos = 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;nt&amp;gt;          # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;nt/2&amp;gt;      # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;nc&amp;gt;            # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary&lt;br /&gt;
 module load spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH&lt;br /&gt;
 &lt;br /&gt;
 export OMP_NUM_THREADS=&amp;lt;nc&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mpirun --rank-by core -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 M100 [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-SystemArchitecture architecture] and [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-Accounting accounting] systems. 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 &amp;lt;JOBID&amp;gt;&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 -u &amp;lt;username&amp;gt;&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
              &amp;lt;...&amp;gt;  m100_...      JOB username  R       0:01    &amp;lt;N&amp;gt; &amp;lt;...&amp;gt;&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 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):&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 01:00:00&lt;br /&gt;
 salloc: Granted job allocation 10164647&lt;br /&gt;
 salloc: Waiting for resource configuration&lt;br /&gt;
 salloc: Nodes r256n01 are ready for job&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; you can see that there is now a job running:&lt;br /&gt;
 $ squeue -u username&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           10164647 m100_usr_ interact username  R       0:02      1 r256n01&lt;br /&gt;
&lt;br /&gt;
To run the tutorial, &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; into the node specified by the job allocation and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to your scratch directory:&lt;br /&gt;
 username@&#039;&#039;&#039;login02&#039;&#039;&#039;$ ssh r256n01&lt;br /&gt;
 ...&lt;br /&gt;
 username@&#039;&#039;&#039;r256n01&#039;&#039;&#039;$ cd $CINECA_SCRATCH&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. Please note that the serial version of the code is in a different directory and does not need &amp;lt;code&amp;gt;spectrum_mpi&amp;lt;/code&amp;gt;:&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;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 (as in the &amp;lt;code&amp;gt;--cpus-per-task&amp;lt;/code&amp;gt; option):&lt;br /&gt;
 $ export OMP_NUM_THREADS=4&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 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;
* [[Linear response 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, [TBD]&lt;br /&gt;
* F. Mohamed, [A tour on Density Functional Theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Perfetto, [https://media.yambo-code.eu/educational/Schools/ROME2023/Talk_Perfetto.pdf An overview on non-equilibrium Green Functions]&lt;br /&gt;
* R. Frisenda, [https://media.yambo-code.eu/educational/Schools/ROME2023/FRISENDA%20-%20ARPES%20spectroscopy,%20an%20experimental%20overview.pdf ARPES spectroscopy, an experimental overview]&lt;br /&gt;
* A. Marini, [https://media.yambo-code.eu/educational/Schools/ROME2023/GW_marini.pdf The Quasi Particle concept and the GW method]&lt;br /&gt;
* A. Guandalini, [https://media.yambo-code.eu/educational/Schools/ROME2023/alberto_guandalini.pdf The GW method: approximations and algorithms]&lt;br /&gt;
* D.A. Leon, C. Cardoso, [https://media.yambo-code.eu/educational/Schools/ROME2023/Cardoso_YamboSchool2023_Rome.pdf Frequency dependence in GW: origin, modelling and practical implementations]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Molina-Sánchez, [https://media.yambo-code.eu/educational/Schools/ROME2023/yambo-talk-alejandro.pdf Modelling excitons: from 2D materials to Pump and Probe experiments]&lt;br /&gt;
* M. Palummo, [https://media.yambo-code.eu/educational/Schools/ROME2023/Palummo_YSCHOOL2023.pdf The Bethe-Salpeter equation: derivations and main physical concepts]&lt;br /&gt;
* F. Paleari, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yambo2023_FulvioPaleari.pdf Real time approach to the Bethe-Salpeter equation]&lt;br /&gt;
* D. Sangalli, [https://www.yambo-code.eu/wiki/index.php/File:RealTime_Propagation_Lecture.pdf TD-HSEX and real-time dynamics]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* S. Mor, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_mor.pdf Time resolved spectroscopy: an  experimental overview]&lt;br /&gt;
* M. Grüning, [https://media.yambo-code.eu/educational/Schools/ROME2023/myrta_Nonlinear_Yschool.pdf Nonlinear optics within Many-Body Perturbation Theory]&lt;br /&gt;
* N. Tancogne-Dejean, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_NicolasTancogne-Dejean.pdf Theory and simulation of High Harmonics Generation]&lt;br /&gt;
* Y. Pavlyukh, [https://media.yambo-code.eu/educational/Schools/ROME2023/yaroslav_Coherent_eph_dynamicsMS.pdf Coherent electron-phonon dynamics within a time-linear GKBA scheme]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Modena_2025&amp;diff=8583</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=8583"/>
		<updated>2025-04-29T09:11:26Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* 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 [].&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=tra23_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= m100_sys_test      # Request a specific partition for the resource allocation&lt;br /&gt;
 #SBATCH --qos=qos_test                  # qos = 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;nt&amp;gt;          # Number of MPI tasks invoked per node&lt;br /&gt;
 #SBATCH --ntasks-per-socket=&amp;lt;nt/2&amp;gt;      # Tasks invoked on each socket&lt;br /&gt;
 #SBATCH --cpus-per-task=&amp;lt;nc&amp;gt;            # Number of OMP threads per task&lt;br /&gt;
 &lt;br /&gt;
 module purge&lt;br /&gt;
 module load hpc-sdk/2022--binary&lt;br /&gt;
 module load spectrum_mpi/10.4.0--binary&lt;br /&gt;
 export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH&lt;br /&gt;
 &lt;br /&gt;
 export OMP_NUM_THREADS=&amp;lt;nc&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 mpirun --rank-by core -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 M100 [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-SystemArchitecture architecture] and [https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+MARCONI100+UserGuide#UG3.2:MARCONI100UserGuide-Accounting accounting] systems. 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 &amp;lt;JOBID&amp;gt;&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 -u &amp;lt;username&amp;gt;&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
              &amp;lt;...&amp;gt;  m100_...      JOB username  R       0:01    &amp;lt;N&amp;gt; &amp;lt;...&amp;gt;&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 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):&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 01:00:00&lt;br /&gt;
 salloc: Granted job allocation 10164647&lt;br /&gt;
 salloc: Waiting for resource configuration&lt;br /&gt;
 salloc: Nodes r256n01 are ready for job&lt;br /&gt;
&lt;br /&gt;
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;squeue&amp;lt;/code&amp;gt; you can see that there is now a job running:&lt;br /&gt;
 $ squeue -u username&lt;br /&gt;
              JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)&lt;br /&gt;
           10164647 m100_usr_ interact username  R       0:02      1 r256n01&lt;br /&gt;
&lt;br /&gt;
To run the tutorial, &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; into the node specified by the job allocation and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to your scratch directory:&lt;br /&gt;
 username@&#039;&#039;&#039;login02&#039;&#039;&#039;$ ssh r256n01&lt;br /&gt;
 ...&lt;br /&gt;
 username@&#039;&#039;&#039;r256n01&#039;&#039;&#039;$ cd $CINECA_SCRATCH&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. Please note that the serial version of the code is in a different directory and does not need &amp;lt;code&amp;gt;spectrum_mpi&amp;lt;/code&amp;gt;:&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;
&lt;br /&gt;
Finally, set the &amp;lt;code&amp;gt;OMP_NUM_THREADS&amp;lt;/code&amp;gt; environment variable to 4 (as in the &amp;lt;code&amp;gt;--cpus-per-task&amp;lt;/code&amp;gt; option):&lt;br /&gt;
 $ export OMP_NUM_THREADS=4&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 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;
* [[Linear response 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;
* G. Stefanucci, [https://media.yambo-code.eu/educational/Schools/ROME2023/Stefanucci.pdf The Many-Body Problem: Key concepts of the Many-Body Perturbation Theory]&lt;br /&gt;
* M. Marsili, [https://media.yambo-code.eu/educational/Schools/ROME2023/marghe_linear_response.pdf Beyond the independent particle scheme: The linear response theory]&lt;br /&gt;
&lt;br /&gt;
=== DAY 2 - Tuesday, 20 May ===&lt;br /&gt;
&lt;br /&gt;
* E. Perfetto, [https://media.yambo-code.eu/educational/Schools/ROME2023/Talk_Perfetto.pdf An overview on non-equilibrium Green Functions]&lt;br /&gt;
* R. Frisenda, [https://media.yambo-code.eu/educational/Schools/ROME2023/FRISENDA%20-%20ARPES%20spectroscopy,%20an%20experimental%20overview.pdf ARPES spectroscopy, an experimental overview]&lt;br /&gt;
* A. Marini, [https://media.yambo-code.eu/educational/Schools/ROME2023/GW_marini.pdf The Quasi Particle concept and the GW method]&lt;br /&gt;
* A. Guandalini, [https://media.yambo-code.eu/educational/Schools/ROME2023/alberto_guandalini.pdf The GW method: approximations and algorithms]&lt;br /&gt;
* D.A. Leon, C. Cardoso, [https://media.yambo-code.eu/educational/Schools/ROME2023/Cardoso_YamboSchool2023_Rome.pdf Frequency dependence in GW: origin, modelling and practical implementations]&lt;br /&gt;
&lt;br /&gt;
=== DAY 3 - Wednesday, 21 May ===&lt;br /&gt;
&lt;br /&gt;
* A. Molina-Sánchez, [https://media.yambo-code.eu/educational/Schools/ROME2023/yambo-talk-alejandro.pdf Modelling excitons: from 2D materials to Pump and Probe experiments]&lt;br /&gt;
* M. Palummo, [https://media.yambo-code.eu/educational/Schools/ROME2023/Palummo_YSCHOOL2023.pdf The Bethe-Salpeter equation: derivations and main physical concepts]&lt;br /&gt;
* F. Paleari, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yambo2023_FulvioPaleari.pdf Real time approach to the Bethe-Salpeter equation]&lt;br /&gt;
* D. Sangalli, [https://www.yambo-code.eu/wiki/index.php/File:RealTime_Propagation_Lecture.pdf TD-HSEX and real-time dynamics]&lt;br /&gt;
&lt;br /&gt;
=== DAY 4 - Thursday, 22 May ===&lt;br /&gt;
&lt;br /&gt;
* S. Mor, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_mor.pdf Time resolved spectroscopy: an  experimental overview]&lt;br /&gt;
* M. Grüning, [https://media.yambo-code.eu/educational/Schools/ROME2023/myrta_Nonlinear_Yschool.pdf Nonlinear optics within Many-Body Perturbation Theory]&lt;br /&gt;
* N. Tancogne-Dejean, [https://media.yambo-code.eu/educational/Schools/ROME2023/Yamboschool2023_NicolasTancogne-Dejean.pdf Theory and simulation of High Harmonics Generation]&lt;br /&gt;
* Y. Pavlyukh, [https://media.yambo-code.eu/educational/Schools/ROME2023/yaroslav_Coherent_eph_dynamicsMS.pdf Coherent electron-phonon dynamics within a time-linear GKBA scheme]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_analyse_excitons&amp;diff=8553</id>
		<title>How to analyse excitons</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_analyse_excitons&amp;diff=8553"/>
		<updated>2025-03-30T09:30:19Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* Calculate the exciton oscillator strenght and amplitude */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial you will learn (for a 2D-hBN)  how to:&lt;br /&gt;
* analyze a BSE optical spectrum in terms of excitonic eigenvectors and eigenvalues&lt;br /&gt;
* look at the spatial distribution of the exciton&lt;br /&gt;
* For a similar tutorial focusing on 3D-hBN, go to [[How to analyse excitons - CECAM 2021 school|this page]].&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 [[How to treat low dimensional systems]] tutorial&lt;br /&gt;
&#039;&#039;&#039;You will need&#039;&#039;&#039;:&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; executable&lt;br /&gt;
* &amp;lt;code&amp;gt;gnuplot or xmgrace&amp;lt;/code&amp;gt; executable&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== YAMBO calculations ==&lt;br /&gt;
If you have completed the tutorials of 2D hBN you should have all the databases required to do this tutorial in your &amp;lt;code&amp;gt;YAMBO_TUTORIALS/hBN-2D/SAVE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2D_WR_WC&amp;lt;/code&amp;gt; (databases generated with RIM and cutoff) directories&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;
 $ ls ./2D_WR_WC&lt;br /&gt;
 ndb.BS_Q1_CPU_0	ndb.cutoff	ndb.dip_iR_and_P_fragment_1	ndb.pp_fragment_1 ...&lt;br /&gt;
&lt;br /&gt;
==Sort the excitonic eigenvalues==&lt;br /&gt;
&lt;br /&gt;
 $ ypp -J 2D_WR_WC -e s 1&lt;br /&gt;
&lt;br /&gt;
We are sorting the excitons for the q-index = 1 (optical limit q=0).&lt;br /&gt;
The new generated file &#039;&#039;o-2D_WR_WC.exc_qpt1_E_sorted &#039;&#039; (&#039;&#039;o-2D_WR_WC.exc_qpt1_I_sorted &#039;&#039;) reports &lt;br /&gt;
the energies of the excitons and their Dipole Oscillator Strengths sorted by energy  (Index).&lt;br /&gt;
[[File:strengh.png|none|x120px|]]&lt;br /&gt;
Open the first file and look inside. The first exciton is at 4.83 eV and the second one has the highest strength (normalized to 1)&lt;br /&gt;
&lt;br /&gt;
Or you can make a plot&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-2D_WR_WC.exc_qpt1_E_sorted&#039;  with points ls 2 title &#039;Strenghts&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:strenght.png|none|600px|]]&lt;br /&gt;
&lt;br /&gt;
Attention the convergence of these results with different k-points grids is mandatory!&lt;br /&gt;
&lt;br /&gt;
== Calculate the exciton oscillator strenght and amplitude ==&lt;br /&gt;
&lt;br /&gt;
We can now analyze the excitons in terms of single-particle states, to do that create the appropriate input &lt;br /&gt;
 $ ypp -F ypp_AMPL.in -J 2D_WR_WC -e a 1 &lt;br /&gt;
&lt;br /&gt;
Suppose you wish to analyze the first 5 excitons then change this line as:&lt;br /&gt;
 States= &amp;quot;1 - 5&amp;quot;              # Index of the BS state(s)&lt;br /&gt;
&lt;br /&gt;
Close the input and run ypp&lt;br /&gt;
&lt;br /&gt;
 $ ypp -F ypp_AMPL.in -J 2D_WR_WC&lt;br /&gt;
&lt;br /&gt;
 $ls  o*exc*at*&lt;br /&gt;
 o-2D_WR_WC.exc_qpt1_amplitude_at_1 o-2D_WR_WC.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-2D_WR_WC.exc_qpt1_weights_at_*&#039;&#039; report the Weights&lt;br /&gt;
[[File:Weights.png|none|x60px|]]&lt;br /&gt;
and &#039;&#039;o-2D_WR_WC.exc_qpt1_amplitude_**&#039;&#039; report the amplitudes &lt;br /&gt;
[[File:Ampl.png|none|x70px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file  &#039;&#039;o-2D_WR_WC.exc_weights_at_1&#039;&#039; &lt;br /&gt;
 #  Band_V     Band_C     K  ibz     Symm.      Weight     Energy&lt;br /&gt;
 #&lt;br /&gt;
  4.000000   5.000000   7.000000   2.000000   0.922095   4.401093&lt;br /&gt;
  4.000000   5.000000   7.000000   1.000000   0.922086   4.401093&lt;br /&gt;
&lt;br /&gt;
The first exciton is  essentially done of only single particle transitions from VBM to CBM at K (last k-point of the grid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: the transistion Energy reported in the weight file are Kohn-Sham energy difference and not Quasiparticle energies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Amplitude_plot.png|none|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Plot the exciton spatial distribution ==&lt;br /&gt;
&lt;br /&gt;
To see the spatial character of the exciton YPP writes the exciton spatial distribution, in other words the probability to find the electron somewhere in the space when the hole is fixed in a give position.&lt;br /&gt;
Different output formats can be selected and 1D,2D,3D plots done.&lt;br /&gt;
Create the input and change the size of the cell where to see the exciton.&lt;br /&gt;
Note that  If the k-grid of the BSE simulation is a NxNx1  the exciton has an induced fictitious periodicity every Nx Nx1 Cell  of the simulation.&lt;br /&gt;
For hBN-2D this is not a problem because the exciton is strongly localized but in other systems with  more delocalized excitons to look at the real exciton size it is necessary to use &lt;br /&gt;
very large k-grids in the BSE&lt;br /&gt;
 $ ypp -F ypp_WF.in -J 2D_WR_WC  -e w  1&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;12&amp;quot;               # [rlu] [1/2/3] for 1d or [12/13/23] for 2d [123] for 3D&lt;br /&gt;
 FFTGvecs=  3951        RL    # [FFT] Plane-waves&lt;br /&gt;
 States= &amp;quot;1 - 1&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.4     | 1.400     | 0.00     |        # [cc] Hole position in unit cell&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Close the input and run ypp&lt;br /&gt;
 $ ypp -F ypp_WF.in -J 2D_WR_WC &lt;br /&gt;
&lt;br /&gt;
 $ xcrysden --xsf o-2D_WR_WC.exc_2d_1.xsf&lt;br /&gt;
&lt;br /&gt;
[[File:exc_BN2D.png|none|400px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or alternatively &lt;br /&gt;
 $ xcrysden --sushi&lt;br /&gt;
 [[File:SUSHI.JPG|none|400px|]]&lt;br /&gt;
--&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 excitons, it is the possibility 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 corresponding input just 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. 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 to distinguishing charge-transfer exctions from Frenkel or Wannier ones, by looking the relative position of the electron/hole densities.&lt;br /&gt;
For example see the electron/hole average density calculated in a Metal Organic Framework (MOF) that contains azobenzene:&lt;br /&gt;
&lt;br /&gt;
[[File:Average electron hole.png|center |600px|Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
this figure is taken from  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;
== Interpolate exciton dispersion (only in Yambo 5.x)==&lt;br /&gt;
&lt;br /&gt;
Starting from Yambo 5.x it is possible to calculate excitons at finite momentum &#039;&#039;&#039;q&#039;&#039;&#039;. The momentum can be specified with the variable&lt;br /&gt;
 %BSEQptR&lt;br /&gt;
  iq_start | iq_end |                             # [BSK] Transferred momenta range&lt;br /&gt;
 %&lt;br /&gt;
where iq_start and iq_end is the first and last index of momentum in the irreducible Brillouin zone (IBZ). You can find the list of q-vectors in the r_setup report.&lt;br /&gt;
If you calculate the BSE for all q-points of the IBZ, then you can interpolate  exciton dispersion along any direction of the full Brillouin zone(BZ) using the&lt;br /&gt;
interpolation scheme of ref. &amp;lt;ref&amp;gt;Warren E. Pickett, Henry Krakauer, and Philip B. Allen  [https://journals.aps.org/prb/abstract/10.1103/PhysRevB.38.2721 PRB 38 p2721 (1988)]&amp;lt;/ref&amp;gt;, by doing:&lt;br /&gt;
&lt;br /&gt;
 ypp -e i &lt;br /&gt;
&lt;br /&gt;
and then setting:&lt;br /&gt;
&lt;br /&gt;
 excitons                         # [R] Excitonic properties&lt;br /&gt;
 interpolate                      # [R] Interpolate&lt;br /&gt;
 States= &amp;quot;1 - 4&amp;quot;                  # Index of the BS state(s)&lt;br /&gt;
 INTERP_mode= &amp;quot;BOLTZ&amp;quot;                # Interpolation mode (NN=nearest point, BOLTZ=boltztrap aproach)&lt;br /&gt;
 % INTERP_Grid&lt;br /&gt;
  -1 |-1 |-1 |                             # Interpolation BZ Grid &lt;br /&gt;
 %&lt;br /&gt;
 #PrtDOS                          # Print Exciton Density of States&lt;br /&gt;
 BANDS_steps= 100                 # Number of divisions&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 cooOut= &amp;quot;rlu&amp;quot;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 %BANDS_kpts                      # K points of the bands circuit&lt;br /&gt;
 0 | 0 | 0 |&lt;br /&gt;
 0.333333333333333 | 0.33333333333333 | 0 | &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
Running ypp, it will interpolate the first 4 excitons energies on 100 points along with the line Gamma-&amp;gt;K. If you plot the output file &amp;quot;o.excitons_interpolated&amp;quot;,&lt;br /&gt;
you can compare the interpolated results with the original points calculated in the BSE, that are available in the report &amp;quot;r_excitons_interpolate&amp;quot;, and you get something like:&lt;br /&gt;
&lt;br /&gt;
[[File:Excitons dispersion.png|center | Yambo exciton dispersion]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is also possible to interpolate excitons on a given regular grid by setting &amp;lt;code&amp;gt;INTERP_Grid&amp;lt;/code&amp;gt;, for example in the figure below we interpolate the dispersion of the lowest exciton in MoS&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; calculated on a 39x39x1 and interpolated in a 117x117x1 grid in all the Brillouin zone:&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2021-03-24 11-38-46.png|center| 700px|Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
Finally if you turn on the flag &amp;lt;code&amp;gt;PrtDOS&amp;lt;/code&amp;gt; the code calculate the excitonic density of states on the excitons interpolated on the regular grid given by  &amp;lt;code&amp;gt;INTERP_Grid&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_analyse_excitons&amp;diff=8552</id>
		<title>How to analyse excitons</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_analyse_excitons&amp;diff=8552"/>
		<updated>2025-03-30T09:30:02Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* Calculate the exciton oscillator strenght and amplitude */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial you will learn (for a 2D-hBN)  how to:&lt;br /&gt;
* analyze a BSE optical spectrum in terms of excitonic eigenvectors and eigenvalues&lt;br /&gt;
* look at the spatial distribution of the exciton&lt;br /&gt;
* For a similar tutorial focusing on 3D-hBN, go to [[How to analyse excitons - CECAM 2021 school|this page]].&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 [[How to treat low dimensional systems]] tutorial&lt;br /&gt;
&#039;&#039;&#039;You will need&#039;&#039;&#039;:&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; executable&lt;br /&gt;
* &amp;lt;code&amp;gt;gnuplot or xmgrace&amp;lt;/code&amp;gt; executable&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== YAMBO calculations ==&lt;br /&gt;
If you have completed the tutorials of 2D hBN you should have all the databases required to do this tutorial in your &amp;lt;code&amp;gt;YAMBO_TUTORIALS/hBN-2D/SAVE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2D_WR_WC&amp;lt;/code&amp;gt; (databases generated with RIM and cutoff) directories&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;
 $ ls ./2D_WR_WC&lt;br /&gt;
 ndb.BS_Q1_CPU_0	ndb.cutoff	ndb.dip_iR_and_P_fragment_1	ndb.pp_fragment_1 ...&lt;br /&gt;
&lt;br /&gt;
==Sort the excitonic eigenvalues==&lt;br /&gt;
&lt;br /&gt;
 $ ypp -J 2D_WR_WC -e s 1&lt;br /&gt;
&lt;br /&gt;
We are sorting the excitons for the q-index = 1 (optical limit q=0).&lt;br /&gt;
The new generated file &#039;&#039;o-2D_WR_WC.exc_qpt1_E_sorted &#039;&#039; (&#039;&#039;o-2D_WR_WC.exc_qpt1_I_sorted &#039;&#039;) reports &lt;br /&gt;
the energies of the excitons and their Dipole Oscillator Strengths sorted by energy  (Index).&lt;br /&gt;
[[File:strengh.png|none|x120px|]]&lt;br /&gt;
Open the first file and look inside. The first exciton is at 4.83 eV and the second one has the highest strength (normalized to 1)&lt;br /&gt;
&lt;br /&gt;
Or you can make a plot&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-2D_WR_WC.exc_qpt1_E_sorted&#039;  with points ls 2 title &#039;Strenghts&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:strenght.png|none|600px|]]&lt;br /&gt;
&lt;br /&gt;
Attention the convergence of these results with different k-points grids is mandatory!&lt;br /&gt;
&lt;br /&gt;
== Calculate the exciton oscillator strenght and amplitude ==&lt;br /&gt;
&lt;br /&gt;
We can now analyze the excitons in terms of single-particle states, to do that create the appropriate input &lt;br /&gt;
 $ ypp -F ypp_AMPL.in -J 2D_WR_WC -e a 1 &lt;br /&gt;
&lt;br /&gt;
Suppose you wish to analyze the first 5 excitons then change this line as:&lt;br /&gt;
 States= &amp;quot;1 - 5&amp;quot;              # Index of the BS state(s)&lt;br /&gt;
&lt;br /&gt;
Close the input and run ypp&lt;br /&gt;
&lt;br /&gt;
 $ ypp -F ypp_AMPL.in -J 2D_WR_WC&lt;br /&gt;
&lt;br /&gt;
 $ls  o*exc*at*&lt;br /&gt;
 o-2D_WR_WC.exc_qpt1_amplitude_at_1 o-2D_WR_WC.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-2D_WR_WC.exc_qpt1_weights_at_*&#039;&#039; report the Weights&lt;br /&gt;
[[File:Weights.png|none|x60px|]]&lt;br /&gt;
and &#039;&#039;o-2D_WR_WC.exc_qpt1_amplitude_**&#039;&#039; report the amplitudes &lt;br /&gt;
[[File:Ampl.png|none|x70px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file  &#039;&#039;o-2D_WR_WC.exc_weights_at_1&#039;&#039; &lt;br /&gt;
 #  Band_V     Band_C     K  ibz     Symm.      Weight     Energy&lt;br /&gt;
 #&lt;br /&gt;
  4.000000   5.000000   7.000000   2.000000   0.922095   4.401093&lt;br /&gt;
  4.000000   5.000000   7.000000   1.000000   0.922086   4.401093&lt;br /&gt;
&lt;br /&gt;
The first exciton is  essentially done of only single particle transitions from VBM to CBM at K (last k-point of the grid).&lt;br /&gt;
&#039;&#039;&#039;Note: the transistion Energy reported in the weight file are Kohn-Sham energy difference and not Quasiparticle energies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Amplitude_plot.png|none|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Plot the exciton spatial distribution ==&lt;br /&gt;
&lt;br /&gt;
To see the spatial character of the exciton YPP writes the exciton spatial distribution, in other words the probability to find the electron somewhere in the space when the hole is fixed in a give position.&lt;br /&gt;
Different output formats can be selected and 1D,2D,3D plots done.&lt;br /&gt;
Create the input and change the size of the cell where to see the exciton.&lt;br /&gt;
Note that  If the k-grid of the BSE simulation is a NxNx1  the exciton has an induced fictitious periodicity every Nx Nx1 Cell  of the simulation.&lt;br /&gt;
For hBN-2D this is not a problem because the exciton is strongly localized but in other systems with  more delocalized excitons to look at the real exciton size it is necessary to use &lt;br /&gt;
very large k-grids in the BSE&lt;br /&gt;
 $ ypp -F ypp_WF.in -J 2D_WR_WC  -e w  1&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;12&amp;quot;               # [rlu] [1/2/3] for 1d or [12/13/23] for 2d [123] for 3D&lt;br /&gt;
 FFTGvecs=  3951        RL    # [FFT] Plane-waves&lt;br /&gt;
 States= &amp;quot;1 - 1&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.4     | 1.400     | 0.00     |        # [cc] Hole position in unit cell&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Close the input and run ypp&lt;br /&gt;
 $ ypp -F ypp_WF.in -J 2D_WR_WC &lt;br /&gt;
&lt;br /&gt;
 $ xcrysden --xsf o-2D_WR_WC.exc_2d_1.xsf&lt;br /&gt;
&lt;br /&gt;
[[File:exc_BN2D.png|none|400px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or alternatively &lt;br /&gt;
 $ xcrysden --sushi&lt;br /&gt;
 [[File:SUSHI.JPG|none|400px|]]&lt;br /&gt;
--&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 excitons, it is the possibility 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 corresponding input just 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. 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 to distinguishing charge-transfer exctions from Frenkel or Wannier ones, by looking the relative position of the electron/hole densities.&lt;br /&gt;
For example see the electron/hole average density calculated in a Metal Organic Framework (MOF) that contains azobenzene:&lt;br /&gt;
&lt;br /&gt;
[[File:Average electron hole.png|center |600px|Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
this figure is taken from  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;
== Interpolate exciton dispersion (only in Yambo 5.x)==&lt;br /&gt;
&lt;br /&gt;
Starting from Yambo 5.x it is possible to calculate excitons at finite momentum &#039;&#039;&#039;q&#039;&#039;&#039;. The momentum can be specified with the variable&lt;br /&gt;
 %BSEQptR&lt;br /&gt;
  iq_start | iq_end |                             # [BSK] Transferred momenta range&lt;br /&gt;
 %&lt;br /&gt;
where iq_start and iq_end is the first and last index of momentum in the irreducible Brillouin zone (IBZ). You can find the list of q-vectors in the r_setup report.&lt;br /&gt;
If you calculate the BSE for all q-points of the IBZ, then you can interpolate  exciton dispersion along any direction of the full Brillouin zone(BZ) using the&lt;br /&gt;
interpolation scheme of ref. &amp;lt;ref&amp;gt;Warren E. Pickett, Henry Krakauer, and Philip B. Allen  [https://journals.aps.org/prb/abstract/10.1103/PhysRevB.38.2721 PRB 38 p2721 (1988)]&amp;lt;/ref&amp;gt;, by doing:&lt;br /&gt;
&lt;br /&gt;
 ypp -e i &lt;br /&gt;
&lt;br /&gt;
and then setting:&lt;br /&gt;
&lt;br /&gt;
 excitons                         # [R] Excitonic properties&lt;br /&gt;
 interpolate                      # [R] Interpolate&lt;br /&gt;
 States= &amp;quot;1 - 4&amp;quot;                  # Index of the BS state(s)&lt;br /&gt;
 INTERP_mode= &amp;quot;BOLTZ&amp;quot;                # Interpolation mode (NN=nearest point, BOLTZ=boltztrap aproach)&lt;br /&gt;
 % INTERP_Grid&lt;br /&gt;
  -1 |-1 |-1 |                             # Interpolation BZ Grid &lt;br /&gt;
 %&lt;br /&gt;
 #PrtDOS                          # Print Exciton Density of States&lt;br /&gt;
 BANDS_steps= 100                 # Number of divisions&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 cooOut= &amp;quot;rlu&amp;quot;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 %BANDS_kpts                      # K points of the bands circuit&lt;br /&gt;
 0 | 0 | 0 |&lt;br /&gt;
 0.333333333333333 | 0.33333333333333 | 0 | &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
Running ypp, it will interpolate the first 4 excitons energies on 100 points along with the line Gamma-&amp;gt;K. If you plot the output file &amp;quot;o.excitons_interpolated&amp;quot;,&lt;br /&gt;
you can compare the interpolated results with the original points calculated in the BSE, that are available in the report &amp;quot;r_excitons_interpolate&amp;quot;, and you get something like:&lt;br /&gt;
&lt;br /&gt;
[[File:Excitons dispersion.png|center | Yambo exciton dispersion]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is also possible to interpolate excitons on a given regular grid by setting &amp;lt;code&amp;gt;INTERP_Grid&amp;lt;/code&amp;gt;, for example in the figure below we interpolate the dispersion of the lowest exciton in MoS&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; calculated on a 39x39x1 and interpolated in a 117x117x1 grid in all the Brillouin zone:&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2021-03-24 11-38-46.png|center| 700px|Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
Finally if you turn on the flag &amp;lt;code&amp;gt;PrtDOS&amp;lt;/code&amp;gt; the code calculate the excitonic density of states on the excitons interpolated on the regular grid given by  &amp;lt;code&amp;gt;INTERP_Grid&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=How_to_analyse_excitons&amp;diff=8551</id>
		<title>How to analyse excitons</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=How_to_analyse_excitons&amp;diff=8551"/>
		<updated>2025-03-30T09:29:03Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* Calculate the exciton oscillator strenght and amplitude */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial you will learn (for a 2D-hBN)  how to:&lt;br /&gt;
* analyze a BSE optical spectrum in terms of excitonic eigenvectors and eigenvalues&lt;br /&gt;
* look at the spatial distribution of the exciton&lt;br /&gt;
* For a similar tutorial focusing on 3D-hBN, go to [[How to analyse excitons - CECAM 2021 school|this page]].&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 [[How to treat low dimensional systems]] tutorial&lt;br /&gt;
&#039;&#039;&#039;You will need&#039;&#039;&#039;:&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; executable&lt;br /&gt;
* &amp;lt;code&amp;gt;gnuplot or xmgrace&amp;lt;/code&amp;gt; executable&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== YAMBO calculations ==&lt;br /&gt;
If you have completed the tutorials of 2D hBN you should have all the databases required to do this tutorial in your &amp;lt;code&amp;gt;YAMBO_TUTORIALS/hBN-2D/SAVE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2D_WR_WC&amp;lt;/code&amp;gt; (databases generated with RIM and cutoff) directories&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;
 $ ls ./2D_WR_WC&lt;br /&gt;
 ndb.BS_Q1_CPU_0	ndb.cutoff	ndb.dip_iR_and_P_fragment_1	ndb.pp_fragment_1 ...&lt;br /&gt;
&lt;br /&gt;
==Sort the excitonic eigenvalues==&lt;br /&gt;
&lt;br /&gt;
 $ ypp -J 2D_WR_WC -e s 1&lt;br /&gt;
&lt;br /&gt;
We are sorting the excitons for the q-index = 1 (optical limit q=0).&lt;br /&gt;
The new generated file &#039;&#039;o-2D_WR_WC.exc_qpt1_E_sorted &#039;&#039; (&#039;&#039;o-2D_WR_WC.exc_qpt1_I_sorted &#039;&#039;) reports &lt;br /&gt;
the energies of the excitons and their Dipole Oscillator Strengths sorted by energy  (Index).&lt;br /&gt;
[[File:strengh.png|none|x120px|]]&lt;br /&gt;
Open the first file and look inside. The first exciton is at 4.83 eV and the second one has the highest strength (normalized to 1)&lt;br /&gt;
&lt;br /&gt;
Or you can make a plot&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-2D_WR_WC.exc_qpt1_E_sorted&#039;  with points ls 2 title &#039;Strenghts&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:strenght.png|none|600px|]]&lt;br /&gt;
&lt;br /&gt;
Attention the convergence of these results with different k-points grids is mandatory!&lt;br /&gt;
&lt;br /&gt;
== Calculate the exciton oscillator strenght and amplitude ==&lt;br /&gt;
&lt;br /&gt;
We can now analyze the excitons in terms of single-particle states, to do that create the appropriate input &lt;br /&gt;
 $ ypp -F ypp_AMPL.in -J 2D_WR_WC -e a 1 &lt;br /&gt;
&lt;br /&gt;
Suppose you wish to analyze the first 5 excitons then change this line as:&lt;br /&gt;
 States= &amp;quot;1 - 5&amp;quot;              # Index of the BS state(s)&lt;br /&gt;
&lt;br /&gt;
Close the input and run ypp&lt;br /&gt;
&lt;br /&gt;
 $ ypp -F ypp_AMPL.in -J 2D_WR_WC&lt;br /&gt;
&lt;br /&gt;
 $ls  o*exc*at*&lt;br /&gt;
 o-2D_WR_WC.exc_qpt1_amplitude_at_1 o-2D_WR_WC.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-2D_WR_WC.exc_qpt1_weights_at_*&#039;&#039; report the Weights&lt;br /&gt;
[[File:Weights.png|none|x60px|]]&lt;br /&gt;
and &#039;&#039;o-2D_WR_WC.exc_qpt1_amplitude_**&#039;&#039; report the amplitudes &lt;br /&gt;
[[File:Ampl.png|none|x70px|]]&lt;br /&gt;
&lt;br /&gt;
Open the file  &#039;&#039;o-2D_WR_WC.exc_weights_at_1&#039;&#039; &lt;br /&gt;
 #  Band_V     Band_C     K  ibz     Symm.      Weight     Energy&lt;br /&gt;
 #&lt;br /&gt;
  4.000000   5.000000   7.000000   2.000000   0.922095   4.401093&lt;br /&gt;
  4.000000   5.000000   7.000000   1.000000   0.922086   4.401093&lt;br /&gt;
&lt;br /&gt;
 The first exciton is  essentially done of only single particle transitions from VBM to CBM at K (last k-point of the grid).&lt;br /&gt;
&lt;br /&gt;
[[File:Amplitude_plot.png|none|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Plot the exciton spatial distribution ==&lt;br /&gt;
&lt;br /&gt;
To see the spatial character of the exciton YPP writes the exciton spatial distribution, in other words the probability to find the electron somewhere in the space when the hole is fixed in a give position.&lt;br /&gt;
Different output formats can be selected and 1D,2D,3D plots done.&lt;br /&gt;
Create the input and change the size of the cell where to see the exciton.&lt;br /&gt;
Note that  If the k-grid of the BSE simulation is a NxNx1  the exciton has an induced fictitious periodicity every Nx Nx1 Cell  of the simulation.&lt;br /&gt;
For hBN-2D this is not a problem because the exciton is strongly localized but in other systems with  more delocalized excitons to look at the real exciton size it is necessary to use &lt;br /&gt;
very large k-grids in the BSE&lt;br /&gt;
 $ ypp -F ypp_WF.in -J 2D_WR_WC  -e w  1&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;12&amp;quot;               # [rlu] [1/2/3] for 1d or [12/13/23] for 2d [123] for 3D&lt;br /&gt;
 FFTGvecs=  3951        RL    # [FFT] Plane-waves&lt;br /&gt;
 States= &amp;quot;1 - 1&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.4     | 1.400     | 0.00     |        # [cc] Hole position in unit cell&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Close the input and run ypp&lt;br /&gt;
 $ ypp -F ypp_WF.in -J 2D_WR_WC &lt;br /&gt;
&lt;br /&gt;
 $ xcrysden --xsf o-2D_WR_WC.exc_2d_1.xsf&lt;br /&gt;
&lt;br /&gt;
[[File:exc_BN2D.png|none|400px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or alternatively &lt;br /&gt;
 $ xcrysden --sushi&lt;br /&gt;
 [[File:SUSHI.JPG|none|400px|]]&lt;br /&gt;
--&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 excitons, it is the possibility 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 corresponding input just 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. 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 to distinguishing charge-transfer exctions from Frenkel or Wannier ones, by looking the relative position of the electron/hole densities.&lt;br /&gt;
For example see the electron/hole average density calculated in a Metal Organic Framework (MOF) that contains azobenzene:&lt;br /&gt;
&lt;br /&gt;
[[File:Average electron hole.png|center |600px|Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
this figure is taken from  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;
== Interpolate exciton dispersion (only in Yambo 5.x)==&lt;br /&gt;
&lt;br /&gt;
Starting from Yambo 5.x it is possible to calculate excitons at finite momentum &#039;&#039;&#039;q&#039;&#039;&#039;. The momentum can be specified with the variable&lt;br /&gt;
 %BSEQptR&lt;br /&gt;
  iq_start | iq_end |                             # [BSK] Transferred momenta range&lt;br /&gt;
 %&lt;br /&gt;
where iq_start and iq_end is the first and last index of momentum in the irreducible Brillouin zone (IBZ). You can find the list of q-vectors in the r_setup report.&lt;br /&gt;
If you calculate the BSE for all q-points of the IBZ, then you can interpolate  exciton dispersion along any direction of the full Brillouin zone(BZ) using the&lt;br /&gt;
interpolation scheme of ref. &amp;lt;ref&amp;gt;Warren E. Pickett, Henry Krakauer, and Philip B. Allen  [https://journals.aps.org/prb/abstract/10.1103/PhysRevB.38.2721 PRB 38 p2721 (1988)]&amp;lt;/ref&amp;gt;, by doing:&lt;br /&gt;
&lt;br /&gt;
 ypp -e i &lt;br /&gt;
&lt;br /&gt;
and then setting:&lt;br /&gt;
&lt;br /&gt;
 excitons                         # [R] Excitonic properties&lt;br /&gt;
 interpolate                      # [R] Interpolate&lt;br /&gt;
 States= &amp;quot;1 - 4&amp;quot;                  # Index of the BS state(s)&lt;br /&gt;
 INTERP_mode= &amp;quot;BOLTZ&amp;quot;                # Interpolation mode (NN=nearest point, BOLTZ=boltztrap aproach)&lt;br /&gt;
 % INTERP_Grid&lt;br /&gt;
  -1 |-1 |-1 |                             # Interpolation BZ Grid &lt;br /&gt;
 %&lt;br /&gt;
 #PrtDOS                          # Print Exciton Density of States&lt;br /&gt;
 BANDS_steps= 100                 # Number of divisions&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 cooOut= &amp;quot;rlu&amp;quot;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 %BANDS_kpts                      # K points of the bands circuit&lt;br /&gt;
 0 | 0 | 0 |&lt;br /&gt;
 0.333333333333333 | 0.33333333333333 | 0 | &lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
Running ypp, it will interpolate the first 4 excitons energies on 100 points along with the line Gamma-&amp;gt;K. If you plot the output file &amp;quot;o.excitons_interpolated&amp;quot;,&lt;br /&gt;
you can compare the interpolated results with the original points calculated in the BSE, that are available in the report &amp;quot;r_excitons_interpolate&amp;quot;, and you get something like:&lt;br /&gt;
&lt;br /&gt;
[[File:Excitons dispersion.png|center | Yambo exciton dispersion]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is also possible to interpolate excitons on a given regular grid by setting &amp;lt;code&amp;gt;INTERP_Grid&amp;lt;/code&amp;gt;, for example in the figure below we interpolate the dispersion of the lowest exciton in MoS&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; calculated on a 39x39x1 and interpolated in a 117x117x1 grid in all the Brillouin zone:&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2021-03-24 11-38-46.png|center| 700px|Yambo tutorial image]]&lt;br /&gt;
&lt;br /&gt;
Finally if you turn on the flag &amp;lt;code&amp;gt;PrtDOS&amp;lt;/code&amp;gt; the code calculate the excitonic density of states on the excitons interpolated on the regular grid given by  &amp;lt;code&amp;gt;INTERP_Grid&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=OUTDATED_TUTORIAL_-_Exciton-phonon_coupling_and_luminescence&amp;diff=8531</id>
		<title>OUTDATED TUTORIAL - Exciton-phonon coupling and luminescence</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=OUTDATED_TUTORIAL_-_Exciton-phonon_coupling_and_luminescence&amp;diff=8531"/>
		<updated>2025-03-20T08:48:07Z</updated>

		<summary type="html">&lt;p&gt;Daniele: /* BSE at finite momentum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Tdgw-phonon-usc-01-1024x829.jpg| 400px | right]]&lt;br /&gt;
This an advanced tutorial, we will show how calculate exciton-phonon coupling&amp;lt;ref name=&amp;quot;Toyozawa&amp;quot; /&amp;gt; and  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;  phonon-assisted absorption/emission&amp;lt;/span&amp;gt;&amp;lt;ref name=&#039;pierre&#039;/&amp;gt;. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Finally we will show how the exciton-phonon coupling can be used to calculate exicton life-time.&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
In order to run this tutorial you need  a deep knowledge of the theory involving these processes and on the use of the Yambo code. &amp;lt;ref name=&#039;cann&#039; /&amp;gt;&amp;lt;ref name=&#039;fprl&#039; /&amp;gt;&amp;lt;ref name=&#039;bern&#039; /&amp;gt;&amp;lt;ref name=&amp;quot;pierrethesis&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will consider as example bulk hBN. Notice that parameters of the present tutorial are not at convergence, but are enough to get a reasonable result.&amp;lt;br&amp;gt;&lt;br /&gt;
The tutorial includes several steps and the calculations can be quite expensive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to calculate luminescence you need electron-phonon matrix elements and excitons (energies and wave-functions) for this reason in this &lt;br /&gt;
tutorial we will illustrate the different steps to calculate:&lt;br /&gt;
# Electron-phonon matrix elements with Quantum Espresso&lt;br /&gt;
# Run the Bethe-Salpter equation for all momementum Q on the same k-grid of the electron-phonon&lt;br /&gt;
# Put electron-phonon matrix elements and exciton together to get the final luminescence spectrum&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Getting the code ===&lt;br /&gt;
&lt;br /&gt;
This tutorial works only with Yambo version &amp;gt; 6.x, but a preliminary version of the code is available on github:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/attacc/yambo, https://github.com/attacc/yambo]&lt;br /&gt;
&lt;br /&gt;
Notice that this version is not fully tested therefore we advice you do not use it in production. In order to install yambo with exciton-phonon coupling you do:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/attacc/yambo.git yambo-excph&lt;br /&gt;
 cd yambo-excph&lt;br /&gt;
 git checkout devel-excph&lt;br /&gt;
 git pull&lt;br /&gt;
&lt;br /&gt;
and the configure Yambo&lt;br /&gt;
&lt;br /&gt;
 ./configure &lt;br /&gt;
&lt;br /&gt;
and compile the code &lt;br /&gt;
&lt;br /&gt;
 make core -j2&lt;br /&gt;
 make ph-project -j2&lt;br /&gt;
&lt;br /&gt;
notice that -j is for parallel compilation&lt;br /&gt;
&lt;br /&gt;
==Electron-phonon matrix elements==&lt;br /&gt;
&lt;br /&gt;
Now we need to generate wave-function and the electron-phonon matrix elements that will be used in the exciton-phonon coupling calculations.&amp;lt;br&amp;gt;&lt;br /&gt;
This part will take time, but if you want you can skip the databases generation and download them directly here:&lt;br /&gt;
&lt;br /&gt;
[https://www.attaccalite.com/tutorials_yambo/EXCPH_dbs.tgz  EXCPH_dbs.tgz] &lt;br /&gt;
&lt;br /&gt;
If you want to generate the electron-phonon databases and the Kohn-Sham wave-functions, here you will find scripts and all input files to run the a small example on hBN:&lt;br /&gt;
&lt;br /&gt;
[https://www.attaccalite.com/tutorials_yambo/EXAMPLE_EXCPH_hBN.tgz EXAMPLE_EXCPH_hBN.tgz]&lt;br /&gt;
&lt;br /&gt;
In the tgz file you will find a script &#039;&#039;run_dvscf.sh&#039;&#039;, a python script and different folders with the QE input files. &lt;br /&gt;
You have to modify &#039;&#039;run_dvscf.sh&#039;&#039; in order to set the correct path of Yambo and QuantumEspresso on your PC, the number of processors to use, and the parallelization command.&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
 ./run_dvscf.sh&lt;br /&gt;
&lt;br /&gt;
it will generate electron-phonon coupling on a Q-grid 12x12x1 for bulk hBN. &amp;lt;br&amp;gt;Generation of electron-phonon matrix elements can take time,&lt;br /&gt;
for example on my PC (core i9) it takes 1 hour with 8 cores. If you want you can decrease the number of K-point up to 8x8 to speed up calculations.&amp;lt;br&amp;gt;&lt;br /&gt;
The script will perform self-consistent calculation for the density, then non-self-consistent for the band structure,&lt;br /&gt;
calculation of phonons on a special q-grid and finally the calculation of electron-phonon matrix elements.&lt;br /&gt;
Notice that the Q-grid is automatically generated from the K point you set for the NSCF calculations.&amp;lt;br&amp;gt;&lt;br /&gt;
All these data, wave-functions, and electron-phonon matrix elements are then transformed in the Yambo format.&lt;br /&gt;
&lt;br /&gt;
When the run is finished you can go in the &#039;&#039;&#039;QPT12/dvscf/bn.save&#039;&#039;&#039; folder to start exciton-phonon calculations.&lt;br /&gt;
&lt;br /&gt;
==BSE at finite momentum==&lt;br /&gt;
First of all we need the solution of the Bethe-Salpeter equation for all q-points in the grid.&amp;lt;br&amp;gt;&lt;br /&gt;
Run the  BSE for all momentum &#039;&#039;&#039;q&#039;&#039;&#039; as explained in the tutorials: [http://www.yambo-code.eu/wiki/index.php?title=How_to_obtain_an_optical_spectrum BSE basic], [http://www.yambo-code.eu/wiki/index.php?title=How_to_choose_the_input_parameters BSE convergence], [http://www.yambo-code.eu/wiki/index.php?title=How_to_treat_low_dimensional_systems BSE for 2D].&amp;lt;br&amp;gt;&lt;br /&gt;
Do not forget to turn on the flag &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;WRbsWF&amp;lt;/span&amp;gt; to write the excitonic wave-functions.&lt;br /&gt;
You can generate the input for the BSE with the command: &#039;&#039;yambo_ph -X s -o b -y d -V qp -k sex&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 em1s                             # [R][Xs] Statically Screened Interaction&lt;br /&gt;
 optics                           # [R] Linear Response optical properties&lt;br /&gt;
 bss                              # [R] BSE solver&lt;br /&gt;
 bse                              # [R][BSE] Bethe Salpeter Equation.&lt;br /&gt;
 dipoles                          # [R] Oscillator strenghts (or dipoles)&lt;br /&gt;
 BoseTemp=-1.000000         eV    # Bosonic Temperature&lt;br /&gt;
 DIP_Threads=0                    # [OPENMP/X] Number of threads for dipoles&lt;br /&gt;
 X_Threads=0                      # [OPENMP/X] Number of threads for response functions&lt;br /&gt;
 K_Threads=0                      # [OPENMP/BSK] Number of threads for response functions&lt;br /&gt;
 Chimod= &amp;quot;HARTREE&amp;quot;                # [X] IP/Hartree/ALDA/LRC/PF/BSfxc&lt;br /&gt;
 BSKmod= &amp;quot;SEX&amp;quot;                    # [BSE] IP/Hartree/HF/ALDA/SEX/BSfxc&lt;br /&gt;
 BSEmod= &amp;quot;resonant&amp;quot;               # [BSE] resonant/retarded/coupling&lt;br /&gt;
 BSSmod= &amp;quot;d&amp;quot;                      # [BSS] (h)aydock/(d)iagonalization/(s)lepc/(i)nversion/(t)ddft`&lt;br /&gt;
 BSENGexx= 14923            RL    # [BSK] Exchange components&lt;br /&gt;
 BSENGBlk=-1                RL    # [BSK] Screened interaction block size [if -1 uses all the G-vectors of W(q,G,Gp)]&lt;br /&gt;
 #WehCpl                        # [BSK] eh interaction included also in coupling&lt;br /&gt;
 KfnQPdb= &amp;quot;none&amp;quot;                  # [EXTQP BSK BSS] Database action&lt;br /&gt;
 KfnQP_INTERP_NN= 1               # [EXTQP BSK BSS] Interpolation neighbours (NN mode)&lt;br /&gt;
 KfnQP_INTERP_shells= 20.00000    # [EXTQP BSK BSS] Interpolation shells (BOLTZ mode)&lt;br /&gt;
 KfnQP_DbGd_INTERP_mode= &amp;quot;NN&amp;quot;     # [EXTQP BSK BSS] Interpolation DbGd mode&lt;br /&gt;
 % KfnQP_E&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt; 3.000000 &amp;lt;/span&amp;gt;| 1.000000 | 1.000000 |        # [EXTQP BSK BSS] E parameters  (c/v) eV|adim|adim&lt;br /&gt;
 %&lt;br /&gt;
 % BSEQptR&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;  1 | 19 | &amp;lt;/span&amp;gt;                          # [BSK] Transferred momenta range&lt;br /&gt;
 %&lt;br /&gt;
 % BSEBands&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;  7 | 10 | &amp;lt;/span&amp;gt;                           # [BSK] Bands range&lt;br /&gt;
 %&lt;br /&gt;
 % BEnRange&lt;br /&gt;
  0.00000 | 10.00000 |         eV    # [BSS] Energy range&lt;br /&gt;
 %&lt;br /&gt;
 % BDmRange&lt;br /&gt;
  0.100000 | 0.100000 |         eV    # [BSS] Damping range&lt;br /&gt;
 %&lt;br /&gt;
 BEnSteps=  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;300 &amp;lt;/span&amp;gt;                   # [BSS] Energy steps&lt;br /&gt;
 % BLongDir&lt;br /&gt;
  1.000000 | 0.000000 | 0.000000 |        # [BSS] [cc] Electric Field&lt;br /&gt;
 %&lt;br /&gt;
 BSEprop= &amp;quot;abs&amp;quot;                   # [BSS] Can be any among abs/jdos/kerr/magn/dich/photolum/esrt&lt;br /&gt;
 BSEdips= &amp;quot;none&amp;quot;                  # [BSS] Can be &amp;quot;trace/none&amp;quot; or &amp;quot;xy/xz/yz&amp;quot; to define off-diagonal rotation plane&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;WRbsWF&amp;lt;/span&amp;gt;                        # [BSS] Write to disk excitonic the WFs&lt;br /&gt;
 % BndsRnXs&lt;br /&gt;
  1 | 16 |                           # [Xs] Polarization function bands&lt;br /&gt;
 %&lt;br /&gt;
 NGsBlkXs= &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt; 51  &amp;lt;/span&amp;gt;            RL    # [Xs] Response block size&lt;br /&gt;
 % LongDrXs&lt;br /&gt;
 1.000000 | 0.000000 | 0.000000 |        # [Xs] [cc] Electric Field&lt;br /&gt;
 %&lt;br /&gt;
In the BSE we included only the two top valence bands 7,8 and the bottom conduction bands 9,10 plus a scissor of 3.0 eV, and the dielectric constant used to calculate W includes 16 bands and has block size of 51 plane waves. Notice that we calculate the BSE for all the 19 possible transfer momentum. In this input file we used the full diagonalization &#039;&#039; BSSmod= &amp;quot;d&amp;quot; &#039;&#039;, for large system it is better to switch to the Slepc libraries, &#039;-y s&#039; in the input file generation. &lt;br /&gt;
If you plot the optical spectra,  file &#039;&#039;o.eps_q1_diago_bse&#039;&#039;, you should get something like this:&lt;br /&gt;
[[File:HBN q1 bse.png|center]]&lt;br /&gt;
&lt;br /&gt;
==Exicton dipersion==&lt;br /&gt;
Just to be sure that everything is fine, we can have a look to the exciton dispersion along the path Gamma-&amp;gt;K-&amp;gt;M-&amp;gt;Gamma, with the command: &#039;&#039;ypp_ph -e i&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 excitons                         # [R] Excitonic properties&lt;br /&gt;
 interpolate                      # [R] Interpolate&lt;br /&gt;
 INTERP_mode= &amp;quot; &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;BOLTZ&amp;lt;/span&amp;gt;&amp;quot;                # Interpolation mode (NN=nearest point, BOLTZ=boltztrap aproach)&lt;br /&gt;
 INTERP_Shell_Fac= 20.00000       # The bigger it is a higher number of shells is used&lt;br /&gt;
 INTERP_NofNN= 1                  # Number of Nearest sites in the NN method&lt;br /&gt;
 BANDS_steps=  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;50&amp;lt;/span&amp;gt;                  # Number of divisions&lt;br /&gt;
 cooIn= &amp;quot;rlu&amp;quot;                     # Points coordinates (in) cc/rlu/iku/alat&lt;br /&gt;
 cooOut= &amp;quot;rlu&amp;quot;                    # Points coordinates (out) cc/rlu/iku/alat&lt;br /&gt;
 States= &amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1 - 2&amp;lt;/span&amp;gt;&amp;quot;                  # Index of the BS state(s)&lt;br /&gt;
 % INTERP_Grid&lt;br /&gt;
 -1 |-1 |-1 |                             # Interpolation BZ Grid&lt;br /&gt;
 %&lt;br /&gt;
 #PrtDOS                        # Print Exciton Density of States&lt;br /&gt;
 % DOSERange&lt;br /&gt;
  1.000000 |-1.000000 |         eV    # Energy range&lt;br /&gt;
 %&lt;br /&gt;
 DOSESteps=  10                  # Energy steps&lt;br /&gt;
 DOS_broad= 0.100000        eV    # Broadening of the DOS&lt;br /&gt;
 %BANDS_kpts                      # K points of the bands circuit&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;0.0 | 0.0 | 0.0 | &lt;br /&gt;
 0.33333333333| 0.333333333333 | 0.0 | &lt;br /&gt;
 0.5 | 0.0 | 0.0 |&lt;br /&gt;
 0.0 | 0.0 | 0.0 | &amp;lt;/span&amp;gt;&lt;br /&gt;
 %&lt;br /&gt;
&lt;br /&gt;
As you can see in the figure below this system is indirect because the minimum is not a Gamma.&lt;br /&gt;
[[File:Exc dispersion.png|center]]&lt;br /&gt;
&lt;br /&gt;
==Exciton-phonon matrix elements and optics==&lt;br /&gt;
Now that you have the BSE for all momentum and the electron-phonon databases, you can create the exciton-phonon matrix elements, according to the equation:&lt;br /&gt;
[[File:Exciton phonon.png|center|900px|Yambo tutorial image]]&lt;br /&gt;
and calculate optical response as:&lt;br /&gt;
[[File:Optical absorption exc ph.png|center | 600px |Yambo tutorial image]]&lt;br /&gt;
where W&amp;lt;sub&amp;gt;βα,μq&amp;lt;/sub&amp;gt; =E&amp;lt;sub&amp;gt;βq&amp;lt;/sub&amp;gt; − E&amp;lt;sub&amp;gt;α&amp;lt;/sub&amp;gt; + ω&amp;lt;sub&amp;gt;qμ&amp;lt;/sub&amp;gt; ,for more details see Ref.&amp;lt;ref name=&#039;ptesi&#039; /&amp;gt;. Phonon-assisted optical response and exciton-phonon matrix elements can be calculated  with the command: &#039;&#039;yambo_ph -excph o&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 excph                            # [R] Exction-phonon&lt;br /&gt;
 ExcGkkp                          # [R][EXCPH] Exciton-Phonon Matrix Elelements&lt;br /&gt;
 ExcPhOptics                      # [R][EXCPH] Exciton-Phonon Optics&lt;br /&gt;
 BoseTemp= 0.000000         eV    # Bosonic Temperature&lt;br /&gt;
 % ELPhExcStates&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;  1 |  4 |  &amp;lt;/span&amp;gt;                         # [EXCPH] Incoming (external) exciton states&lt;br /&gt;
 %&lt;br /&gt;
 % ELPhExcSum&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;  1 |  8 |&amp;lt;/span&amp;gt;                          # [EXCPH] Outgoing (virtual) exciton states&lt;br /&gt;
 %&lt;br /&gt;
 LoutPath= &amp;quot;none&amp;quot;                 # [EXCPH] Path of the outgoing L&lt;br /&gt;
 FANdEtresh= &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10.00000       meV &amp;lt;/span&amp;gt;  # [ELPH] Energy treshold for Fan denominator&lt;br /&gt;
 LDamping= 0.500000E-3      eV    # [EXCPH] Damping of exc-ph self-energy&lt;br /&gt;
 EXCTemp= &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;20.00000          Kn&amp;lt;/span&amp;gt;    # [EXCPH] Excitonic Temperature (for luminescence spectra)&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 | 12 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 AlphaQ= 0.000000                 # [EXCPH] Excitonic band structure 2D distortion&lt;br /&gt;
 #PLqres                        # [EXCPH] Write contribution from each q-point&lt;br /&gt;
 #DbGdOnlyPh                    # [EXCPH] Use Double-Grid only for phonon energies (do not interpolate excitons)&lt;br /&gt;
 #DbGdWEIGHTs                   # [EXCPH] Use Double-grid also for satellite weights and renormalization&lt;br /&gt;
 #NoMatrxEl                     # [EXCPH] Set all exciton-phonon matrix elements to one (for testing purpose)&lt;br /&gt;
 % EnRngeXd&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt; 5.800000 | 6.400000 |  &amp;lt;/span&amp;gt;       eV    # [Xd] Energy range&lt;br /&gt;
 %&lt;br /&gt;
 % DmRngeXd&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt; 0.002500 | 0.002500 |&amp;lt;/span&amp;gt;         eV    # [Xd] Damping range&lt;br /&gt;
 %&lt;br /&gt;
 ETStpsXd= &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1000 &amp;lt;/span&amp;gt;                  # [Xd] Total Energy steps&lt;br /&gt;
 EXCPHdEtresh= 0.100000E-5  eV    # [ELPH] Energy treshold for exc-ph denominator&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
where the  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;ELPhExcStates&amp;lt;/span&amp;gt; state are the one responsible for the absorption and emission, the α indexes in the χ&amp;lt;sub&amp;gt;αα&amp;lt;/sub&amp;gt; and  &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;ELPhExcSum&amp;lt;/span&amp;gt; are the virtual exciton states that enter in the exciton-phonon scattering, namely the β index in the sum χ&amp;lt;sub&amp;gt;αα&amp;lt;/sub&amp;gt;. Running the code, Yambo calculates all the exciton-phonon matrix elements and the photon assisted absorption and emission spectra. The emission spectra is calculated using the Roosbroeck–Shockley (RS) relation&amp;lt;ref&amp;gt;Photon-Radiative Recombination of Electrons and Holes in Germanium, W. van Roosbroeck and W. Shockley,&lt;br /&gt;
Phys. Rev. &#039;&#039;&#039;94&#039;&#039;&#039;, 1558 (1954)&amp;lt;/ref&amp;gt;, a Boltzman distribution for the excitonic occupation at temperature &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;EXCTemp&amp;lt;/span&amp;gt;, for more detail see Refs.&amp;lt;ref name=&#039;ptesi&#039;/&amp;gt;&amp;lt;ref name=&#039;fprl&#039;/&amp;gt;, other ways for excitonic occupations are possible, for a discussion see Ref.&amp;lt;ref name=&#039;cann&#039;/&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;LoutPath&amp;lt;/span&amp;gt; is the path of the outgoing Bethe-Salpeter, in principle one can use two different kind of exciton for virtual and real exciton in above equation. If &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;LoutPath=&#039;none&#039;&amp;lt;/span&amp;gt; Yambo will read excitons in the same folder of the incoming ones, by default the SAVE folder.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Double grid for exciton and phonon energies is available&amp;lt;ref name=&#039;pierre&#039;&amp;gt;&amp;lt;/ref&amp;gt;, in order to activate it just generate phonons on large grids and make Yambo reads them, as explained in the [https://www.yambo-code.eu/wiki/index.php/Electron_Phonon_Coupling#Double-grid_method_for_the_electron-phonon_coupling_(only_in_Yambo_5.x),  electron-phonon tutorial]. Yambo automatically will interpolate exciton on the same grid&amp;lt;ref&amp;gt;Warren E. Pickett, Henry Krakauer, and Philip B. Allen, &lt;br /&gt;
Phys. Rev. B &#039;&#039;&#039;38&#039;&#039;&#039;, 2721(1988)&amp;lt;/ref&amp;gt;.&lt;br /&gt;
Using the double-grid, in order to converge results on q-grid you can follow the same strategy of the electron-phonon tutorial: converge the fine grid for fix course grid (matrix elements) and then increase the course one and repeat the process until total convergence is reached.&lt;br /&gt;
&lt;br /&gt;
In the output are present two file, the absorption and the luminescence spectra. The absorption is not so interesting because is dominated by a strong direct exciton and phonon-assisted peaks are only slightly visible. Hereafter we plot the luminescence spectrum that can be compared with the ones of Ref.&amp;lt;ref name=&#039;pierre&#039; /&amp;gt;&amp;lt;ref name=&#039;fprl&#039; /&amp;gt;&amp;lt;ref name=&#039;bern&#039; /&amp;gt;.&lt;br /&gt;
[[File:Luminescence new hbn.png|center|900px | Luminescence hBN]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;WARNING&#039;&#039;&#039;: In the calculation of the exciton-phonon coupling matrix elements, the electron-phonon and BSE coefficients enter with their own phase. This means that to be consistent these matrix elements&lt;br /&gt;
should be calculated from the same Koth-Sham wave functions. Unfortunately, this is not the case in the current implementation. This fact introduces an error that can affect the intensity of the peaks or also the exciton lifetime, for a better discussion of this problem see Ref.&amp;lt;ref name=&#039;pierre&#039; /&amp;gt;,&amp;lt;ref name=&#039;fulvio2&#039; /&amp;gt; and &amp;lt;ref name=&#039;cudazzo&#039; /&amp;gt;. We are working on a better version of this code.&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==Exciton lifetimes==&lt;br /&gt;
&lt;br /&gt;
Using the exciton-phonon coupling it is possible also to calculate exciton life-time due to the scattering with phonon. For this kind of calculation input file can be generated with the command &#039;&#039;yambo -excph l&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 excph                            # [R] Exction-phonon&lt;br /&gt;
 ExcGkkp                          # [R][EXCPH] Exciton-Phonon Matrix Elelements&lt;br /&gt;
 ExcPhLifeT                       # [R][EXCPH] Exciton-Phonon Life-Times&lt;br /&gt;
 BoseTemp= 0.000000         eV    # Bosonic Temperature&lt;br /&gt;
 % ELPhExcStates&lt;br /&gt;
   &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1 |  4 |&amp;lt;/span&amp;gt;                           # [EXCPH] Incoming (external) exciton states&lt;br /&gt;
 %&lt;br /&gt;
 % ELPhExcSum&lt;br /&gt;
   &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1 |  8 |    &amp;lt;/span&amp;gt;                       # [EXCPH] Outgoing (virtual) exciton states&lt;br /&gt;
 %&lt;br /&gt;
 LoutPath= &amp;quot;none&amp;quot;                 # [EXCPH] Path of the outgoing L&lt;br /&gt;
 FANdEtresh= 0.100000E-5    eV    # [ELPH] Energy treshold for Fan denominator&lt;br /&gt;
 % ElPhModes&lt;br /&gt;
   1 | 12 |                           # [ELPH] Phonon modes included&lt;br /&gt;
 %&lt;br /&gt;
 EXCTemp= 0.000000          eV    # [EXCPH] Excitonic Temperature (for luminescence spectra)&lt;br /&gt;
 AlphaQ= 0.000000                 # [EXCPH] Excitonic band structure 2D distortion&lt;br /&gt;
 #ExcPhOffDiago                 # [EXCPH] Exciton-Phonon off-diagonal self-energy&lt;br /&gt;
 #NoMatrxEl                     # [EXCPH] Set all exciton-phonon matrix elements to one (for testing purpose)&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;LDamping= 0.1 &amp;lt;/span&amp;gt;     meV               # [EXCPH] Damping of exc-ph self-energy&lt;br /&gt;
&lt;br /&gt;
notice that in this case &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;LDamping&amp;lt;/span&amp;gt; is the broadening of the exciton-phonon self energy and it should be a very small value of the order of the phonon life-times around the meV.&amp;lt;ref&amp;gt;[https://arxiv.org/abs/1411.5628 First-principles calculations of phonon frequencies, lifetimes, and spectral functions from weak to strong an-harmonicity: The example of palladium hydrides], L. Paulatto, et al. Phys. Rev. B &#039;&#039;&#039;91&#039;&#039;&#039;, 054304 (2015) &amp;lt;/ref&amp;gt;. Running this input you will get:&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;-&amp;gt; Exciton lifetimes:&lt;br /&gt;
 &amp;lt;-&amp;gt; Exciton [1] Lifetime: 0.697314 meV&lt;br /&gt;
 &amp;lt;-&amp;gt; Exciton [2] Lifetime: 0.697314 meV&lt;br /&gt;
 &amp;lt;-&amp;gt; Exciton [3] Lifetime: 20.22155 meV&lt;br /&gt;
 &amp;lt;-&amp;gt; Exciton [4] Lifetime: 32.95292 meV&lt;br /&gt;
&lt;br /&gt;
the life-time of the first four excitons. Note that this result is not converged respect to the Q-points. In order to speedup convergence that double-grid&amp;lt;ref name=&#039;pierre&#039; /&amp;gt; can be used also in the life-time calculations, see tutorial on electron-phonon coupling for tricks on the convergence of the double-grid. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;Toyozawa&amp;quot; &amp;gt;Optical processes in solids, Toyozawa, Yutaka, and Chris Oxlade. Cambridge University Press, (2003). &amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&#039;pierre&#039;&amp;gt;[https://arxiv.org/abs/2212.10407 First-principles study of luminescence in hexagonal boron nitride single layer: Exciton-phonon coupling and the role of substrate], &lt;br /&gt;
P Lechifflart, F Paleari, D Sangalli, C Attaccalite PRM &#039;&#039;&#039;7&#039;&#039;&#039; (2), 024006 (2023)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&#039;cann&#039;&amp;gt;[https://arxiv.org/abs/1807.11797 Theory of phonon-assisted luminescence in solids: Application to hexagonal boron nitride], E. Cannuccia, B. Monserrat and C. Attaccalite, Phys. Rev. B &#039;&#039;&#039;99&#039;&#039;&#039;, 081109(R) (2019)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&#039;fprl&#039;&amp;gt;[https://arxiv.org/abs/1810.08976 Exciton-Phonon Coupling in the Ultraviolet Absorption and Emission Spectra of Bulk Hexagonal Boron Nitride], F. Paleari et al. PRL &#039;&#039;&#039;122&#039;&#039;&#039;, 187401(2019) &amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&#039;bern&#039;&amp;gt;[https://arxiv.org/abs/2002.08913 Exciton-Phonon Interaction and Relaxation Times from First Principles],&lt;br /&gt;
Hsiao-Yi Chen, Davide Sangalli, and Marco Bernardi, Phys. Rev. Lett. &#039;&#039;&#039;125&#039;&#039;&#039;, 107401(2020)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pierrethesis&amp;quot;&amp;gt;[https://www.yambo-code.eu/wiki/images/5/54/These_final.pdf Exciton-phonon coupling and phonon-assisted luminescence in hexagonal Boron Nitride nanostructures], PhD Thesis, Pierre Lechifflart (2023)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&#039;ptesi&#039;&amp;gt;[https://wwwen.uni.lu/research/fstm/dphyms/people/fulvio_paleari First-principles approaches to the description of indirect absorption and luminescence spectroscopy: exciton-phonon coupling in hexagonal boron nitride], F. Paleari PhD thesis&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&#039;fulvio2&#039;&amp;gt;[https://arxiv.org/abs/2305.17554 Distinguishing different stackings in layered materials via luminescence spectroscopy], M. Zanfrognini et al. Phys. Rev. Lett. &#039;&#039;&#039;131&#039;&#039;&#039;, 206902 (2023) &amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&#039;cudazzo&#039;&amp;gt;[https://arxiv.org/abs/2402.03826 Optical absorption and photoluminescence of single layer boron nitride from a first principles cumulant approach], G. Marini, M. Calandra, P. Cudazzo, Nano Lett. 2024, &#039;&#039;&#039;24&#039;&#039;&#039;, 20, 6017 (2024)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=8336</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=8336"/>
		<updated>2025-01-17T11:45:20Z</updated>

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

		<summary type="html">&lt;p&gt;Daniele: /* parse_gap.sh  (to parse the gap corrections) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Hexagonal-BN tutorial =&lt;br /&gt;
&lt;br /&gt;
===generate_inputs_1.sh   (GW ecut_X and nbnd_X convergence input fles) ===&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash &lt;br /&gt;
 #  &lt;br /&gt;
 # NGsBlkXp and BndsRnXp convergence input files&lt;br /&gt;
 #&lt;br /&gt;
 bands=&#039;10 20 30 40&#039;&lt;br /&gt;
 blocks=&#039;1 2 3 4 5&#039;&lt;br /&gt;
 #&lt;br /&gt;
 for i in ${bands} ; do&lt;br /&gt;
 for j in ${blocks}; do&lt;br /&gt;
     sed  -e &amp;quot;s/1 | 10/1 | $i/g&amp;quot;  gw_ppa.in  &amp;gt; tmp$i&lt;br /&gt;
     sed  -e &amp;quot;s/NGsBlkXp= 1/ NGsBlkXp= $j/g&amp;quot;  tmp$i &amp;gt; gw_ppa_$i&#039;b_&#039;$j&#039;Ry.in&#039;&lt;br /&gt;
     rm tmp*&lt;br /&gt;
 done&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===parse_qps.sh  (parse QP energies)===&lt;br /&gt;
&lt;br /&gt;
 #! /bin/bash&lt;br /&gt;
 #&lt;br /&gt;
 # parse QP energies from output files calculated with BndsRnXp bands &lt;br /&gt;
 # and put them in files ordered by NGsBlkXp&lt;br /&gt;
 #&lt;br /&gt;
 label=10b&lt;br /&gt;
 fileout=10b.dat &lt;br /&gt;
 #&lt;br /&gt;
 file_list=`ls  o-${label}_* `&lt;br /&gt;
 #&lt;br /&gt;
 echo &amp;quot;# ecut  NumG  QP1  QP2&amp;quot; &amp;gt; $fileout&lt;br /&gt;
 for file in $file_list; do&lt;br /&gt;
    #&lt;br /&gt;
    ecut=` grep &amp;quot;NGsBlkXp&amp;quot; $file | awk &#039;{print $4}&#039; `&lt;br /&gt;
    numG=` grep &amp;quot;used&amp;quot; $file |awk &#039;{print $5}&#039;`&lt;br /&gt;
    qp1=` cat $file | grep &amp;quot;^ *7 *8&amp;quot; |  awk &#039;{print $3+$4}&#039; `&lt;br /&gt;
    qp2=` cat $file | grep &amp;quot;^ *7 *9&amp;quot; |  awk &#039;{print $3+$4}&#039; `&lt;br /&gt;
    #&lt;br /&gt;
    echo $ecut $numG $qp1 $qp2 &amp;gt;&amp;gt; $fileout&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
===generate_inputs_2.sh  (GW Gbnd convergence input files) ===&lt;br /&gt;
 &lt;br /&gt;
 #!/bin/bash &lt;br /&gt;
 #&lt;br /&gt;
 # Gbnd convergence input files&lt;br /&gt;
 #&lt;br /&gt;
 bands=&#039;10 20 30 40 50 60 70 80&#039;&lt;br /&gt;
 for i in ${bands}&lt;br /&gt;
 do&lt;br /&gt;
   sed  -e &amp;quot;s/1 | 40/1 | $i/g&amp;quot;  gw_ppa_30b_3Ry.in  &amp;gt;  gw_ppa_Gbnd$i&#039;.in&#039;&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===generate_inputs_3.sh  (Real axis convergence input files)===&lt;br /&gt;
 #!/bin/bash &lt;br /&gt;
 bands=&#039;10 50 100 150 200 250&#039;&lt;br /&gt;
 for i in ${bands}&lt;br /&gt;
 do&lt;br /&gt;
   sed  -e &amp;quot;s/ETStpsXd= 100/ETStpsXd=$i/g&amp;quot;  gw_ff.in  &amp;gt;  gw_ff$i&#039;.in&#039;&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
= Silicon Tutorial =&lt;br /&gt;
&lt;br /&gt;
=== parse_gap.sh  (to parse the gap corrections) ===&lt;br /&gt;
 &lt;br /&gt;
 #!/bin/bash &lt;br /&gt;
 if [ ! -f GAMMA/References/$1 ]&lt;br /&gt;
 then&lt;br /&gt;
     echo &amp;quot;File not found&amp;quot;&lt;br /&gt;
     exit&lt;br /&gt;
 fi&lt;br /&gt;
 rm -f $2&lt;br /&gt;
 kpts=&#039;GAMMA 2x2x2 4x4x4 6x6x6 8x8x8&#039;&lt;br /&gt;
 NK=(1 8 64 216 512)&lt;br /&gt;
 j=0&lt;br /&gt;
 for i in ${kpts}&lt;br /&gt;
  do&lt;br /&gt;
    VBMo=`grep &amp;quot; 1.000&amp;quot; $i/References/$1 | grep &amp;quot; 4.0000&amp;quot; | grep &amp;quot; 0.000&amp;quot; | awk &#039;{print $3}&#039;`&lt;br /&gt;
    VBM=`grep &amp;quot; 1.000&amp;quot; $i/References/$1 | grep &amp;quot; 4.0000&amp;quot; | grep &amp;quot; 0.000&amp;quot; | awk &#039;{print $4}&#039;`&lt;br /&gt;
    CBMo=`grep &amp;quot; 2.576&amp;quot; $i/References/$1 | grep &amp;quot; 5.000&amp;quot; | awk &#039;{print $3}&#039;`&lt;br /&gt;
    CBM=`grep &amp;quot; 2.576&amp;quot; $i/References/$1 | grep &amp;quot; 5.000&amp;quot; | awk &#039;{print $4}&#039;`&lt;br /&gt;
    case &amp;quot;$1&amp;quot; in &lt;br /&gt;
     *-01HF*)&lt;br /&gt;
       echo  ${NK[$j]} $VBMo $VBM $CBMo $CBM | awk &#039;{print $1 &amp;quot; &amp;quot; $5-$3 }&#039; &amp;gt;&amp;gt;  &amp;quot;$2&amp;quot;&lt;br /&gt;
       ;;&lt;br /&gt;
     *-Cohsex*)&lt;br /&gt;
       echo  ${NK[$j]} $VBMo $VBM $CBMo $CBM | awk &#039;{print $1 &amp;quot; &amp;quot; ($4+$5)-($2+$3) }&#039; &amp;gt;&amp;gt;  &amp;quot;$2&amp;quot;&lt;br /&gt;
       ;;&lt;br /&gt;
    esac&lt;br /&gt;
    j=`expr $j + 1`&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
= Hydrogen chain tutorial =&lt;br /&gt;
&lt;br /&gt;
=== launch_xcrysden.sh ===&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 if [ $# != 1 ] ; then&lt;br /&gt;
  echo $0 &amp;quot;o- file&amp;quot;&lt;br /&gt;
  exit 0&lt;br /&gt;
 fi&lt;br /&gt;
 twoD=`echo $1 |grep &#039;2d&#039;`&lt;br /&gt;
 threeD=`echo $1 |grep &#039;3d&#039;`&lt;br /&gt;
 if test -n &amp;quot;$twoD&amp;quot;  ; then&lt;br /&gt;
  cp $1 file.xsf&lt;br /&gt;
  xcrysden -s ../Xcrysden_scripts2D.xcrysden&lt;br /&gt;
  rm -f file.xsf&lt;br /&gt;
 fi &lt;br /&gt;
 if test -n &amp;quot;$threeD&amp;quot;  ; then&lt;br /&gt;
  cp $1 file.xsf&lt;br /&gt;
  xcrysden -s ../Xcrysden_scripts/3D.xcrysden&lt;br /&gt;
  rm -f file.xsf&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
* [[Tutorials|Back to tutorials menu]]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=8334</id>
		<title>Silicon</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Silicon&amp;diff=8334"/>
		<updated>2025-01-17T11:28:41Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Daniele: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Plan for the ICTP 2020 school tutorials&lt;br /&gt;
&lt;br /&gt;
=== Setting up the Yambo Quantum Machine ===&lt;br /&gt;
The tutorials will be run on a dedicated Quantum Machine. This is run by installing it as Virtual Machine with the VirtualBox program.&lt;br /&gt;
&lt;br /&gt;
* VirtualBox is installed on your PC. To find it open a terminal and &lt;br /&gt;
 &amp;gt;which virtualbox&lt;br /&gt;
 /usr/bin/virtualbox&lt;br /&gt;
* The Yambo Quantum Machine image (.ova file) is already in the /scratch&lt;br /&gt;
 &amp;gt;cd /scratch&lt;br /&gt;
 &amp;gt;/scratch$ ls&lt;br /&gt;
 (...) &#039;&#039;&#039;YAMBO_Quantum_Mobile.ova&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now follow exactly the instructions to&lt;br /&gt;
* [[Yambo_Virtual_Machine#Install_the_Yambo_Quantum_Machine|Install the Yambo Quantum Machine]]&lt;br /&gt;
* [[Yambo_Virtual_Machine#Starting_the_Virtual_Machine|Start the Yambo Quantum Machine]]&lt;br /&gt;
* [[Yambo_Virtual_Machine#Updating_the_Yambo_tutorial_files|Update and install the Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Tutorial files ===&lt;br /&gt;
All tutorials require &#039;&#039;&#039;download&#039;&#039;&#039; of the following pre-prepared Yambo databases or DFT input files:&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 1-2-3.  &lt;br /&gt;
hBN-3D ([http://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz hBN.tar.gz], 237 MB) &lt;br /&gt;
and hBN-2D ([http://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz hBN-2D.tar.gz], 8.6 MB)&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 3. hBN-2D with higher convergence parameters for parallel tutorials &lt;br /&gt;
([http://media.yambo-code.eu/educational/tutorials/files/hBN-2D-para.tar.gz hBN-2D-para.tar.gz], 137 MB)&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 4. &lt;br /&gt;
hBN-2D ([http://media.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz hBN-2D-RT.tar.gz], 12 MB)&lt;br /&gt;
and AlAs for real time simulations ([http://media.yambo-code.eu/educational/tutorials/files/AlAs.tar.gz AlAs.tar.gz], 10 MB)&lt;br /&gt;
&lt;br /&gt;
After downloading the tar.gz files just unpack them in &#039;&#039;&#039;the same folder&#039;&#039;&#039;:&lt;br /&gt;
 $ tar -xcvf hBN-2D.tar&lt;br /&gt;
 $ tar -xcvf hBN.tar&lt;br /&gt;
 $ ls&lt;br /&gt;
   YAMBO_TUTORIALS&lt;br /&gt;
 $ ls YAMBO_TUTORIALS&lt;br /&gt;
   hBN-2D hBN&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monday 27 Jan HANDS-ON 1 ===&lt;br /&gt;
&#039;&#039;&#039;14:40 - 17:00 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039; Davide Sangalli (CNR-ISM, Italy), Pedro Melo (University of Liege, Belgium)&lt;br /&gt;
&amp;lt;!-- * [[First steps: a walk through from DFT to optical properties]] --&amp;gt;&lt;br /&gt;
* [[First steps: walk through from DFT to RPA (standalone)]]&lt;br /&gt;
&lt;br /&gt;
=== Tuesday 28 Jan HANDS-ON 2 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 18:00 A complete tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Andrea Ferretti (CNR-NANO, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[How to obtain the quasi-particle band structure of a bulk material: h-BN]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 18:00 A complete tour through GW simulation in a complex material (from the blackboard to the computer settings: convergence, algorithms, parallel usage) (continued)&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Andrea Ferretti (CNR-NANO, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[GW_parallel_strategies|Parallel GW]]: strategies for running Yambo in parallel&lt;br /&gt;
* [[Pushing_convergence_in_parallel|GW convergence]]: use Yambo in parallel to converge a GW calculation for a layer of hBN (hBN-2D)&lt;br /&gt;
&lt;br /&gt;
Link to old CECAM specific cases: [[GW_parallel_strategies_CECAM]] and [[Pushing_convergence_in_parallel_CECAM]]&lt;br /&gt;
&lt;br /&gt;
=== Wednesday 29 Jan HANDS-ON 3 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:00 A guided tour through calculations of spectroscopic properties using the BSE approach&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Maurizia Palummo (University of Rome Tor Vergata, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[How to obtain an optical spectrum|Calculating optical spectra including excitonic effects: a step-by-step guide]]&lt;br /&gt;
* [[How to choose the input parameters|Obtaining a converged optical spectrum]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 18:00 Many-body effects in 2D materials: convergences, exciton characterizations&#039;&#039;&#039; Maurizia Palummo (University of Rome Tor Vergata, Italy), Attaccalite Claudio (CNRS, CINAM, Aix-Marseille Univ., France)&lt;br /&gt;
&lt;br /&gt;
* [[How to treat low dimensional systems|Many-body effects in low-dimensional systems: numerical issues and remedies]] &lt;br /&gt;
* [[How to analyse excitons|Analysis of excitonic spectra in a 2D material]]&lt;br /&gt;
&lt;br /&gt;
=== Thursday 30 Jan HANDS-ON 4 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 15:00 Real-time approach and Calculation of linear response functions and optical properties&#039;&#039;&#039; Claudio Attaccalite (CNRS, CINAM, Aix-Marseille Univ., France), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[Linear response from real time simulations]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;15:30 - 18:00 Real time approach and Calculation of non linear properties (second harmonic generation) &#039;&#039;&#039; Claudio Attaccalite (CNRS, CINAM, Aix-Marseille Univ., France), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]]&lt;br /&gt;
* [[Correlation effects in the non-linear response]]&lt;br /&gt;
&lt;br /&gt;
=== Friday 31 Jan HANDS-ON 5 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;09:00 - 10:30 Python scripting tools for accelerated GW convergence &#039;&#039;&#039; Fulvio Paleari (CNR-ISM, Italy), Alejandro Molina-Sanchez (IINL, Portugal)&lt;br /&gt;
&lt;br /&gt;
* [[First steps in Yambopy]]&lt;br /&gt;
* [[GW tutorial. Convergence and approximations (BN)]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;10:30 - 11:30 Python scripting tools for BSE convergence and analysis &#039;&#039;&#039; Fulvio Paleari (CNR-ISM, Italy), Pedro Melo&lt;br /&gt;
&lt;br /&gt;
* [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]]&lt;br /&gt;
&lt;br /&gt;
=== Lectures ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Monday, 27 January: Excited-state properties in Many-Body Perturbation Theory (MBPT) &#039;&#039;&#039;&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/Yambo_general_plus_phylosophy_short.pdf Description and goals of the school: From theoretical concepts to real computation of the excited states properties of complex materials by first principle]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/Quantum_Mechanics_nutshell_and_Hartree-Fock.pdf Introduction to Many body perturbation theory]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/GW_implementations_and_approximtions.pdf Correlation and Diagrams]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/Heuristic_GW.pdf The GW method: an Heuristic approach]&lt;br /&gt;
&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/2020_YAMBO_Baroni.pdf Introduction to Material Science]&lt;br /&gt;
&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/Moras_ICTP2020.pdf Experimental lecture on photoemission spectroscopy]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/Linear_Response.pdf Beyond the independent particle scheme: The linear response theory]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Tuesday, 28 January: Electronic properties: from DFT to the quasi-particle equation and the GW method &#039;&#039;&#039;&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/2020_GW_ARPES.pdf The Quasi Particle concept and the GW method]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/GW_implementations_and_approximtions.pdf The GW scheme: common approximations and practical implementations]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/2020-Yamboschool_GWautomation_precision_accuracy_vanSetten.pdf High throughput calculations: from DFT to GW]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Wednesday, 29 January. Optical properties and the electron-hole interaction &#039;&#039;&#039;&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/Real_time_approach_to_the_BSE.pdf Derivation of the Bethe-Salpeter Equation and main physical concepts]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/BSE_hedin_prac.pdf The Bethe-Salpeter Equation: common approximations and practical implementations]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/lecture_2D_lwirtz.pdf Many Body effects in low dimensional materials]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Thursday, 30 January. Real time approaches for linear and non-linear optical propertiers &#039;&#039;&#039;&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/RealTime_Propagation_Lecture.pdf Real-time Many-Body simulation: propagating the density matrix]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/YamboSchool_Attaccalite.pdf Real-time Many-Body and Berry phase for non-linear optics]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=ICTP2020&amp;diff=8004</id>
		<title>ICTP2020</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=ICTP2020&amp;diff=8004"/>
		<updated>2024-06-24T06:04:34Z</updated>

		<summary type="html">&lt;p&gt;Daniele: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Plan for the ICTP 2020 school tutorials&lt;br /&gt;
&lt;br /&gt;
=== Setting up the Yambo Quantum Machine ===&lt;br /&gt;
The tutorials will be run on a dedicated Quantum Machine. This is run by installing it as Virtual Machine with the VirtualBox program.&lt;br /&gt;
&lt;br /&gt;
* VirtualBox is installed on your PC. To find it open a terminal and &lt;br /&gt;
 &amp;gt;which virtualbox&lt;br /&gt;
 /usr/bin/virtualbox&lt;br /&gt;
* The Yambo Quantum Machine image (.ova file) is already in the /scratch&lt;br /&gt;
 &amp;gt;cd /scratch&lt;br /&gt;
 &amp;gt;/scratch$ ls&lt;br /&gt;
 (...) &#039;&#039;&#039;YAMBO_Quantum_Mobile.ova&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now follow exactly the instructions to&lt;br /&gt;
* [[Yambo_Virtual_Machine#Install_the_Yambo_Quantum_Machine|Install the Yambo Quantum Machine]]&lt;br /&gt;
* [[Yambo_Virtual_Machine#Starting_the_Virtual_Machine|Start the Yambo Quantum Machine]]&lt;br /&gt;
* [[Yambo_Virtual_Machine#Updating_the_Yambo_tutorial_files|Update and install the Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Tutorial files ===&lt;br /&gt;
All tutorials require &#039;&#039;&#039;download&#039;&#039;&#039; of the following pre-prepared Yambo databases or DFT input files:&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 1-2-3.  &lt;br /&gt;
hBN-3D ([http://www.yambo-code.eu/educational/tutorials/files/hBN.tar.gz hBN.tar.gz], 237 MB) &lt;br /&gt;
and hBN-2D ([http://www.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz hBN-2D.tar.gz], 8.6 MB)&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 3. hBN-2D with higher convergence parameters for parallel tutorials &lt;br /&gt;
([http://www.yambo-code.eu/educational/tutorials/files/hBN-2D-para.tar.gz hBN-2D-para.tar.gz], 137 MB)&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 4. &lt;br /&gt;
hBN-2D ([http://www.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz hBN-2D-RT.tar.gz], 12 MB)&lt;br /&gt;
and AlAs for real time simulations ([http://www.yambo-code.eu/educational/tutorials/files/AlAs.tar.gz AlAs.tar.gz], 10 MB)&lt;br /&gt;
&lt;br /&gt;
After downloading the tar.gz files just unpack them in &#039;&#039;&#039;the same folder&#039;&#039;&#039;:&lt;br /&gt;
 $ tar -xcvf hBN-2D.tar&lt;br /&gt;
 $ tar -xcvf hBN.tar&lt;br /&gt;
 $ ls&lt;br /&gt;
   YAMBO_TUTORIALS&lt;br /&gt;
 $ ls YAMBO_TUTORIALS&lt;br /&gt;
   hBN-2D hBN&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monday 27 Jan HANDS-ON 1 ===&lt;br /&gt;
&#039;&#039;&#039;14:40 - 17:00 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039; Davide Sangalli (CNR-ISM, Italy), Pedro Melo (University of Liege, Belgium)&lt;br /&gt;
&amp;lt;!-- * [[First steps: a walk through from DFT to optical properties]] --&amp;gt;&lt;br /&gt;
* [[First steps: walk through from DFT to RPA (standalone)]]&lt;br /&gt;
&lt;br /&gt;
=== Tuesday 28 Jan HANDS-ON 2 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 18:00 A complete tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Andrea Ferretti (CNR-NANO, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[How to obtain the quasi-particle band structure of a bulk material: h-BN]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 18:00 A complete tour through GW simulation in a complex material (from the blackboard to the computer settings: convergence, algorithms, parallel usage) (continued)&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Andrea Ferretti (CNR-NANO, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[GW_parallel_strategies|Parallel GW]]: strategies for running Yambo in parallel&lt;br /&gt;
* [[Pushing_convergence_in_parallel|GW convergence]]: use Yambo in parallel to converge a GW calculation for a layer of hBN (hBN-2D)&lt;br /&gt;
&lt;br /&gt;
Link to old CECAM specific cases: [[GW_parallel_strategies_CECAM]] and [[Pushing_convergence_in_parallel_CECAM]]&lt;br /&gt;
&lt;br /&gt;
=== Wednesday 29 Jan HANDS-ON 3 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:00 A guided tour through calculations of spectroscopic properties using the BSE approach&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Maurizia Palummo (University of Rome Tor Vergata, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[How to obtain an optical spectrum|Calculating optical spectra including excitonic effects: a step-by-step guide]]&lt;br /&gt;
* [[How to choose the input parameters|Obtaining a converged optical spectrum]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 18:00 Many-body effects in 2D materials: convergences, exciton characterizations&#039;&#039;&#039; Maurizia Palummo (University of Rome Tor Vergata, Italy), Attaccalite Claudio (CNRS, CINAM, Aix-Marseille Univ., France)&lt;br /&gt;
&lt;br /&gt;
* [[How to treat low dimensional systems|Many-body effects in low-dimensional systems: numerical issues and remedies]] &lt;br /&gt;
* [[How to analyse excitons|Analysis of excitonic spectra in a 2D material]]&lt;br /&gt;
&lt;br /&gt;
=== Thursday 30 Jan HANDS-ON 4 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 15:00 Real-time approach and Calculation of linear response functions and optical properties&#039;&#039;&#039; Claudio Attaccalite (CNRS, CINAM, Aix-Marseille Univ., France), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[Linear response from real time simulations]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;15:30 - 18:00 Real time approach and Calculation of non linear properties (second harmonic generation) &#039;&#039;&#039; Claudio Attaccalite (CNRS, CINAM, Aix-Marseille Univ., France), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]]&lt;br /&gt;
* [[Correlation effects in the non-linear response]]&lt;br /&gt;
&lt;br /&gt;
=== Friday 31 Jan HANDS-ON 5 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;09:00 - 10:30 Python scripting tools for accelerated GW convergence &#039;&#039;&#039; Fulvio Paleari (CNR-ISM, Italy), Alejandro Molina-Sanchez (IINL, Portugal)&lt;br /&gt;
&lt;br /&gt;
* [[First steps in Yambopy]]&lt;br /&gt;
* [[GW tutorial. Convergence and approximations (BN)]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;10:30 - 11:30 Python scripting tools for BSE convergence and analysis &#039;&#039;&#039; Fulvio Paleari (CNR-ISM, Italy), Pedro Melo&lt;br /&gt;
&lt;br /&gt;
* [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]]&lt;br /&gt;
&lt;br /&gt;
=== Lectures ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Monday, 27 January: Excited-state properties in Many-Body Perturbation Theory (MBPT) &#039;&#039;&#039;&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Yambo_general_plus_phylosophy_short.pdf Description and goals of the school: From theoretical concepts to real computation of the excited states properties of complex materials by first principle]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Quantum_Mechanics_nutshell_and_Hartree-Fock.pdf Introduction to Many body perturbation theory]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/GW_implementations_and_approximtions.pdf Correlation and Diagrams]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Heuristic_GW.pdf The GW method: an Heuristic approach]&lt;br /&gt;
&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/2020_YAMBO_Baroni.pdf Introduction to Material Science]&lt;br /&gt;
&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Moras_ICTP2020.pdf Experimental lecture on photoemission spectroscopy]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Linear_Response.pdf Beyond the independent particle scheme: The linear response theory]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Tuesday, 28 January: Electronic properties: from DFT to the quasi-particle equation and the GW method &#039;&#039;&#039;&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/2020_GW_ARPES.pdf The Quasi Particle concept and the GW method]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/GW_implementations_and_approximtions.pdf The GW scheme: common approximations and practical implementations]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/2020-Yamboschool_GWautomation_precision_accuracy_vanSetten.pdf High throughput calculations: from DFT to GW]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Wednesday, 29 January. Optical properties and the electron-hole interaction &#039;&#039;&#039;&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Real_time_approach_to_the_BSE.pdf Derivation of the Bethe-Salpeter Equation and main physical concepts]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/BSE_hedin_prac.pdf The Bethe-Salpeter Equation: common approximations and practical implementations]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/lecture_2D_lwirtz.pdf Many Body effects in low dimensional materials]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Thursday, 30 January. Real time approaches for linear and non-linear optical propertiers &#039;&#039;&#039;&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/RealTime_Propagation_Lecture.pdf Real-time Many-Body simulation: propagating the density matrix]&lt;br /&gt;
* [http://media.yambo-code.eu/educational/Schools/ICTP2020/YamboSchool_Attaccalite.pdf Real-time Many-Body and Berry phase for non-linear optics]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=ICTP2020&amp;diff=8003</id>
		<title>ICTP2020</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=ICTP2020&amp;diff=8003"/>
		<updated>2024-06-24T06:00:08Z</updated>

		<summary type="html">&lt;p&gt;Daniele: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Plan for the ICTP 2020 school tutorials&lt;br /&gt;
&lt;br /&gt;
=== Setting up the Yambo Quantum Machine ===&lt;br /&gt;
The tutorials will be run on a dedicated Quantum Machine. This is run by installing it as Virtual Machine with the VirtualBox program.&lt;br /&gt;
&lt;br /&gt;
* VirtualBox is installed on your PC. To find it open a terminal and &lt;br /&gt;
 &amp;gt;which virtualbox&lt;br /&gt;
 /usr/bin/virtualbox&lt;br /&gt;
* The Yambo Quantum Machine image (.ova file) is already in the /scratch&lt;br /&gt;
 &amp;gt;cd /scratch&lt;br /&gt;
 &amp;gt;/scratch$ ls&lt;br /&gt;
 (...) &#039;&#039;&#039;YAMBO_Quantum_Mobile.ova&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now follow exactly the instructions to&lt;br /&gt;
* [[Yambo_Virtual_Machine#Install_the_Yambo_Quantum_Machine|Install the Yambo Quantum Machine]]&lt;br /&gt;
* [[Yambo_Virtual_Machine#Starting_the_Virtual_Machine|Start the Yambo Quantum Machine]]&lt;br /&gt;
* [[Yambo_Virtual_Machine#Updating_the_Yambo_tutorial_files|Update and install the Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Tutorial files ===&lt;br /&gt;
All tutorials require &#039;&#039;&#039;download&#039;&#039;&#039; of the following pre-prepared Yambo databases or DFT input files:&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 1-2-3.  &lt;br /&gt;
hBN-3D ([http://www.yambo-code.eu/educational/tutorials/files/hBN.tar.gz hBN.tar.gz], 237 MB) &lt;br /&gt;
and hBN-2D ([http://www.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz hBN-2D.tar.gz], 8.6 MB)&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 3. hBN-2D with higher convergence parameters for parallel tutorials &lt;br /&gt;
([http://www.yambo-code.eu/educational/tutorials/files/hBN-2D-para.tar.gz hBN-2D-para.tar.gz], 137 MB)&amp;lt;br&amp;gt;&lt;br /&gt;
DAY 4. &lt;br /&gt;
hBN-2D ([http://www.yambo-code.eu/educational/tutorials/files/hBN-2D-RT.tar.gz hBN-2D-RT.tar.gz], 12 MB)&lt;br /&gt;
and AlAs for real time simulations ([http://www.yambo-code.eu/educational/tutorials/files/AlAs.tar.gz AlAs.tar.gz], 10 MB)&lt;br /&gt;
&lt;br /&gt;
After downloading the tar.gz files just unpack them in &#039;&#039;&#039;the same folder&#039;&#039;&#039;:&lt;br /&gt;
 $ tar -xcvf hBN-2D.tar&lt;br /&gt;
 $ tar -xcvf hBN.tar&lt;br /&gt;
 $ ls&lt;br /&gt;
   YAMBO_TUTORIALS&lt;br /&gt;
 $ ls YAMBO_TUTORIALS&lt;br /&gt;
   hBN-2D hBN&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monday 27 Jan HANDS-ON 1 ===&lt;br /&gt;
&#039;&#039;&#039;14:40 - 17:00 From the DFT ground state to the complete setup of a Many Body calculation using Yambo&#039;&#039;&#039; Davide Sangalli (CNR-ISM, Italy), Pedro Melo (University of Liege, Belgium)&lt;br /&gt;
&amp;lt;!-- * [[First steps: a walk through from DFT to optical properties]] --&amp;gt;&lt;br /&gt;
* [[First steps: walk through from DFT to RPA (standalone)]]&lt;br /&gt;
&lt;br /&gt;
=== Tuesday 28 Jan HANDS-ON 2 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 18:00 A complete tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Andrea Ferretti (CNR-NANO, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[How to obtain the quasi-particle band structure of a bulk material: h-BN]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 18:00 A complete tour through GW simulation in a complex material (from the blackboard to the computer settings: convergence, algorithms, parallel usage) (continued)&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Andrea Ferretti (CNR-NANO, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[GW_parallel_strategies|Parallel GW]]: strategies for running Yambo in parallel&lt;br /&gt;
* [[Pushing_convergence_in_parallel|GW convergence]]: use Yambo in parallel to converge a GW calculation for a layer of hBN (hBN-2D)&lt;br /&gt;
&lt;br /&gt;
Link to old CECAM specific cases: [[GW_parallel_strategies_CECAM]] and [[Pushing_convergence_in_parallel_CECAM]]&lt;br /&gt;
&lt;br /&gt;
=== Wednesday 29 Jan HANDS-ON 3 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 16:00 A guided tour through calculations of spectroscopic properties using the BSE approach&#039;&#039;&#039; Daniele Varsano (CNR-NANO, Italy), Maurizia Palummo (University of Rome Tor Vergata, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[How to obtain an optical spectrum|Calculating optical spectra including excitonic effects: a step-by-step guide]]&lt;br /&gt;
* [[How to choose the input parameters|Obtaining a converged optical spectrum]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;16:30 - 18:00 Many-body effects in 2D materials: convergences, exciton characterizations&#039;&#039;&#039; Maurizia Palummo (University of Rome Tor Vergata, Italy), Attaccalite Claudio (CNRS, CINAM, Aix-Marseille Univ., France)&lt;br /&gt;
&lt;br /&gt;
* [[How to treat low dimensional systems|Many-body effects in low-dimensional systems: numerical issues and remedies]] &lt;br /&gt;
* [[How to analyse excitons|Analysis of excitonic spectra in a 2D material]]&lt;br /&gt;
&lt;br /&gt;
=== Thursday 30 Jan HANDS-ON 4 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;14:00 - 15:00 Real-time approach and Calculation of linear response functions and optical properties&#039;&#039;&#039; Claudio Attaccalite (CNRS, CINAM, Aix-Marseille Univ., France), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[Linear response from real time simulations]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;15:30 - 18:00 Real time approach and Calculation of non linear properties (second harmonic generation) &#039;&#039;&#039; Claudio Attaccalite (CNRS, CINAM, Aix-Marseille Univ., France), Davide Sangalli (CNR-ISM, Italy)&lt;br /&gt;
&lt;br /&gt;
* [[Real time approach to non-linear response]]&lt;br /&gt;
* [[Correlation effects in the non-linear response]]&lt;br /&gt;
&lt;br /&gt;
=== Friday 31 Jan HANDS-ON 5 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;09:00 - 10:30 Python scripting tools for accelerated GW convergence &#039;&#039;&#039; Fulvio Paleari (CNR-ISM, Italy), Alejandro Molina-Sanchez (IINL, Portugal)&lt;br /&gt;
&lt;br /&gt;
* [[First steps in Yambopy]]&lt;br /&gt;
* [[GW tutorial. Convergence and approximations (BN)]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;10:30 - 11:30 Python scripting tools for BSE convergence and analysis &#039;&#039;&#039; Fulvio Paleari (CNR-ISM, Italy), Pedro Melo&lt;br /&gt;
&lt;br /&gt;
* [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]]&lt;br /&gt;
&lt;br /&gt;
=== Lectures ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Monday, 27 January: Excited-state properties in Many-Body Perturbation Theory (MBPT) &#039;&#039;&#039;&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Yambo_general_plus_phylosophy_short.pdf Description and goals of the school: From theoretical concepts to real computation of the excited states properties of complex materials by first principle]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Quantum_Mechanics_nutshell_and_Hartree-Fock.pdf Introduction to Many body perturbation theory]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/GW_implementations_and_approximtions.pdf Correlation and Diagrams]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Heuristic_GW.pdf The GW method: an Heuristic approach]&lt;br /&gt;
&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/2020_YAMBO_Baroni.pdf Introduction to Material Science]&lt;br /&gt;
&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Moras_ICTP2020.pdf Experimental lecture on photoemission spectroscopy]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Linear_Response.pdf Beyond the independent particle scheme: The linear response theory]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Tuesday, 28 January: Electronic properties: from DFT to the quasi-particle equation and the GW method &#039;&#039;&#039;&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/2020_GW_ARPES.pdf The Quasi Particle concept and the GW method]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/GW_implementations_and_approximtions.pdf The GW scheme: common approximations and practical implementations]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/2020-Yamboschool_GWautomation_precision_accuracy_vanSetten.pdf High throughput calculations: from DFT to GW]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Wednesday, 29 January. Optical properties and the electron-hole interaction &#039;&#039;&#039;&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/Real_time_approach_to_the_BSE.pdf Derivation of the Bethe-Salpeter Equation and main physical concepts]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/BSE_hedin_prac.pdf The Bethe-Salpeter Equation: common approximations and practical implementations]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/lecture_2D_lwirtz.pdf Many Body effects in low dimensional materials]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Thursday, 30 January. Real time approaches for linear and non-linear optical propertiers &#039;&#039;&#039;&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/RealTime_Propagation_Lecture.pdf Real-time Many-Body simulation: propagating the density matrix]&lt;br /&gt;
* [http://www.yambo-code.eu/educational/Schools/ICTP2020/YamboSchool_Attaccalite.pdf Real-time Many-Body and Berry phase for non-linear optics]&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_in_IRENE_machine_(TGCC_Joliot_Curie)&amp;diff=7904</id>
		<title>Install Yambo in IRENE machine (TGCC Joliot Curie)</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_in_IRENE_machine_(TGCC_Joliot_Curie)&amp;diff=7904"/>
		<updated>2024-05-09T11:12:22Z</updated>

		<summary type="html">&lt;p&gt;Daniele: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this page we explain how to configure compile and run Yambo on the IRENE machine on [https://www-hpc.cea.fr/en/complexe/tgcc-JoliotCurie.htm TGCC Joliot Curie].&lt;br /&gt;
This page referees to the last available version [https://github.com/yambo-code/yambo/wiki/Releases-%28tar.gz-format%29 Yambo 5.1.1] &lt;br /&gt;
&lt;br /&gt;
Since Yambo needs some libraries, and these libraries cannot be downloaded directly from IRENE, &lt;br /&gt;
first of all you have to run in your local machine:&lt;br /&gt;
&lt;br /&gt;
 wget https://github.com/yambo-code/yambo/archive/refs/tags/5.1.1.tar.gz -O yambo-5.1.1.tar.gz &lt;br /&gt;
 tar zxvf yambo-5.1.1.tar.gz&lt;br /&gt;
 cd yambo-5.1.1&lt;br /&gt;
 git clone https://github.com/yambo-code/yambo-libraries.git lib/yambo&lt;br /&gt;
 ./configure&lt;br /&gt;
 make download # this command download all the libs in the directory lib/archive&lt;br /&gt;
 cd ..&lt;br /&gt;
 tar zxvf yambo_with_libs.tgz yambo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can copy the file yambo_with_libs.tgz on the cluster and use it for the compilation.&lt;br /&gt;
Then you load the following modules:&lt;br /&gt;
&lt;br /&gt;
 module load hdf5/1.8.20&lt;br /&gt;
 module load blas/mkl/20.0.0&lt;br /&gt;
 module load netcdf-c/4.6.0&lt;br /&gt;
 module load netcdf-fortran/4.4.4&lt;br /&gt;
 &lt;br /&gt;
and then configure Yambo with the command:&lt;br /&gt;
&lt;br /&gt;
 ./configure FC=ifort F77=ifort CC=icc MPIF77=mpif90 MPICC=mpicc MPIFC=mpif90 --enable-par-linalg \&lt;br /&gt;
 --enable-open-mp --with-scalapack-libs=mkl --with-blacs-libs=mkl \&lt;br /&gt;
 --with-netcdf-includedir=${NETCDF_INCDIR}  --with-netcdf-libs=&amp;quot;${NETCDF_LDFLAGS}&amp;quot; \&lt;br /&gt;
 --with-netcdff-includedir=${NETCDFFORTRAN_INCDIR}  --with-netcdff-libs=&amp;quot;${NETCDFFORTRAN_LDFLAGS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and now you can compile with&lt;br /&gt;
&lt;br /&gt;
 make core&lt;br /&gt;
&lt;br /&gt;
In order to run Yambo you have to disable the profile on the IRENE machine,&lt;br /&gt;
that for some unknown reason creates problem with Yambo. &lt;br /&gt;
In the shell type these command before submitting the job:&lt;br /&gt;
&lt;br /&gt;
 export SELFIE_MSUB=0&lt;br /&gt;
 export SELFIE_MPRUN=0&lt;br /&gt;
&lt;br /&gt;
then you can submite the job:&lt;br /&gt;
&lt;br /&gt;
 ccc_msub job.sh&lt;br /&gt;
&lt;br /&gt;
a typical job file is:&lt;br /&gt;
  &lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #MSUB -r TEST_yambo&lt;br /&gt;
 #MSUB -q rome &lt;br /&gt;
 #MSUB -n 32&lt;br /&gt;
 #MSUB -A gen13493&lt;br /&gt;
 #MSUB -m scratch&lt;br /&gt;
 #MSUB -T 86400&lt;br /&gt;
 #MSUB -x&lt;br /&gt;
 #MSUB -@ your_email@your_istitution.com&lt;br /&gt;
 &lt;br /&gt;
 OMP_NUM_THREADS=1&lt;br /&gt;
 &lt;br /&gt;
 module load hdf5/1.8.20&lt;br /&gt;
 module load blas/mkl/20.0.0&lt;br /&gt;
 module load netcdf-c/4.6.0&lt;br /&gt;
 module load netcdf-fortran/4.4.4&lt;br /&gt;
 &lt;br /&gt;
 ccc_mprun ./yambo -F my_yambo_input.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;N.B.&#039;&#039;&#039; We are working on SLEPC and PETSC configuration with Yambo on IRENE, we will update this page soon.&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_in_IRENE_machine_(TGCC_Joliot_Curie)&amp;diff=7903</id>
		<title>Install Yambo in IRENE machine (TGCC Joliot Curie)</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_in_IRENE_machine_(TGCC_Joliot_Curie)&amp;diff=7903"/>
		<updated>2024-05-09T11:11:56Z</updated>

		<summary type="html">&lt;p&gt;Daniele: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this page we explain how to configure compile and run Yambo on the IRENE machine on [https://www-hpc.cea.fr/en/complexe/tgcc-JoliotCurie.htm TGCC Joliot Curie].&lt;br /&gt;
This page referees to the last available version [https://github.com/yambo-code/yambo/wiki/Releases-%28tar.gz-format%29 Yambo 5.1.1] &lt;br /&gt;
&lt;br /&gt;
Since Yambo needs some libraries, and these libraries cannot be downloaded directly from IRENE, &lt;br /&gt;
first of all you have to run in your local machine:&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
 wget https://github.com/yambo-code/yambo/archive/refs/tags/5.1.1.tar.gz -O yambo-5.1.1.tar.gz &lt;br /&gt;
 tar zxvf yambo-5.1.1.tar.gz&lt;br /&gt;
 cd yambo-5.1.1&lt;br /&gt;
 git clone https://github.com/yambo-code/yambo-libraries.git lib/yambo&lt;br /&gt;
 ./configure&lt;br /&gt;
 make download # this command download all the libs in the directory lib/archive&lt;br /&gt;
 cd ..&lt;br /&gt;
 tar zxvf yambo_with_libs.tgz yambo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can copy the file yambo_with_libs.tgz on the cluster and use it for the compilation.&lt;br /&gt;
Then you load the following modules:&lt;br /&gt;
&lt;br /&gt;
 module load hdf5/1.8.20&lt;br /&gt;
 module load blas/mkl/20.0.0&lt;br /&gt;
 module load netcdf-c/4.6.0&lt;br /&gt;
 module load netcdf-fortran/4.4.4&lt;br /&gt;
 &lt;br /&gt;
and then configure Yambo with the command:&lt;br /&gt;
&lt;br /&gt;
 ./configure FC=ifort F77=ifort CC=icc MPIF77=mpif90 MPICC=mpicc MPIFC=mpif90 --enable-par-linalg \&lt;br /&gt;
 --enable-open-mp --with-scalapack-libs=mkl --with-blacs-libs=mkl \&lt;br /&gt;
 --with-netcdf-includedir=${NETCDF_INCDIR}  --with-netcdf-libs=&amp;quot;${NETCDF_LDFLAGS}&amp;quot; \&lt;br /&gt;
 --with-netcdff-includedir=${NETCDFFORTRAN_INCDIR}  --with-netcdff-libs=&amp;quot;${NETCDFFORTRAN_LDFLAGS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and now you can compile with&lt;br /&gt;
&lt;br /&gt;
 make core&lt;br /&gt;
&lt;br /&gt;
In order to run Yambo you have to disable the profile on the IRENE machine,&lt;br /&gt;
that for some unknown reason creates problem with Yambo. &lt;br /&gt;
In the shell type these command before submitting the job:&lt;br /&gt;
&lt;br /&gt;
 export SELFIE_MSUB=0&lt;br /&gt;
 export SELFIE_MPRUN=0&lt;br /&gt;
&lt;br /&gt;
then you can submite the job:&lt;br /&gt;
&lt;br /&gt;
 ccc_msub job.sh&lt;br /&gt;
&lt;br /&gt;
a typical job file is:&lt;br /&gt;
  &lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #MSUB -r TEST_yambo&lt;br /&gt;
 #MSUB -q rome &lt;br /&gt;
 #MSUB -n 32&lt;br /&gt;
 #MSUB -A gen13493&lt;br /&gt;
 #MSUB -m scratch&lt;br /&gt;
 #MSUB -T 86400&lt;br /&gt;
 #MSUB -x&lt;br /&gt;
 #MSUB -@ your_email@your_istitution.com&lt;br /&gt;
 &lt;br /&gt;
 OMP_NUM_THREADS=1&lt;br /&gt;
 &lt;br /&gt;
 module load hdf5/1.8.20&lt;br /&gt;
 module load blas/mkl/20.0.0&lt;br /&gt;
 module load netcdf-c/4.6.0&lt;br /&gt;
 module load netcdf-fortran/4.4.4&lt;br /&gt;
 &lt;br /&gt;
 ccc_mprun ./yambo -F my_yambo_input.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;N.B.&#039;&#039;&#039; We are working on SLEPC and PETSC configuration with Yambo on IRENE, we will update this page soon.&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_in_IRENE_machine_(TGCC_Joliot_Curie)&amp;diff=7902</id>
		<title>Install Yambo in IRENE machine (TGCC Joliot Curie)</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_in_IRENE_machine_(TGCC_Joliot_Curie)&amp;diff=7902"/>
		<updated>2024-05-09T11:11:38Z</updated>

		<summary type="html">&lt;p&gt;Daniele: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this page we explain how to configure compile and run Yambo on the IRENE machine on [https://www-hpc.cea.fr/en/complexe/tgcc-JoliotCurie.htm TGCC Joliot Curie].&lt;br /&gt;
This page referees to the last available version [https://github.com/yambo-code/yambo/wiki/Releases-%28tar.gz-format%29 Yambo 5.1.1] &lt;br /&gt;
&lt;br /&gt;
Since Yambo needs some libraries, and these libraries cannot be downloaded directly from IRENE, &lt;br /&gt;
first of all you have to run in your local machine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://github.com/yambo-code/yambo/archive/refs/tags/5.1.1.tar.gz -O yambo-5.1.1.tar.gz &lt;br /&gt;
 tar zxvf yambo-5.1.1.tar.gz&lt;br /&gt;
 cd yambo-5.1.1&lt;br /&gt;
 git clone https://github.com/yambo-code/yambo-libraries.git lib/yambo&lt;br /&gt;
 ./configure&lt;br /&gt;
 make download # this command download all the libs in the directory lib/archive&lt;br /&gt;
 cd ..&lt;br /&gt;
 tar zxvf yambo_with_libs.tgz yambo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can copy the file yambo_with_libs.tgz on the cluster and use it for the compilation.&lt;br /&gt;
Then you load the following modules:&lt;br /&gt;
&lt;br /&gt;
 module load hdf5/1.8.20&lt;br /&gt;
 module load blas/mkl/20.0.0&lt;br /&gt;
 module load netcdf-c/4.6.0&lt;br /&gt;
 module load netcdf-fortran/4.4.4&lt;br /&gt;
 &lt;br /&gt;
and then configure Yambo with the command:&lt;br /&gt;
&lt;br /&gt;
 ./configure FC=ifort F77=ifort CC=icc MPIF77=mpif90 MPICC=mpicc MPIFC=mpif90 --enable-par-linalg \&lt;br /&gt;
 --enable-open-mp --with-scalapack-libs=mkl --with-blacs-libs=mkl \&lt;br /&gt;
 --with-netcdf-includedir=${NETCDF_INCDIR}  --with-netcdf-libs=&amp;quot;${NETCDF_LDFLAGS}&amp;quot; \&lt;br /&gt;
 --with-netcdff-includedir=${NETCDFFORTRAN_INCDIR}  --with-netcdff-libs=&amp;quot;${NETCDFFORTRAN_LDFLAGS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and now you can compile with&lt;br /&gt;
&lt;br /&gt;
 make core&lt;br /&gt;
&lt;br /&gt;
In order to run Yambo you have to disable the profile on the IRENE machine,&lt;br /&gt;
that for some unknown reason creates problem with Yambo. &lt;br /&gt;
In the shell type these command before submitting the job:&lt;br /&gt;
&lt;br /&gt;
 export SELFIE_MSUB=0&lt;br /&gt;
 export SELFIE_MPRUN=0&lt;br /&gt;
&lt;br /&gt;
then you can submite the job:&lt;br /&gt;
&lt;br /&gt;
 ccc_msub job.sh&lt;br /&gt;
&lt;br /&gt;
a typical job file is:&lt;br /&gt;
  &lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #MSUB -r TEST_yambo&lt;br /&gt;
 #MSUB -q rome &lt;br /&gt;
 #MSUB -n 32&lt;br /&gt;
 #MSUB -A gen13493&lt;br /&gt;
 #MSUB -m scratch&lt;br /&gt;
 #MSUB -T 86400&lt;br /&gt;
 #MSUB -x&lt;br /&gt;
 #MSUB -@ your_email@your_istitution.com&lt;br /&gt;
 &lt;br /&gt;
 OMP_NUM_THREADS=1&lt;br /&gt;
 &lt;br /&gt;
 module load hdf5/1.8.20&lt;br /&gt;
 module load blas/mkl/20.0.0&lt;br /&gt;
 module load netcdf-c/4.6.0&lt;br /&gt;
 module load netcdf-fortran/4.4.4&lt;br /&gt;
 &lt;br /&gt;
 ccc_mprun ./yambo -F my_yambo_input.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;N.B.&#039;&#039;&#039; We are working on SLEPC and PETSC configuration with Yambo on IRENE, we will update this page soon.&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
	<entry>
		<id>https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_in_IRENE_machine_(TGCC_Joliot_Curie)&amp;diff=7901</id>
		<title>Install Yambo in IRENE machine (TGCC Joliot Curie)</title>
		<link rel="alternate" type="text/html" href="https://wiki.yambo-code.eu/wiki/index.php?title=Install_Yambo_in_IRENE_machine_(TGCC_Joliot_Curie)&amp;diff=7901"/>
		<updated>2024-05-09T11:11:23Z</updated>

		<summary type="html">&lt;p&gt;Daniele: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this page we explain how to configure compile and run Yambo on the IRENE machine on [https://www-hpc.cea.fr/en/complexe/tgcc-JoliotCurie.htm TGCC Joliot Curie].&lt;br /&gt;
This page referees to the last available version [https://github.com/yambo-code/yambo/wiki/Releases-%28tar.gz-format%29 Yambo 5.1.1] &lt;br /&gt;
&lt;br /&gt;
Since Yambo needs some libraries, and these libraries cannot be downloaded directly from IRENE, &lt;br /&gt;
first of all you have to run in your local machine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://github.com/yambo-code/yambo/archive/refs/tags/5.1.1.tar.gz -O yambo-5.1.1.tar.gz &lt;br /&gt;
 tar zxvf yambo-5.1.1.tar.gz&lt;br /&gt;
 cd yambo-5.1.1&lt;br /&gt;
 git clone https://github.com/yambo-code/yambo-libraries.git lib/yambo&lt;br /&gt;
 ./configure&lt;br /&gt;
 make download # this command download all the libs in the directory lib/archive&lt;br /&gt;
 cd ..&lt;br /&gt;
 tar zxvf yambo_with_libs.tgz yambo&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now you can copy the file yambo_with_libs.tgz on the cluster and use it for the compilation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then you load the following modules:&lt;br /&gt;
&lt;br /&gt;
 module load hdf5/1.8.20&lt;br /&gt;
 module load blas/mkl/20.0.0&lt;br /&gt;
 module load netcdf-c/4.6.0&lt;br /&gt;
 module load netcdf-fortran/4.4.4&lt;br /&gt;
 &lt;br /&gt;
and then configure Yambo with the command:&lt;br /&gt;
&lt;br /&gt;
 ./configure FC=ifort F77=ifort CC=icc MPIF77=mpif90 MPICC=mpicc MPIFC=mpif90 --enable-par-linalg \&lt;br /&gt;
 --enable-open-mp --with-scalapack-libs=mkl --with-blacs-libs=mkl \&lt;br /&gt;
 --with-netcdf-includedir=${NETCDF_INCDIR}  --with-netcdf-libs=&amp;quot;${NETCDF_LDFLAGS}&amp;quot; \&lt;br /&gt;
 --with-netcdff-includedir=${NETCDFFORTRAN_INCDIR}  --with-netcdff-libs=&amp;quot;${NETCDFFORTRAN_LDFLAGS}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and now you can compile with&lt;br /&gt;
&lt;br /&gt;
 make core&lt;br /&gt;
&lt;br /&gt;
In order to run Yambo you have to disable the profile on the IRENE machine,&lt;br /&gt;
that for some unknown reason creates problem with Yambo. &lt;br /&gt;
In the shell type these command before submitting the job:&lt;br /&gt;
&lt;br /&gt;
 export SELFIE_MSUB=0&lt;br /&gt;
 export SELFIE_MPRUN=0&lt;br /&gt;
&lt;br /&gt;
then you can submite the job:&lt;br /&gt;
&lt;br /&gt;
 ccc_msub job.sh&lt;br /&gt;
&lt;br /&gt;
a typical job file is:&lt;br /&gt;
  &lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #MSUB -r TEST_yambo&lt;br /&gt;
 #MSUB -q rome &lt;br /&gt;
 #MSUB -n 32&lt;br /&gt;
 #MSUB -A gen13493&lt;br /&gt;
 #MSUB -m scratch&lt;br /&gt;
 #MSUB -T 86400&lt;br /&gt;
 #MSUB -x&lt;br /&gt;
 #MSUB -@ your_email@your_istitution.com&lt;br /&gt;
 &lt;br /&gt;
 OMP_NUM_THREADS=1&lt;br /&gt;
 &lt;br /&gt;
 module load hdf5/1.8.20&lt;br /&gt;
 module load blas/mkl/20.0.0&lt;br /&gt;
 module load netcdf-c/4.6.0&lt;br /&gt;
 module load netcdf-fortran/4.4.4&lt;br /&gt;
 &lt;br /&gt;
 ccc_mprun ./yambo -F my_yambo_input.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;N.B.&#039;&#039;&#039; We are working on SLEPC and PETSC configuration with Yambo on IRENE, we will update this page soon.&lt;/div&gt;</summary>
		<author><name>Daniele</name></author>
	</entry>
</feed>