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
An AI-powered device to stop people from stealing my packages.

Package Theft Prevention Device An AI-powered device to stop people from stealing my packages. Installation To install on a raspberry pi, clone the re

rydercalmdown 157 Nov 24, 2022
Msgpack serialization/deserialization library for Python, written in Rust using PyO3 and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Aviram Hassan 139 Dec 30, 2022
Data and analysis relating to the 5.8M Melbourne quake of 2021

quake2021 Data and analysis relating to the 5.8M Melbourne quake of 2021 Monash University Woodside Living Lab Building The building is located here T

Colin Caprani 6 May 16, 2022
Your copilot to studies and work (Pomodoro-timer, Translate and Notes app)

Copylot Your copilot to studies and work (Pomodoro-timer, Translate and Notes app) Copylot are three applications in one: Pomodoro Translate Notes Cop

Eduardo Mendes 20 Dec 16, 2022
Load dependent libraries dynamically.

dypend dypend Load dependent libraries dynamically. A few days ago, I encountered many users feedback in an open source project. The Problem is they c

Louis 5 Mar 02, 2022
Doom o’clock is a website/project that features a countdown of “when will the earth end” and a greenhouse gas effect emission prediction that’s predicted

Doom o’clock is a website/project that features a countdown of “when will the earth end” and a greenhouse gas effect emission prediction that’s predicted

shironeko(Hazel) 4 Jan 01, 2022
Get information about what a Python frame is currently doing, particularly the AST node being executed

executing This mini-package lets you get information about what a frame is currently doing, particularly the AST node being executed. Usage Getting th

Alex Hall 211 Jan 01, 2023
A Company Management System For Python

campany-management Getting started To make it easy for you to get started with GitLab, here's a list of recommended next steps. Already a pro? Just ed

hatice akpınar 3 Aug 29, 2022
PyPI package for scaffolding out code for decision tree models that can learn to find relationships between the attributes of an object.

Decision Tree Writer This package allows you to train a binary classification decision tree on a list of labeled dictionaries or class instances, and

2 Apr 23, 2022
Vita Specific Patches and Application for Doki Doki Literature Club (Steam Version) using Ren'Py PSVita

Doki-Doki-Literature-Club-Vita Vita Specific Patches and Application for Doki Doki Literature Club (Steam Version) using Ren'Py PSVita Contains: Modif

Jaylon Gowie 25 Dec 30, 2022
用于红队成员初步快速攻击的全自动化工具。

关于 Author:m0sway Mail:[email protected] Github:https://www.github.com/m0sway/Jud JuD是

m0sway 46 Jul 21, 2022
Streamlit component to display topics from Streamlit's community forum related to any exception.

streamlit-forum Streamlit component to display topics from Streamlit's community forum related to any exception. Installation pip install streamlit-fo

Snehan Kekre 7 Jul 15, 2022
Script for resizing MTD partitions on a QNAP device in order to be available to upgrade from buster to bullseye

QNAP partitions resize for kirkwood devices. As explained by Marin Michlmayr, Debian bullseye support on kirkwood QNAP devices was dropped due to [mai

Arnaud Mouiche 26 Jan 05, 2023
Project aims to map out common user behavior on the computer

User-Behavior-Mapping-Tool Project aims to map out common user behavior on the computer. Most of the code is based on the research by kacos2000 found

trustedsec 136 Dec 23, 2022
A NetBox Plugin that gives a UI for generating, comparing and deploying configurations to devices.

netbox_config_plugin - A plugin to generate, compare and deploy configurations This plugin allows you to execute your code to generate a config for a

Jo 11 Dec 21, 2022
From "fixed RAnDom CRashes" to "[FIX] Fixed random crashes."

Clean Commit From fixed RAnDom CRashes to [FIX] Fixed random crashes. Clean commit helps you by auto-formating your commits to make your repos better

Mathias 3 Dec 26, 2021
🏆 A ranked list of awesome Python open-source libraries and tools. Updated weekly.

Best-of Python 🏆 A ranked list of awesome Python open-source libraries & tools. Updated weekly. This curated list contains 230 awesome open-source pr

Machine Learning Tooling 2.7k Jan 03, 2023
Un script en python qui permet d'automatique bumpée (disboard.org) tout les 2h

auto-bumper Un script en python qui permet d'automatique bumpée (disboard.org) tout les 2h Pour la première utilisation, 1.Lancer Install.bat 2.(faire

!! 1 Jan 09, 2022
The best way to learn Python is by practicing examples. The repository contains examples of basic concepts of Python. You are advised to take the references from these examples and try them on your own.

90_Python_Exercises_and_Challenges The best way to learn Python is by practicing examples. This repository contains the examples on basic and advance

Milaan Parmar / Милан пармар / _米兰 帕尔马 205 Jan 06, 2023
In this project we will implement AirBnB clone using console

AirBnB Clone In this project we will implement AirBnB clone using console. Usage The shell should work like this

Nandweza Allan 1 Feb 07, 2022