wannier90-utils¶
This package provides a library of functions for reading/writing and manipulating the data associated with the wannier90 code [1].
Features¶
Routines for reading/writing/manipulating a variety of files
Utilities for computing the centers and spreads of Wannier functions (see here)
Installation¶
To install the latest version of the wannier90-utils package, simply clone the repository and install using pip.
git clone https://github.com/jimustafa/wannier90-utils.git
cd wannier90-utils && pip install .
Documentation¶
Manipulating WIN files¶
Wannier90 I/O routines pertaining to WIN files
-
w90utils.io.win.print_atoms(atoms, units='crystal', file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]¶
-
w90utils.io.win.print_kgrid(kgrid, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]¶
-
w90utils.io.win.print_kpoints(kpoints, mp_grid=None, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]¶
-
w90utils.io.win.print_unit_cell(dlv, units='bohr', file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]¶
Parsing WOUT files¶
Wannier90 I/O routines pertaining to WOUT files
Parsing NNKP files¶
Wannier90 I/O routines pertaining to NNKP files
Fundamental I/O routines¶
|
Read EIG file. |
|
Write \(E_{n\mathbf{k}}\) to EIG file. |
|
Read EIG file and return k-dependent Hamiltonian matrix. |
|
Read AMN file. |
|
Write \(A^{(\mathbf{k})}_{mn}\) to AMN file. |
|
Read MMN file |
|
Write \(M^{(\mathbf{k},\mathbf{b})}_{mn}\) to MMN file |
-
w90utils.io.read_eig(fname)[source]¶ Read EIG file.
- Parameters
fname (str) – path to EIG file
- Returns
ndarray, shape (nkpts, nbnds, nproj)
-
w90utils.io.write_eig(fname, eig)[source]¶ Write \(E_{n\mathbf{k}}\) to EIG file.
- Parameters
fname (str) – path to EIG file
eig (ndarray, shape (nkpts, nbnds)) –
-
w90utils.io.read_hamiltonian(fname)[source]¶ Read EIG file and return k-dependent Hamiltonian matrix.
- Parameters
fname (str) – path to EIG file
- Returns
ndarray, shape (nkpts, nbnds, nbnds)
-
w90utils.io.read_amn(fname)[source]¶ Read AMN file.
- Parameters
fname (str) –
- Returns
ndarray, shape (nkpts, nbnds, nproj)
-
w90utils.io.write_amn(fname, amn, header='HEADER')[source]¶ Write \(A^{(\mathbf{k})}_{mn}\) to AMN file.
- Parameters
fname (str) –
amn (ndarray, shape (nkpts, nbnds, nproj)) –
header (str) –
Wannier function centers and spreads¶
Functions for computing Wannier centers and components of the spread
-
w90utils.sprd.omega(Mmn, bvectors, bweights)[source]¶ Compute the spread functional
- Parameters
Mmn (ndarray, shape (nkpts, nntot, nbnds, nbnds)) – the overlap matrix
bvectors (ndarray, shape (nkpts, nntot, 3)) –
bweights (ndarray, shape (nntot,)) –
-
w90utils.sprd.omega_d(m, bvectors, bweights, idx=None)[source]¶ Compute the diagonal contribution to the spread functional
- Parameters
m (ndarray, shape (nkpts, nntot, nbnds, nbnds)) – the overlap matrix
bvectors (ndarray, shape (nkpts, nntot, 3)) –
bweights (ndarray, shape (nntot,)) –
-
w90utils.sprd.omega_dod(Mmn, bvectors, bweights)[source]¶ Compute the sum of the diagonal and off-diagonal contribution to the spread functional
- Parameters
Mmn (ndarray, shape (nkpts, nntot, nbnds, nbnds)) – the overlap matrix
bvectors (ndarray, shape (nkpts, nntot, 3)) –
bweights (ndarray, shape (nntot,)) –
-
w90utils.sprd.omega_i(Mmn, bweights)[source]¶ Compute the invariant contribution to the spread functional
- Parameters
Mmn (ndarray, shape (nkpts, nntot, nbnds, nbnds)) – the overlap matrix
bweights (ndarray, shape (nntot,)) –
-
w90utils.sprd.omega_iod(m, bweights, idx=None)[source]¶ Compute the sum of the invariant and off-diagonal contribution to the spread functional
- Parameters
m (ndarray, shape (nkpts, nntot, nbnds, nbnds)) – the overlap matrix
bweights (ndarray, shape (nntot,)) –
Processing postw90 output¶
-
w90utils.io.postw90.print_kpoints(kpoints, header='', units='crystal', file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]¶
-
w90utils.io.postw90.read_bands_kpoints(fname)[source]¶ Read k-points from the
geninterpdat file- Parameters
fname (str) –
- Returns
ndarray, shape (nkpts, 3) – array of kpoints using for
geninterp, in units of \(\unicode{x212B}^{-1}\)
-
w90utils.io.postw90.read_vnk(fname)¶