Giter VIP home page Giter VIP logo

woops's Introduction

 _    _  _____  ___________
| |  | ||  _  ||  _  | ___ \
| |  | || | | || | | | |_/ /__
| |/\| || | | || | | |  __/ __|
\  /\  /\ \_/ /\ \_/ / |  \__ \
 \/  \/  \___/  \___/\_|  |___/

Wannier Orbital Overlap Population tools (WOOPs)

A post-processing tool written in python to get Wannier Orbital Overlap Population (WOOP), Wannier Orbital Position Population (WOPP)* from Wannier90 package.

Before getting into things, you might want to check out these two papers:

  1. Phys. Rev. B 56 12847 (1997)
  2. Phys. Rev. B 91, 195120 (2015)

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

For the script to work, you need to have an valid installation of python (2.7.x or 3.x both work). Also, numpy and h5py package are needed, you can install them by pip:

pip install h5py numpy

or by conda

conda install h5py numpy

if you use a supercomputer and don't have enough privilege:

  1. install anaconda by downloading from here and upload it to your directory.
  2. using queue system to install anaconda by chmod 755 anaconda*.sh && ./anaconda*.sh
  3. install numpy and h5py by download them from here and here, upload them as well.
  4. manually install package by conda install numpy*.tar.bz2 and conda install *h5py*.tar.bz2

Installing

Python script does not need manual compilation, so the installation is very easy.

  1. Download the script:
wget https://github.com/Chengcheng-Xiao/WOOPs/blob/master/WOOPs.py
  1. give correct permission:
chmod 755 WOOPs.py
  1. You can also put it into your system's PATH (assume you are using BASH):
echo export PATH=$( pwd )/WOOPs.py:'$PATH' >> .bashrc

Useage

File need for WOOPs:

  1. wannier90_u_AO.mat (Unitary matrix of atomic orbitals from valence band and conduction interpolation)
  2. wannier90_u_MO.mat (Unitary matrix of molecular orbitals from only valence band interpolation)
  3. wannier90_tb.dat (Use master branch for compatibility)
  4. input.woops

Detailed preparation for Wannier90 generated files can be found in Wanneir90's user guide, or in the example folder.

The format of input.woops follows:

readmode   = XX               #[must be True or False]
cal        = XX               #[Things you want to do]
num_mo     = XX               #[number of MO]
num_ao     = XX               #[number of AO]
num_kpts   = XX               #[number of kpts]
cell_param = XX XX XX         #[cell_param]
cell_dim   = XX               #[cell_dim: 0D, 1D, 2D or 3D] NOTE: currently 1D->x, 2D->xy
cprec      = XX             #controls the PRINTING precision of C_matrix, lower means accurate.   default=1e-4
bprec      = XX             #controls the PRINTING precision of WOOP_matrix, lower means accurate default=1e-4
pprec      = XX             #controls the PRINTING precision of WOPP_matrix, lower means accurate default=1e-2

IMPORTANT: Every tag must be written in lowercase, full length without abbreviation.

cal include:

NAME REQURE
get_orbital [needs wannier90* file]
check_completeness [needs get_AO and get_MO]
get_c_mat [needs get_AO and get_MO]
WOOP [default] [needs get_C_mat]
get_charge [needs WOOP]
WOPP [experimental] [needs WOOP and get_r_mat]

When the input file is properly prepared:

./WOOPs.py > woops.log &

or if you put it in your path:

WOOPs.py > woops.log &

This may take a few minutes, consider submitting it to the queue system.

These commands will produce a copy of data stored in hdf5 format and a text file with corresponding name for the calculation.

Running the tests

Go check the description in example folder.

Notes

WOPP is still under Alpha testing phase, the problem now I'm facing is that the 'position matrix', or, Wannier90's r_matrix ( position in hamiltonian.F90) do not agree with Wannier Function Center (rave in wannierise.F90). As a result, the ferroelectric polarization decomposition cannot be correctly calculated. To avoid this, I am now using <0n|r|Rm> written in the wanneir90_tb.dat file.

TODO_list

  1. Complete a simplified description of WOOP and its capability.

  2. Increase efficiency.

  3. Add progress bar.

How to cite

For the method please cite the following paper in any publications arising from the use of this code:

J. Bhattacharjee and U. V. Waghmare, Wannier orbital overlap population (WOOP), Wannier orbital position population (WOPP) and the origin of anomalous dynamical charges,Phys. Chem. Chem. Phys., 2010, 12, 1564โ€“1570

K. Terakura, S. Ishibashi, Mechanism of covalency-induced electric polarization within the framework of maximally localized Wannier orbitals,Phys. Rev. B 91, 195120 (2015)

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Chengcheng XIAO - Initial work - E-mail

License

This project is licensed under the MIT License - see the LICENSE.md file for details

woops's People

Contributors

chengcheng-xiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

woops's Issues

Sigma Bond can not be correctly decomposed

Sigma bond in N2 example cannot be correctly decomposed. This may be a problem for all sigma bonds constructed by p-orbitals. The problems are:

  • C_mats for one sigma bond are not symmetrical with respect to two p-orbitals.
    MO=     1 | AO=     1 | C_nt=   0.662683
    MO=     1 | AO=     4 | C_nt=  -0.748900
    
  • WOOP matrixes are not symmetrical as well.
    MO=  1 | AO_m=  1 [ 0, 0, 0] | AO_l=  1 [ 0, 0, 0] | B_iml=   0.878296
    MO=  1 | AO_m=  4 [ 0, 0, 0] | AO_l=  4 [ 0, 0, 0] | B_iml=   1.121704
    

The origin of this problem does not belong to the WOOPs code. Instead, It's originated from a non symmetrical U matrix produced by Wannier90.

Using this symmetrical U matrix for AO fixes this problem.

 written on 11Dec2018 at 19:39:22 
           1           6           6

   0.0000000000  +0.0000000000  +0.0000000000
  -0.6451639475  -0.0747564771
  -0.2730002632  +0.0603789107
  -0.0000000036  +0.0000000002
  +0.0325655349  +0.2240466950
  +0.6642261507  -0.0868698949
  +0.0000000909  +0.0000001684
  +0.0000002705  +0.0000000314
  -0.0000001345  +0.0000000296
  +0.7071067812  +0.0000000000
  -0.0000000007  -0.0000000051
  -0.0000000020  +0.0000000003
  -0.7071067812  -0.0000000000
  -0.2777241678  -0.0323116569
  +0.6342211169  -0.1399593686
  -0.0000000044  +0.0000000003
  +0.0963146453  +0.6629225045
  -0.2244911467  +0.0293455389
  +0.0000001087  +0.0000002015
  -0.6451641971  -0.0747565061
  -0.2730003689  +0.0603789340
  -0.0000000032  +0.0000000002
  -0.0325655223  -0.2240466083
  -0.6642258936  +0.0868698613
  +0.0000000875  +0.0000001622
  +0.0000002483  +0.0000000288
  -0.0000001235  +0.0000000272
  +0.7071067812  +0.0000000000
  -0.0000000007  -0.0000000051
  -0.0000000020  +0.0000000003
  +0.7071067812  +0.0000000000
  -0.2777242753  -0.0323116694
  +0.6342213623  -0.1399594228
  -0.0000000038  +0.0000000002
  -0.0963146080  -0.6629222480
  +0.2244910598  -0.0293455275
  +0.0000001048  +0.0000001941

However, this problem may not only happen to the U matrix for AOs, It may as well happen for MOs since we don't yet have a symmetrical initial projection for p-orbital Sigma bond. To formally deal with this problem, a modified version of DFT2Wannier90 interface is needed to:

  • Symmetrize the U matrixes under site symmetry operation.

  • Add user-defined initial projections. Or, since a perfect p-orbital sigma is like a ellipsoid, it can be easily employed into DFT2wannier90 code, just change the definition of the Spherical Harmonics to a ellipsoid like function.

performance upgrade needed

Current implementation cycles through matrix elements sequentially, this brings poor performance. To avoid this:

  • Change sequential calculation to matrix operations.

  • Add MPI or threading support since most data could be processed independently.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.