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
You might also like...
 This module is for finding the execution time of a whole python program
This module is for finding the execution time of a whole python program

exetime 3.8 This module is for finding the execution time of a whole program How to install $ pip install exetime Contents: General Information Instru

Python module to work with Magneto Database directly without using broken Magento 2 core
Python module to work with Magneto Database directly without using broken Magento 2 core

Python module to work with Magneto Database directly without using broken Magento 2 core

This module extends twarc to allow you to print out tweets as text for easy testing on the command line
This module extends twarc to allow you to print out tweets as text for easy testing on the command line

twarc-text This module extends twarc to allow you to print out tweets as text for easy testing on the command line. Maybe it's useful for spot checkin

A module comment generator for python

Module Comment Generator The comment style is as a tribute to the comment from the RA . The comment generator can parse the ast tree from the python s

This python module allows to extract data from the RAW-file-format produces by devices from Thermo Fisher Scientific.

fisher_py This Python module allows access to Thermo Orbitrap raw mass spectrometer files. Using this library makes it possible to automate the analys

Module for working with the site dnevnik.ru with python

dnevnikru Module for working with the site dnevnik.ru with python Dnevnik object accepts login and password from the dnevnik.ru account Methods: homew

Python module for creating the circuit simulation definitions for Elmer FEM

elmer_circuitbuilder Python module for creating the circuit simulation definitions for Elmer FEM. The circuit definitions enable easy setup of coils (

A python mathematics module

A python mathematics module

A lightweight Python module to interact with the Mitre Att&ck Enterprise dataset.

enterpriseattack - Mitre's Enterprise Att&ck A lightweight Python module to interact with the Mitre Att&ck Enterprise dataset. Built to be used in pro

Owner
Irián Sánchez Ramírez
PhD student @ DIPC
Irián Sánchez Ramírez
Implementation of the MDMC method to search for magnetic ground state using VASP

Implementation of MDMC method ( by Olga Vekilova ) to search for magnetic ground state using VASP

Utkarsh Singh 1 Nov 27, 2021
A collection of simple tools that proved to be needed for hadling large periodic calculations with the VASP software package.

VESTA-tools A collection of simple tools that proved to be needed for handling large periodic calculations with the VASP software package. distTotCalc

Ilia Kichev 2 Dec 14, 2021
Module for remote in-memory Python package/module loading through HTTP/S

httpimport Python's missing feature! The feature has been suggested in Python Mailing List Remote, in-memory Python package/module importing through H

John Torakis 220 Dec 17, 2022
LAPS module for CrackMapExec

Crackmapexec-LAPS LAPS module for CrackMapExec Make sure to point to the DC Specify the full domain name Be careful the rid 500 might not be "Administ

null 28 Oct 5, 2022
A Python module for decorators, wrappers and monkey patching.

wrapt The aim of the wrapt module is to provide a transparent object proxy for Python, which can be used as the basis for the construction of function

Graham Dumpleton 1.8k Jan 6, 2023
Python screenshot library, replacement for the Pillow ImageGrab module on Linux.

tldr: Use Pillow The pyscreenshot module is obsolete in most cases. It was created because PIL ImageGrab module worked on Windows only, but now Linux

null 455 Dec 24, 2022
An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.

Python MSS from mss import mss # The simplest use, save a screen shot of the 1st monitor with mss() as sct: sct.shot() An ultra fast cross-platfo

Mickaël Schoentgen 799 Dec 30, 2022
One Ansible Module for using LINE notify API to send notification. It can be required in the collection list.

Ansible Collection - hazel_shen.line_notify Documentation for the collection. ansible-galaxy collection install hazel_shen.line_notify --ignore-certs

Hazel Shen 4 Jul 19, 2021
An OrpheusDL Tidal module

OrpheusDL - Tidal A Tidal module for the OrpheusDL modular archival music program Report Bug · Request Feature Table of content About OrpheusDL - Tida

Daniel 54 Dec 29, 2022
Is a polybar module that will show you your progress in Hack The Box

HTB-Status for Polybar Is a polybar module that will show you your progress in Hack The Box indicating your current rank, global rank, points and resp

bitc0de 8 Jan 14, 2022