Tutorials: Difference between revisions
Line 209: | Line 209: | ||
* [[Yambopy tutorial: band structures]] | * [[Yambopy tutorial: band structures]] | ||
* [[Yambopy tutorial: Yambo databases]] | * [[Yambopy tutorial: Yambo databases]] | ||
* [[GW tutorial. Convergence and approximations (BN)]] | * [[Yambopy][GW tutorial. Convergence and approximations (BN)]] | ||
* [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]] | * [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]] | ||
Revision as of 14:32, 15 June 2023
If you are starting out with Yambo, or even an experienced user, we recommend that you complete the following tutorials before trying to use Yambo for your system.
The tutorials are meant to give some introductory background to the key concepts behind Yambo. Practical topics such as convergence are also discussed. Nonetheless, users are invited to first read and study the background material in order to get familiar with the fundamental physical quantities.
Two kinds of tutorials are provided: stand-alone and modular. In addition you must have a working environment where both Yambo (and eventually QE) are installed.
Setting up Yambo (and eventually QE)
To be able to follow the school you need a running version of the yambo/QE code.
There are several different ways to prepare a working environment.
Virtual Machine(s)
The easiest way is to access to a virtual machine which contains both (i) yambo/QE and (ii) the tutorials.
You can do it in one of two ways:
- Virtual machine via ICTP cloud If the schools you are attending provided an ICTP virtual machine this is the preferred option. It works through internet connection inside a browser.
- Install the yambo virtual machine on your laptop / desktop. This requires Oracle virtual box. Pre-download of the Virtual machine. No internet connection needed.
User installation
You can also setup the yambo code on your on laptop / desktop using different methods.
As far as the Yambo source is concerned you can:
- Install Yambo via Docker
- Download and install yambo on your laptop / desktop (requires a linux machine).
- Install yambo on your laptop/desktop/cluster via Spack.
- Install using Anaconda.
Yambo User Installation with Anaconda
It is possible to install Yambo (up to v5.0.4) and Quantum-ESPRESSO via conda-forge (a conda channel/repository): To setup Anaconda, please start from installing Anaconda or Miniconda.
Then we suggest to create a conda environment and activate it:
conda create --name yambopy -c conda-forge conda activate yambopy
Then you can install the prerequisites and the two codes:
conda install numpy scipy netcdf4 matplotlib pyyaml lxml pandas conda install yambo conda install qe
Setting up Yambopy
Quick installation
A quick way to start using Yambopy is described here.
- Make sure that you are using Python 3 and that you have the following python packages:
numpy
,scipy
,matplotlib
,netCDF4
,lxml
,pyyaml
. Optionally, you may want to have abipy [[1]] installed for band structure interpolations.
- Go to a directory of your choice and clone yambopy from the git repository
git clone https://github.com/yambo-code/yambopy.git
If you don't want to use git, you may download a tarball from the git repository instead.
- Enter into the yambopy folder and install
cd yambopy sudo python setup.py install
If you don't have administrative privileges (for example on a computing cluster), type instead
cd yambopy python setup.py install --user
Installing dependencies with Anaconda
We suggest installing yambopy using Anaconda [[2]] to manage the various python packages.
In this case, you can follow these steps.
First, install the required dependencies:
conda install numpy scipy netcdf4 lxml pyyaml
Then we create a conda environment based on python 3.6 (this is to ensure compatibility with abipy if we want to install it later on):
conda create --name NAME_ENV python=3.6
Here choose NAME_ENV
as you want, e.g. yenv
.
Now, we install abipy and its dependency pymatgen using pip
. Here make sure that you are using the pip
version provided by Anaconda and not your system version.
pip install pymatgen pip install abipy
Finally, we are ready to install yambopy:
git clone https://github.com/yambo-code/yambopy.git
(or download and extract tarball) and follow the steps outlined in the quick installation section.
Now enter into the yambopy folder and install
cd yambopy sudo python setup.py install
If you don't have administrative privileges (for example on a computing cluster), type instead
cd yambopy python setup.py install --user
Frequent issues
When running the installation you may get a SyntaxError
related to utf-8 encoding or it may complain that module setuptools
is not installed even though it is. In this case, it means that the sudo
command is not preserving the correct PATH
for your python executable.
Solve the problem by running the installation step as
sudo /your/path/to/python setup.py install
or
sudo env PATH=$PATH python setup.py install
This applies only to the installation step and not to subsequent yambopy use.
Tutorial files
The tutorial CORE databases can be obtained
- from the Yambo Virtual Machine
- from the Yambo web-page
- from the Yambo GIT tutorial repository
From the Yambo Virtual Machine (VM)
If you are using the VM, a recent version of the tutorial files is provided.Follow these instructions to update the tutorial files to the most recent version.
From the Yambo website
If you are using your own installation or the docker, the files needed to run the tutorials can be downloaded from the lists below.
After downloading the tar.gz files just unpack them in the YAMBO_TUTORIALS folder. For example
$ mkdir YAMBO_TUTORIALS $ mv hBN.tar.gz YAMBO_TUTORIALS $ cd YAMBO_TUTORIALS $ tar -xvfz hBN.tar.gz $ ls YAMBO_TUTORIALS hBN
Files needed for modular tutorials
All of the following should be downloaded prior to following the modular tutorials:
Tutorial | File(s) |
---|---|
hBN | hBN.tar.gz |
hBN-convergence-kpoints.tar.gz | |
hBN-2D.tar.gz | |
hBN-2D-para.tar.gz |
Files needed for stand-alone tutorials
At the start of each tutorial you will be told which specific file needs to be downloaded:
Tutorial | File(s) |
---|---|
Silicon | Silicon.tar.gz |
Silicon_Electron-Phonon.tar.gz | |
LiF | LiF.tar.gz |
Aluminum | Aluminum.tar.gz |
GaSb | GaSb.tar.gz |
AlAs | AlAs.tar.gz |
Hydrogen_Chain | Hydrogen_Chain.tar.gz |
MoS2 for HPC | MoS2_HPC_tutorial.tar.gz |
MoS2 for HPC shorter version | MoS2_2Dquasiparticle_tutorial.tar.gz |
Yambopy for QE | databases_qepy |
Yambopy for YAMBO | databases_yambopy |
From the Git Tutorial Repository (advanced users)
If you are using your own installation or the docker, the tutorials repository contains the updated tutorials CORE databases. To use it
$ git clone https://github.com/yambo-code/tutorials.git YAMBO_TUTORIALS $ cd YAMBO_TUTORIALS $ ./setup.pl -install
Stand-alone tutorials
These tutorials are self-contained and cover a variety of mixed topics, both physical and methodological. They are designed to be followed from start to finish in one page and do not require previous knowledge of yambo. Each tutorial requires download of a specific core database, and typically they cover a specific physical system (like bulk GaSb or a hydrogen chain). Ground state input files and pseudopotentials are provided. Output files are also provided for reference.
These tutorials can be accessed directly from this page of from the side bar. They include different kind of subjects:
Warning: These tutorials were prepared using previous version of the Yambo code: some command lines, variables, reports and outputs can be slightly different from the last version of the code. Scripts for parsing output cannot work anymore and should be edited to work with the new outputs. New command lines can be accessed typing yambo -h
Basic
Post Processing
- Yambo Post Processing (ypp)
- First steps in Yambopy
- Yambopy tutorial: band structures
- Yambopy tutorial: Yambo databases
- [[Yambopy][GW tutorial. Convergence and approximations (BN)]]
- Bethe-Salpeter equation tutorial. Optical absorption (BN)
Advanced
GW and Quasi-particles
Electron phonon coupling
- Electron Phonon Coupling
- Optical properties at finite temperature
- Phonon-assisted luminescence by finite atomic displacements
- Exciton-phonon coupling and luminescence
Non linear response
- Linear response using Dynamical Berry phase
- Real time approach to non-linear response
- Correlation effects in the non-linear response
- Third Harmonic Generation
- Spin-orbit coupling and non-linear response
- Two-photon absorption
- Pump and Probe
- Parallelization for non-linear response calculations
Developing Yambo
Modular tutorials
These tutorials are designed to provide a deeper understanding of specific yambo tasks and runlevels. They are designed to avoid repetition of common procedures and physical concepts. As such, they make use of the same physical systems: bulk hexagonal boron nitride hBN and a hBN sheet hBN-2D.
Warning: These tutorials were prepared using previous version of the Yambo code: some command lines, variables, reports and outputs can be slightly different from the last version of the code. Scripts for parsing output cannot work anymore and should be edited to work with the new outputs. New command lines can be accessed typing yambo -h
Introduction
Quasiparticles in the GW approximation
Using Yambo in Parallel
This modules contains very general discussions of the parallel environment of Yambo. Still the actual run of the code is specific to the CECAM cluster. If you want to run these modules just replace the parallel queue instructions with simple MPI commands.
- Parallel GW (CECAM specific): strategies for running Yambo in parallel
- GW convergence (CECAM specific): use Yambo in parallel to converge a GW calculation for a layer of hBN (hBN-2D)
Excitons and the Bethe-Salpeter Equation
- Calculating optical spectra including excitonic effects: a step-by-step guide
- Obtaining a converged optical spectrum
- Many-body effects in low-dimensional systems: numerical issues and remedies
- Analysis of excitonic spectra in a 2D material
Yambopy
- First steps in Yambopy
- GW tutorial. Convergence and approximations (BN)
- Bethe-Salpeter equation tutorial. Optical absorption (BN)
- Database and plotting tutorial for quantum espresso: qepy
- Database and plotting tutorial for yambo: yambopy
Modules
Alternatively, users can learn more about a specific runlevel or task by looking at the individual documentation modules. These provide a focus on the input parameters, run time behaviour, and underlying physics. Although they can be followed separately, non-experts are urged to follow them as part of the more structured tutorials given above.