Skip to main content

YAIV

Yet another Ab Initio Visualizer...

A general purpose tool for condensed matter data analysis.
___
Explore the tutorials:
Grepping · Spectrum · Plotting

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.

(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 tools 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.

    python -m venv yaiv_env                             #Create yor new enviroment
    source yaiv_env/bin/activate                        #Load the enviroment
    pip install ipykernel                               #In order to create a Jupyter 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)


Current tools

All the functions are properly documented (remember that in JupyterLab all the documentation can be conviniently accesed with the shift + tab shortcut).

I. Grep module

Provides text-scraping utilities for extracting (grepping) structural and spectral information from first-principles calculation outputs. It supports common DFT packages such as Quantum ESPRESSO and VASP.

from yaiv.grep import kpointsEnergies
spectrum = kpointsEnergies("OUTCAR")
spectrum.eigenvalues.shape
-----
(100, 32)

II. Utils module

Provides general-purpose utility functions that are used across various classes and methods in the codebase. They are also intended to be reusable by the user for custom workflows, especially when combined with the data extraction tools.

III. Spectrum module

This module defines core classes for representing and plotting the eigenvalue spectrum of periodic operators, such as electronic bands or phonon frequencies, across a set of k-points. It also supports reciprocal lattice handling and coordinate transformations.

from yaiv.spectrum import electronBands
bands = electronBands("data/qe/Si.bands.pwo")
bands.eigenvalues.shape
---
(100, 32)
---
bands.plot()
---
(Basic Figure)

IV. Plot module

Provides plotting utilities for visualizing eigenvalue spectra from periodic systems. It supports electronic and vibrational spectra obtained from common ab initio codes such as Quantum ESPRESSO and VASP.

from yaiv.spectrum import electronBands
from yaiv import plot
bands = electronBands("OUTCAR")
plot.bands(bands)
---
(Decorated Figure)

V. Cell module

Defines core functions and a container class for crystal structures used in symmetry analysis, format conversion, and structural manipulation.

It provides a Cell class that wraps an ASE Atoms object along with its spglib-compatible representation. The Cell object allows for easy integration with spglib and includes utility methods to extract and report symmetry information, Wyckoff positions, and symmetry operations in symbolic form.

from yaiv.cell import Cell
cell = Cell.from_file("data/POSCAR")
cell.get_sym_info()
SpaceGroup = Fd-3m (227)
Equivalent positions: ...
Symmetry operations: ..

---
cell.get_wyckoff_positions()
cell.wyckoff.labels
['a', 'b']
cell.wyckoff.symbols
['Si', 'Si']

VI. Phonon module

Provides tools to handle vibrational properties of crystals from first-principles calculations. It includes data structures and utilities to:

  • Read .dyn* files generated by ph.x.
  • Diagonalize phonon Hamiltonians to extract frequencies and modes.
  • Compute commensurate supercells for charge density wave (CDW) distortions.
  • Build distorted atomic configurations based on soft phonon modes.
  • Creation Born-Oppenheimer energy surfaces.
from yaiv.phonon import CDW
cdw = CDW.from_file(q_cryst=[[0,0,0],[1/2, 0.0, 0.0]], results_ph_path="ph_output/")
distorted = cdw.distort_crystal(amplitudes=[1,1/5], modes=[0,0])
---
(returns Cell object of the distorted crystal)
Built With

NumPy Pint Matplotlib ASE Spglib Scipy

(back to top)

Metadata

Release files for yaiv 1.4.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yaiv 1.4.8
File Size Uploaded
yaiv-1.4.8.tar.gz 6.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for yaiv 1.4.8
File Interpreter ABI Platform
yaiv-1.4.8-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 MB

Release files / yaiv-1.4.8.tar.gz

Download URL yaiv-1.4.8.tar.gz
Size 6.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b6b45ec6788828fb0cfe720ec6f23c5a55b1cfad5521367f10791c9443c8ec5a
BLAKE2b-256 checksum
How to use checksums
2381a48d47fd6c88af21715aac1acae96b90208bf2841e443047db5e1769b45e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release files / yaiv-1.4.8-py3-none-any.whl

Download URL yaiv-1.4.8-py3-none-any.whl
Size 4.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9c5efde9e5bbb16f5e69c26a93910610f65e809dbc875826fe07e957bcd58930
BLAKE2b-256 checksum
How to use checksums
57b973876e24288d8232823a24f9be2b649e095a16d46623c55894e8f0aeb81f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release history Release notifications | RSS feed

1.4.9

2 release files

This release

1.4.8 This release

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page