Skip to main content

Yet another Ab Initio Visualizer with a variety of tools

Project description

YAIV

Yet another Ab Initio Visualizer...

A general purpose tool for condensed matter data analysis in jupyterlab.
Report Bug · Request Feature
___
Explore the tutorials:
Plotting · Utilities

Table of Contents
  1. About The Project
  2. Usage
  3. Installation
  4. Roadmap

About The Project

YAIV is a collection of tools for plotting results of condensed matter ab initio codes such as Quantum Espresso, VASP, Wannier90, Wannier Tools... Although it can be used from the command line, the main intention of YAIV is to be used within JupyterLab, thereby allowing users to centralize the data analysis of a whole project into a single file. The goal is to provide both (1) fast and easy plotting defaults to glance over results, while (2) being flexible and powerful enough to generate publication-ready figures.

gif demo

(back to top)

Why?

A single file to rule them all...

Most of the tools contained on YAIV are nothing more than glorified python scripts I needed during my PhD. Although python libraries for ab initio data analysis already exist, I found many of them being disigned to work within the command line (often required to be run from a certain directory). YAIV is aimed at providing useful ab initio analysis functionalities to those people willing to use a single JupyterLab file to organize their projects.

YAIV also intends to provide enough flexibility and modularity for most scenarios. To this end, useful utilities are also provided in order to scrape data from the output of a variety of codes. Then, users can either further process the raw data or plot it in any desired way.

(back to top)


Installation

Create an isolated python enviroment

In case you want to create your own python enviroment and have it available in JupyterLab.

    virtualenv yaiv_env                                 #Create yor new enviroment
    source yaiv_env/bin/activate                        #Load the enviroment
    pip install ipykernel                               #In order to create a Kernel for this enviroment
    python -m ipykernel install --user --name=YAIV      #Install your new kernel with your desired name
    jupyter kernelspec list                             #Check that the new installed kernel appears

Now your new installed Kernel should be available in JupyterLab. You can select Kernel clicking at the top-right corner of JupyterLab.

Installing YAIV

You can either install from pip as:

   pip install yaiv

Or cloning the git repository:

   git clone https://github.com/mgamigo/YAIV.git
   cd YAIV
   pip install .

(back to top)


Usage

All the functions are properly documented (remember that in JupyterLab all the documentation can be conviniently accesed with the shift + tab shortcut). All the tools are demostrated in the tutorials, here is a brief summary of the main modules of YAIV and their current tools:

Plot module

Contains most of the plotting functionalities, currently being:

  • Electronic band structures from Quantum Espresso, Vasp, Wannier90 and WannierTools.
    • Plotting results from different codes against each other.
  • Phonon spectra from Quantum Espresso.
    • Plotting different phonon spectra. It can highlight the DFPT phonons from which the whole spectrum is interpolated.

Here are some simple examples:

plot.bands(file='DATA/bands/QE/results_bands/CsV3Sb5.bands.pwo',  #raw Quantum Espresso output file with the band structure
           KPATH='DATA/bands/KPATH',   #File with the Kpath (in order to plot the ticks at the High symmetry points)
           aux_file='DATA/bands/QE/results_scf/CsV3Sb5.scf.pwo', #File needed to read the number of electrons and lattice parameters
           title='Nice QE plot ( ͡❛ ͜ʖ ͡❛)')    # A title of your liking
plot.phonons(file='DATA/phonons/2x2x2/results_matdyn/CsV3Sb5.freq.gp', #raw data file with the phonon spectrum
            KPATH='DATA/bands/KPATH',                                 #File with the Kpath (in order to plot the ticks at the High symmetry points)
            ph_out='DATA/phonons/2x2x2/results_ph/CsV3Sb5.ph.pwo',    #File with the phonon grid points and lattice vectors.
            title=' ( ͡❛ ͜ʖ ͡❛) Handles discontinious paths! (2x2x2) grid highlighted!',   # A title of your liking
            grid=True,color='navy',linewidth=1)                        #Non-mandatory customization

Combining YAIV tools with the usual matplotlib sintax one can generate complex plots as this one (check the tutorial):

Utils module

The utils module has a variety of utilities mostly focussed on scraping data from output files of different codes. This tools combined can be usefull for various porpuses. All the functions are demostrated in this tutorial. So far the code supports:

  • Grepping tools (either by calling the function or using the file class):
    • Grepping the number of electrons from Quantum Espresso and VASP outputs.
    • Grepping the Fermi level.
    • Grep the lattice parameters.
    • Grep the path from a Quantum Espresso bands.pwi or madtyn.in input.
    • Grep the path and HSP labels from a KPATH in the TQC website format. (Enter in any compound and click in the "Download KPATH" link).
    • Grep the phonon grid from a Quantum Espresso ph.x output.
  • Transforming tools (mainly usefull changes of coordinates):
    • K_basis: Obtaining the reciprocal lattice vectors.
    • cartesian2cryst: From cartesian to crystal coordinates.
    • cryst2cartesian: From crystal to cartesian coordinates.
    • cartesian2spherical: From cartesian to spherical coordinates.
    • cryst2spherical: From crystal to spherical coordinates.

(For more examples, please refer to the Tutorials).

(back to top)


Roadmap

  • Plot module
    • Plotting electronic band strucutres
    • Plotting phonon spectra
    • Plotting densities of states (DOS)
    • ...
  • Utils module
    • Grep tools to scrape data form OUTPUT files
    • Transformation tools for easy changing of coordinates
    • ...
  • Convergence analysis tools
    • Quantum Espresso self consistent calculations
    • Quantum Espresso phonon spectra
    • Wannierizations for Wannier90
    • ...
  • ...
Built With

NumPy Matplotlib ASE

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yaiv-0.1.0.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yaiv-0.1.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file yaiv-0.1.0.tar.gz.

File metadata

  • Download URL: yaiv-0.1.0.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for yaiv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b36072fd7e4282c474410ddfb25e6d718d8587a36746b99e34a9c60a26cc3ce
MD5 32c8abe167bdf34ba321fba739a9a343
BLAKE2b-256 3a481c78604b045ba61c0495ea62a77a820c1bdd5d419bae06a0e4d7e905c3af

See more details on using hashes here.

File details

Details for the file yaiv-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: yaiv-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for yaiv-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f626eebbca4265dcb1a19f378df52868a4fa9d28085b153332795a5221ea960
MD5 9ffb2255d68826ebe817e0ff059e505e
BLAKE2b-256 8b637e3e3569b1804965ccf78801ef1358472e4c8fe17c4835ef045d274af4fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page