First steps in Yambopy: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
No edit summary
 
(12 intermediate revisions by 2 users not shown)
Line 6: Line 6:
* Set up simple automatization workflows (e.g., convergence tests)
* Set up simple automatization workflows (e.g., convergence tests)


===Quick installation===
=== Setup ===
First of all, make sure that you have a suitable python environment (crated for example with [https://docs.conda.io/projects/miniconda/en/latest/| conda] or [https://docs.python.org/3/library/venv.html| venv]) with python >=3.8.


A quick way to start using Yambopy is described here.
If you are not used with python environments, here two simple commands that you can use
python -m venv MYPATH/yamboenv/
(you can replace `MYPATH` with any path you prefer, e.g. `~/`)
source MYPATH/yamboenv/bin/activate
(for bash users, you can add to your .bashrt the line `. MYPATH/yamboenv/bin/activate`)


* Make sure that you are using Python 3, and follow the [https://www.yambo-code.eu/wiki/index.php/Tutorials#Advanced:_Setting_up_Only_YamboPy setup instructions for Yambopy]. The <code>abipy</code> [[https://abinit.github.io/abipy/index.html]] package is optional. You may however want to have it installed for band structure interpolations.
Then, you may install yambopy in one of the following ways.


===Installing dependencies with Anaconda===
==== Quick installation from PyPI repository ====
We suggest that you install Yambopy using conda to automatically manage the dependencies, to do so, please follow the instructions for [https://www.yambo-code.eu/wiki/index.php/Tutorials#Setting_up_Yambopy:_Using_Anaconda Setting up Yambopy with Anaconda].


===Frequent issues===
* In order to quickly install the officially released version type:
When running the installation you may get a <code>SyntaxError</code> related to utf-8 encoding or it may complain that module <code>setuptools</code> is not installed even though it is. In this case, it means that the <code>sudo</code> command is not preserving the correct <code>PATH</code> for your python executable.


Solve the problem by running the installation step as
pip install yambopy


sudo /your/path/to/python setup.py install
==== Installation from tarball ====
or
sudo env PATH=$PATH python setup.py install


This applies only to the installation step and not to subsequent yambopy use.
* In case you don't want to download from the pip repository and prefer to install a version of yambopy locally, you may download the appropriate tarball from the [https://github.com/yambo-code/yambopy/releases| yambopy github page]. Extract the tarball, enter the yambopy folder and type <code>pip install .</code>


==== Installation of latest patch ====


===Setup complete===
* In case you want the latest version of the code including new updates and patches that might not be present in the official version, then you can clone the yambopy git repository (a basic knowledge of git may be helpful):
 
git clone https://github.com/yambo-code/yambopy.git
cd yambopy
pip install .
 
==== Dependencies ====
 
* In principle, <code>pip</code> should take care of the required python dependencies. They are <code>numpy</code>, <code>scipy</code>, <code>matplotlib</code>, <code>netCDF4</code>, <code>lxml</code>, <code>PyYAML</code> and <code>monty</code>. In case some dependency-related problem arises, you can install each of them separately beforehand with:
 
pip install <code>dependency-name</code>
 
=== Tutorials ===
Now yambopy is ready to use! Just go to the tutorials folder and follow the docs!
Now yambopy is ready to use! Just go to the tutorials folder and follow the docs!


Line 33: Line 47:


On this wiki, we provide steps for the following tutorials:
On this wiki, we provide steps for the following tutorials:
1. Data postprocessing:
* [[Yambopy tutorial: band structures | Database and plotting tutorial for quantum espresso: qepy]] (Get the databases: [https://media.yambo-code.eu/educational/tutorials/files/databases_qepy.tar.gz databases_qepy], 46.5MB)
* [[Yambopy tutorial: Yambo databases | Database and plotting tutorial for yambo: yambopy ]] (Get the databases: [https://media.yambo-code.eu/educational/tutorials/files/databases_yambopy.tar.gz databases_yambopy], 129MB)
2. Manage QE and Yambo runs:
* [[GW tutorial. Convergence and approximations (BN)]]
* [[GW tutorial. Convergence and approximations (BN)]]
* [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]]
* [[Bethe-Salpeter equation tutorial. Optical absorption (BN)]]
* [[Yambopy tutorial: band structures | Database and plotting tutorial for quantum espresso: qepy]] (Get the databases: [http://www.yambo-code.org/educational/tutorials/files/databases_qepy.tar databases_qepy], 59MB)
3. Advanced topics:
* [[Yambopy tutorial: Yambo databases | Database and plotting tutorial for yambo: yambopy ]] (Get the databases: [http://www.yambo-code.org/educational/tutorials/files/databases_yambopy.tar databases_yambopy], 226MB)
* [[Phonon-assisted luminescence by finite atomic displacements]]
* [[Phonon-assisted luminescence by finite atomic displacements]]

Latest revision as of 10:01, 3 October 2024

The yambopy project aims to develop python tools to:

  • Read and edit yambo and quantum espresso input files
  • Easily perform pre- and post-processing of the simulation data for these two codes - including hard-to-get, database-encoded data beyond standard outputs
  • Provide easy visualization and plotting options
  • Set up simple automatization workflows (e.g., convergence tests)

Setup

First of all, make sure that you have a suitable python environment (crated for example with conda or venv) with python >=3.8.

If you are not used with python environments, here two simple commands that you can use

python -m venv MYPATH/yamboenv/

(you can replace `MYPATH` with any path you prefer, e.g. `~/`)

source MYPATH/yamboenv/bin/activate

(for bash users, you can add to your .bashrt the line `. MYPATH/yamboenv/bin/activate`)

Then, you may install yambopy in one of the following ways.

Quick installation from PyPI repository

  • In order to quickly install the officially released version type:
pip install yambopy

Installation from tarball

  • In case you don't want to download from the pip repository and prefer to install a version of yambopy locally, you may download the appropriate tarball from the yambopy github page. Extract the tarball, enter the yambopy folder and type pip install .

Installation of latest patch

  • In case you want the latest version of the code including new updates and patches that might not be present in the official version, then you can clone the yambopy git repository (a basic knowledge of git may be helpful):
git clone https://github.com/yambo-code/yambopy.git
cd yambopy
pip install .

Dependencies

  • In principle, pip should take care of the required python dependencies. They are numpy, scipy, matplotlib, netCDF4, lxml, PyYAML and monty. In case some dependency-related problem arises, you can install each of them separately beforehand with:
pip install dependency-name

Tutorials

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

cd tutorial/

On this wiki, we provide steps for the following tutorials:

1. Data postprocessing:

2. Manage QE and Yambo runs:

3. Advanced topics: