Package: yaiv
YAIVYet another Ab Initio Visualizer...A general purpose tool for condensed matter data analysis in jupyterlab.Report Bug·Request Feature___Explore the tutorials:Plotting·Convergence·UtilitiesTable of ContentsAbout The ProjectWhy?Current toolsPlotting toolsConvergence analysisOther utilitiesExamplesInstallationRoadmapAbout The ProjectYAIV is a collection of tools for plotting results of condensed matter ab initio codes such asQuantum 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, usefulutilitiesare 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)InstallationCreate an isolated python enviromentIn case you want to create your own python enviroment and have it available in JupyterLab.virtualenvyaiv_env#Create yor new enviromentsourceyaiv_env/bin/activate#Load the enviromentpipinstallipykernel#In order to create a Kernel for this enviromentpython-mipykernelinstall--user--name=YAIV#Install your new kernel with your desired namejupyterkernelspeclist#Check that the new installed kernel appearsNow your new installed Kernel should be available in JupyterLab. You can select Kernel clicking at the top-right corner of JupyterLab.Installing YAIVYou can either install from pip as:pipinstallyaivOr cloning the git repository:gitclonehttps://github.com/mgamigo/YAIV.gitcdYAIVpipinstall.(back to top)Current toolsAll the functions are properly documented (remember that in JupyterLab all the documentation can be conviniently accesed with theshift + tabshortcut). All the tools are demostrated in thetutorials, here is a brief summary of the main modules of YAIV and their current tools:I. Plot moduleContains most of the plotting functionalities, currently being:Electronic band structuresfrom Quantum Espresso, Vasp, Wannier90 and WannierTools.Plotting results from different codes against each other.Phonon spectrafrom Quantum Espresso.Plotting different phonon spectra. It can highlight the DFPT phonons from which the whole spectrum is interpolated.II. Convergence moduleA variety of tools for the purpose of inspecting the convergence of different calculations by plotting the results in a digestible way. Currently supports:Self-consistent calculations:Given a folder with the quantum-espresso outputs it gives tools for the convergence analysis of various quantities respect to the cutoff, Kgrid and smearing.DFPT Phonons:Like the self-consisten convergence analyzer (also respect to cutoff, Kgrid and smeargin). But for the phonon frequencies.Wannierizations:Tools for the convergence analysis of the Wannier minimizations done with wannier90.III. Utils moduleThe 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 thistutorial.
So far the code supports:Greppingtools (either by calling the function or using thefile class):Grepping thenumber of electronsfrom Quantum Espresso and VASP outputs.Grepping theFermi level.Grep thelattice parameters.Grep thepathfrom a Quantum Espresso bands.pwi or madtyn.in input.Grep thepath and HSP labelsfrom a KPATH in theTQC websiteformat. (Enter in any compound and click in the "Download KPATH" link).Grep thephonon gridfrom a Quantum Espresso ph.x output.Grep thetotal energyfrom a Quantum Espresso ph.x output.Transformingtools (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.ExamplesHere are some simple examples:plot.bands(file='DATA/bands/QE/results_bands/CsV3Sb5.bands.pwo',#raw Quantum Espresso output file with the band structureKPATH='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 parameterstitle='Electronic bandstructures')# A title of your likingplot.phonons(file='DATA/phonons/2x2x2/results_matdyn/CsV3Sb5.freq.gp',#raw data file with the phonon spectrumKPATH='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='Phonon spectra with the (2x2x2) grid highlighted!',# A title of your likinggrid=True,color='navy',linewidth=1)#Non-mandatory customizationconv.kgrid.analysis(data='DATA/convergence/Kgrid/',#Folder with your DFT outputstitle='K-grid convergence analysis')#A title of your likingconv.wannier.w90(data='DATA/convergence/wannier90/NbGe2.wout',#Wannier90 output filetitle='Wannier minimization (66 WF)')#A title of your likingCombining YAIV tools with the usualmatplotlib sintaxone can generate complex plots as this one (check thetutorial):(For more examples, please refer to theTutorials).(back to top)RoadmapPlot modulePlotting electronic band strucutresPlotting phonon spectraPlotting densities of states (DOS)...Utils moduleGrep tools to scrape data form OUTPUT filesTransformation tools for easy changing of coordinates...Convergence analysis toolsQuantum Espresso self consistent calculationsQuantum Espresso phonon spectraWannierizations for Wannier90......Built With(back to top)