First steps in Yambopy: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
Line 22: Line 22:
* Go to a directory of your choice and clone yambopy from the git repository
* Go to a directory of your choice and clone yambopy from the git repository


<source lang="python">
git clone https://github.com/yambo-code/yambopy.git
git clone https://github.com/yambo-code/yambopy.git
</source>


* Enter into the yambopy folder and install
* Enter into the yambopy folder and install


<source lang="python">
cd yambopy
cd yambopy
sudo python setup.py install
sudo python setup.py install
</source>


If you don't have administrative privileges (for example on a computing cluster), type instead
If you don't have administrative privileges (for example on a computing cluster), type instead


<source lang="python">
cd yambopy
cd yambopy
python setup.py install --user
python setup.py install --user
</source>


===Frequent issues===
===Frequent issues===

Revision as of 11:57, 7 March 2022

A typical yambo calculation proceeds as follows:

  • Obtain the ground state properties from a DFT code (pw.x or abinit) First steps: a walk through from DFT to optical properties
  • Create the yambo netCDF databases using the corresponding interface: (p2y for pw.x or a2y for abinit)
  • Run yambo once to complete the database
  • Run yambo specifying the run-levels to generate the input file
  • Edit the yambo input file
  • Run various yambo simulations
  • Plot the data results

Since many of the parameters of the calculation have to be converged the user might end up running the last three steps many times. This is rather time-consuming without an automatization script.

The yambopy project aims to provide a simple set of python scripts to (i) read and edit yambo and quantum espresso input files, and (ii) to easily perform pre- and post-processing of the simulation data for these two codes. Yambopy was born with the primary objective of making the convergence tests easier.

Installation instructions for general users

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.
  • Go to a directory of your choice and clone yambopy from the git repository
git clone https://github.com/yambo-code/yambopy.git
  • 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

<source lang="python"> sudo /your/path/to/python setup.py install </source> or <source lang="python"> sudo env PATH=$PATH python setup.py install </source>

This applies only to the installation step and not to subsequent yambopy use.

Optional

Install abipy [[1]] for band structure interpolations using either pip install abipy or conda install abipy --channel abinit (note that abipy does not work with python >3.6).

Setup complete

Now yambopy is ready to use! Just go to the tutorials folder and follow the docs!

<source lang="python"> cd tutorial/bn </source>

And go to GW tutorial. Convergence and approximations (BN) or Bethe-Salpeter equation tutorial. Optical absorption (BN).

You can find all the documentation of yambopy here http://yambopy.readthedocs.io/en/latest/index.html

Installation instructions for the hands-on of the 2020 Yambo school at ICTP, Trieste

  • Yambopy is already inside the Yambo Quantum Mobile (YQM). Start the YQM and go to the tutorial folder

<source lang="bash"> cd yambopy/ </source>

and run <source lang="bash"> git pull sudo python3 setup.py install --user </source>

Once the installation finishes, go to GW tutorial. Convergence and approximations (BN) or Bethe-Salpeter equation tutorial. Optical absorption (BN).

You can find all the documentation of yambopy here http://yambopy.readthedocs.io/en/latest/index.html