Skip to main content

A Wannier Tight-Binding Model Based Numerical Package

Project description

WanPy: A Wannier Tight-Binding Model Based Numerical Package

Requirements

  • numpy
  • scipy
  • sympy
  • pandas
  • mpi4py
  • h5py
  • fortio
  • hatch
  • spglib>=2.3.0
  • matplotlib (optional)
  • phonopy (optional; required by findmsg)
  • pymatgen (optional; required by wpyplotband)

Installation

  1. Create a Conda environment with the required packages:
conda create -n wanpy numpy scipy pandas sympy h5py mpi4py fortio hatch spglib matplotlib
  1. Uncompress wanpy package in personal computer or clusters:
tar zxvf wanpy.tar.gz

or

git clone https://github.com/jincao2013/wanpy.git
  1. Setup environment variables:

For debug in personal computer:

export PYTHONPATH="path_of_wanpy:$PYTHONPATH"
export PATH="path_of_wanpy/scripts:$PATH"
export WANPY_ROOT_DIR="your_work_dir"
export PYGUI="True"

For deployment in clusters:

export PYTHONPATH="path_of_wanpy:$PYTHONPATH"
export PATH="path_of_wanpy/scripts:$PATH"

Get start

# show usage
wanpy -h

# collect Wannier TB data to a single .h5 file
wanpy htb

# Collect Wannier TB data to a single .h5 file
wanpy wannier

# Write _hr.dat and _r.dat (optional) from .h5 file
wanpy write_dat

# Twist the order of .amn (uudd or udud) 
wanpy twist_amn

# compare Wannier and VASP band structure. support HSE type calculation. 
wpyplotband

# check job status
statistic_cores ...

Collect Wannier TB data

WanPy need to collect necessary Wannier TB data into a single .h5 file as the input for further calculations. This can be done by:

Method 1 (recommended): from wanpy wannier, this will need POSCAR .nnkp, .wout, .chk, .eig, and WAVECAR if --spn. The nnkp file can be obtained by:

$ wannier90.x -pp wannier90.win 

To start collecting dat:

# start to collect Wannier TB data 
wanpy wannier [options]

# For detail of options, see
wanpy wannier -h

Method 2: from wanpy htb, this will need at least POSCAR, .wout, _hr.dat . The files .nnkp, _r.dat, _wsvec.dat, and _spin.dat are optional.

# start to collect Wannier TB data 
wanpy htb [options]

# For detail of options, see
wanpy htb -h

Symmetric Wannier tight-binding models (SWTB)

The SWTB can be obtained during collecting Wannier TB data. Set symmetry related parameters in symmetry.in, then start to get SWTB with an additional tag --symmetry

wanpy wannier --symmetry [options]

See Comput. Phys. Commun. 270, 108153 (2022) (arXiv:2012.08871) for detail.

Important notice:

  • WanPy uses uudd order of Wannier orbitals for its internal calculations, which is the default setting when using v1.2 of wannier_setup. If a higher version vasp2wannier interface was used, one should utilize wanpy twist_amn to reorganize the .amn file into the uudd order and then redo the disentanglement.

  • wannier_center_def must be specified to excute wanpy wannier. The available options are poscar and ws. By using wannier_center_def = poscar, the wannier centers will align with POSCAR. For wannier_center_def = ws, the wannier centers will be refined in range of [-0.5, 0.5). For example, if .amn file is generated by VASP 5.4.4, set wannier_center_def = poscar. If .amn file is generated by VASP 6.4.3, set wannier_center_def = ws.

Template input file for generating htb.h5:

This template file can also be produced by executing wanpy wannier --temp:

# Input file for building symmetric Wannier TB model

# Choose method, default is kspace
symmetric_method = rspace   # Options: {rspace, kspace}
rspace_use_ngridR = F       # use ngridR to resample the TB model, default is False

# Choose between manually setting symmops or automatically detecting symmops from magmoms
parse_symmetry = man        # Options: {man, auto}

# Choose how wannier centers are defined in calculating .amn
# Options: {poscar, ws}
#   poscar: the same as poscar. Use this if amn is generated by VASP 5.4.4 (see mlwf.F for details). 
#   ws: refined in range of [-0.5, 0.5). Use this if amn is generated by VASP 6.4.3 (see mlwf.F for details). 
wannier_center_def = poscar 

ngridR = 12 12 1            # in kspace method, use a slightly larger value than the original TB model 

# Parameters used when parse_symmetry = auto
symprec = 1e-5
&magmoms
0 0 1
0 0 -1
/

# Parameters used when parse_symmetry = man
&symmops
# TR  det  alpha  nx  ny  nz  taux  tauy  tauz
  0   1    0      0   0   1   0     0     0   # e
  0   1    180    0   0   1   0.5   0.5   0   # c2z
# Anti-unitary symmetry operations
  1   1    0      0   0   1   0.5   0.5   0   # T
  1   1    180    0   0   1   0     0     0   # Tc2z
/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wanpy-0.15.2.tar.gz (191.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wanpy-0.15.2-py3-none-any.whl (212.9 kB view details)

Uploaded Python 3

File details

Details for the file wanpy-0.15.2.tar.gz.

File metadata

  • Download URL: wanpy-0.15.2.tar.gz
  • Upload date:
  • Size: 191.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for wanpy-0.15.2.tar.gz
Algorithm Hash digest
SHA256 02450af5d8a8c26096bf8dd2a17fdfa0b7687a6231fed3338b8ee2f45e594b4c
MD5 890a480555223f698d9020efaf84287b
BLAKE2b-256 8b9ae44c7b4abcfeeabf24f48e190ee144c2072ddb400b1cb3c1f535f0187004

See more details on using hashes here.

File details

Details for the file wanpy-0.15.2-py3-none-any.whl.

File metadata

  • Download URL: wanpy-0.15.2-py3-none-any.whl
  • Upload date:
  • Size: 212.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for wanpy-0.15.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1adcd3714e1a20d14af5e6f108d88029a135ca4247c0223c74df8a5b81283aa1
MD5 46a2ccc0eab42e104a3d8a1ef9280fd6
BLAKE2b-256 8e4bd4e893f06e70b17ad8f2ffc90fce6175380677c2513c767883ed69411788

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page