Wannier & vASP Postprocessing module

Overview

WASPP module

Wannier90 & vASP Postprocessing module with functionalities I needed during my PhD.

Being updated Version: 0.5

Main functions:

Wannier90 - VASP interface preparation and evaluation.

  1. plot_pdos

For plotting pDOS select LORBIT = 11 in INCAR file

Main function for plotting the partial density of states, for desired atoms and orbitals at all the different Wyckoff positions. Usage is straightforward:

  • file = "vasprun.xml" of your VASP run.
  • _atoms = Atoms whose pDOS you wanna plot as a list of strings e.g. ["P","I","O","Rn","Al"].
  • _orbitals = Orbitals whose pDOS you wanna know from _atoms as a list of strings. They can be "big" orbitals (s,p,d,f) or "small" (px,py,pz,dxy,...), e.g ["s","px","d"].
  • e_window = Range of energies of interest.

If _atoms and _orbitals are None, the function will plot every atom and big orbital at every different Wyckoff position. For a better visualization each kind of big orbital is displayed with a different linestyle.

For example (Ta6Se24I2):

wap.plot_dos("vasprun.xml",e_window = (-7.5,4))

Returns:

TaSeI pDOS

The first tag in the legend is the atom, the second is the Wyckoff position and the third the orbital.

  1. band_counter

Counts the numebr of bands in a energy window in the whole FBZ. It gives a good clue of how to choose the energy window. Usage is as following:

wap.band_counter(file = "vasprun.xml", emin = 0.0, emax = 0.0)
  • file = "vasprun.xml" of your VASP run.
  • emin and emax are the lower and upper part of the energy window given in reference to Fermi energy.

For example:

wap.band_counter(file = "vasprun.xml", emin = -7.0, emax = 4.0)

Returns:

Efermi = 3.01610496.
Total bands = 544.
The number of bands between -7.00 eV (-3.98 eV) and 4.00 eV (7.02 eV) is 368.

Which is, the Fermi energy in eV, the total number of bands of the vasp run and the number of bands in the energy window (with real energies in parenthesis for wannier90.win)

  1. plot_wannierbands

Function for plotting wannier bands from .dat and .gnu files.

Usage:

wap.plot_wannierbands(file_dat = "wannier90_band.dat", gnu = "wannier90_band.gnu",efermi = 0.0, e_window = None, fig_size = (15,8),savename = "wannierbands.png")
  • file_dat: *_band.dat output file from a wannier90.x run.
  • file_dat: *_band.gnu output file from a wannier90.x run.
  • efermi: Fermi energy.
  • e_window = Energy window for the plot

It generates a "wannierbands.png" file.

4 . plot_vaspbands

Function for plotting VASP bands from a non self-consistent calculation in a KPATH. Usage:

wap.plot_vaspbands(outcar = "OUTCAR", kpoints = "KPOINTS")

  • outcar: OUTCAR file from VASP run.
  • kpoints: KPOINTS file from nsc VASP run (linemode expected).
  1. plot_comparison

Function for comparing VASP and Wannier90 bandstructures combining the previous functions and tags. Usage:

wap.plot_comparison(outcar = "OUTCAR", kpoints = "KPOINTS",file_dat = "wannier90_band.dat", gnu = "wannier90_band.gnu",efermi = 0.0, fig_size = (12,8), e_window = (-4,4),savename = "comparison.png"):
  • outcar: OUTCAR file from VASP run.
  • kpoints: KPOINTS file from nsc VASP run (linemode expected).
  • file_dat: *_band.dat output file from a wannier90.x run.
  • file_dat: *_band.gnu output file from a wannier90.x run.
  • efermi: Fermi energy.
  • e_window = Energy window for the plot

Example: RhSi

wap.plot_comparison(outcar = "OUTCAR", kpoints = "KPOINTS",file_dat = "wannier90_band.dat", gnu = "plottt/wannier90_band.gnu",efermi = 0.0, fig_size = (12,8), e_window = (-4,4),savename = "comparison.png") 

RhSi VASP vs Wannier90

  1. wann_kpoints

Function for generating kpath string for seedname.win using a KPOINT file from a nsc VASP calculation. Usage is as follows:

wann_kpoints(file = "KPOINTS")

Where KPOINTS is like:

Cubic
20   ! 20 grids
Line-mode
reciprocal
   0.000   0.000   0.000   ! GAMMA
   0.000   0.500   0.000   ! X
   0.000   0.500   0.000   ! X
   0.500   0.500   0.000   ! M
   0.500   0.500   0.000   ! M
   0.000   0.000   0.000   ! GAMMA
   0.000   0.000   0.000   ! GAMMA
   0.500   0.500   0.500   ! R
   0.500   0.500   0.500   ! R
   0.000   0.500   0.000   ! X
   0.500   0.500   0.000   ! M
   0.500   0.500   0.500   ! R

And it generates a WKPTS.txt file as:

G 0.000 0.000 0.000 X 0.000 0.500 0.000 
X 0.000 0.500 0.000 M 0.500 0.500 0.000 
M 0.500 0.500 0.000 G 0.000 0.000 0.000 
G 0.000 0.000 0.000 R 0.500 0.500 0.500 
R 0.500 0.500 0.500 X 0.000 0.500 0.000 
M 0.500 0.500 0.000 R 0.500 0.500 0.500 
  1. plot_custom_vaspbands

Similar to plot_vaspbands but more customizable. Usage is as follows:

wap.plot_custom_vaspbands(outcar = "OUTCAR",kpoints = "KPOINTS",
                          figsize = (10,7.5),ewindow = (-3,3),
                          dpi = 500,linewidth = 0.5,
                          kp_i=None,kp_f=None,
                          title=None,fname=None)

Where:

  • kp_i & kp_f is the number of the fist and last KPOINT in the path that you want to plot. E.g. in the KPOINTS file from above example kp_i = 2 would correspond to M.
  • title and fname are the title to be printed in the figure and the path to the figure when saved.

MBJ and PBE potentials bandstructure comparison.

compare_MBJ

Function for comparing PBE nscc and MBJ scc functional bandstructures using pymatgen treatment of vasprun.

wap.compare_MBJ(vasprun_pbe = "vasprun1.xml",
            vasprun_mbj = "vasprun2.xml",
            kpoint_file = "KPOINTS",
            e_window = (-4,4),
            fig_title = None,
            fig_name = "comparison.png")

Usage:

  • vasprun_pbe: vasprun file for PBE nsc run.
  • vasprun_mbj: vasprun file for MBJ scc run.
  • kpoint_file: kpoint file for nsc (linemode expected).

For example:

wap.compare(vasprun_pbe = "vasprun81_rel.xml",
            vasprun_mbj = "vasprun81.xml",
            kpoint_file = "KPOINTS",
            e_window = (-2,2),
            fig_title = "SG81",
            fig_name = "comparison81.png")

Returns:

VASP PBE vs MBJ potetntial

More functionalities are present in the code and many more are coming, stay tuned & take a look at WASPP05.py. (^³^)~♪

Package Requeriments:

  • numpy
  • matplotlib
  • scipy
  • itertools
  • re
  • pymatgen
Owner
Irián Sánchez Ramírez
PhD student @ DIPC
Irián Sánchez Ramírez
Islam - This is a simple python script.In this script I have written all the suras of Al Quran. As a result, by using this script, you can know the number of any sura at the moment.

Introduction: If you want to know sura number of al quran by just typing the name of sura than you can use this script. Usage in termux: $ pkg install

Fazle Rabbi 1 Jan 02, 2022
A simple weather app.

keather A simple weather app. This is currently not finished. Dependencies: yay -S python-beautifulsoup4 tk

1 Jan 09, 2022
Free Data Engineering course!

Data Engineering Zoomcamp Register in DataTalks.Club's Slack Join the #course-data-engineering channel The videos are published to DataTalks.Club's Yo

DataTalksClub 7.3k Dec 30, 2022
NORETURN is an esoteric programming language, based around the idea of not going back

NORETURN NORETURN is an esoteric programming language, based around the idea of not going back Concept Program coded in noreturn runs over one array,

1 Dec 15, 2021
Null safe support for Python

Null Safe Python Null safe support for Python. Installation pip install nullsafe Quick Start Dummy Class class Dummy: pass Normal Python code: o =

Paaksing 13 Nov 17, 2022
Patch PL to disable LK verification. Patch LK to disable boot/recovery verification.

Simple Python(3) script to disable LK verification in Amazon Preloader images and boot/recovery image verification in Amazon LK ("Little Kernel") images.

Roger Ortiz 18 Mar 17, 2022
Render to print for blender 2.9+

render_to_print_blender_addon ** render2print: Blender AddOn for Blender 2.90.0+ ** Calculates camera parameters to allow printing a rendered image to

5 Nov 19, 2021
Open Source Repository for CFD Solvers

Background and Validation This wiki is built in Notion. Here are all the tips you need to contribute. General Background Flow over a cylinder The proj

1 Dec 30, 2021
[CVPR 2020] Rethinking Class-Balanced Methods for Long-Tailed Visual Recognition from a Domain Adaptation Perspective

Rethinking Class-Balanced Methods for Long-Tailed Visual Recognition from a Domain Adaptation Perspective [Arxiv] This is PyTorch implementation of th

Abdullah Jamal 22 Nov 19, 2022
Aides to reduce a cheat file with a personal selection of the cheats you want to use.

Retroarch Cheat File Reducer Description Aides to reduce a cheat file with a personal selection of the cheats you want to use. Instructions Copy a sel

1 Jan 09, 2022
An Notifier Program that Notifies you to relax your eyes Every 15 Minutes👀

Every 15 Minutes ⌛ Every 15 Minutes is an application that is used to Notify you to Relax your eyes Every 15 Minutes, This is fully made with Python a

FSP Gang s' YT 2 Oct 18, 2021
Learn Python tips, tools, and techniques in around 5 minutes each.

Python shorts Learn Python tips, tools, and techniques in around 5 minutes each. Watch on YouTube Subscribe on YouTube to keep up with all the videos.

Michael Kennedy 28 Jan 01, 2023
This directory gathers the tools developed by the Data Sourcing Working Group

BigScience Data Sourcing Code This directory gathers the tools developed by the Data Sourcing Working Group First Sourcing Sprint: October 2021 The co

BigScience Workshop 27 Nov 04, 2022
Online-update est un programme python permettant de mettre a jour des dossier et de fichier depuis une adresse web.

Démarrage rapide Online-update est un programme python permettant de mettre a jour des dossier et de fichier depuis une adresse web. Mode préconfiguré

pf4 2 Nov 26, 2021
A micro-service that can be extended to help in monitoring systems

A micro-service that can be extended to help in monitoring systems. Be extensible to be incorporated in any of the systems to facilitate timely interventions.

Peter Kagwe 1 Feb 06, 2022
Empresas do Brasil (CNPJs)

Biblioteca em Python que coleta informações cadastrais de empresas do Brasil (CNPJ) obtidas de fontes oficiais (Receita Federal) e exporta para um formato legível por humanos (CSV ou JSON).

BR-API: Democratizando dados do Brasil. 8 Aug 17, 2022
PyCASCLib: CASC interface for Warcraft III

PyCASCLib CASC interface for Warcraft III. This repo provides bindings for JCASC: https://github.com/DrSuperGood/JCASC Installation Jdk is required fo

2 Jun 04, 2022
This synchronizes my appearances with my calendar

Josh's Schedule Synchronizer Here's the "problem:" I use a Google Sheets spreadsheet to maintain all my public appearances.

Developer Advocacy 2 Oct 18, 2021
ARA Records Ansible and makes it easier to understand and troubleshoot.

ARA Records Ansible ARA Records Ansible and makes it easier to understand and troubleshoot. It's another recursive acronym. What it does Simple to ins

Community managed Ansible repositories 1.6k Dec 25, 2022
PyMedPhys is an open-source Medical Physics python library

PyMedPhys is an open-source Medical Physics python library built by an open community that values and prioritises code sharing, review, improvement, and learning from each other. I

PyMedPhys 238 Dec 27, 2022