pymatgen.io.wannier90 module

Modules for working with wannier90 input and output.

class Unk(ik: int, data: ndarray)[source]

Bases: object

Object representing the data in a UNK file.

ik[source]

int index of kpoint for this file

data[source]

numpy.ndarray that contains the wavefunction data for in the UNK file. The shape should be (nbnd, ngx, ngy, ngz) for regular calculations and (nbnd, 2, ngx, ngy, ngz) for noncollinear calculations.

is_noncollinear[source]

bool that specifies if data is from a noncollinear calculation

nbnd[source]

int number of bands in data

ng[source]

sequence of three integers that correspond to the grid size of the given data. The definition is ng = (ngx, ngy, ngz).

Initialize Unk class.

Parameters:
  • ik (int) – index of the kpoint UNK file is for

  • data (np.ndarray) – data from the UNK file that has shape (nbnd, ngx, ngy, ngz) or (nbnd, 2, ngx, ngy, ngz) if noncollinear

property data: ndarray[source]

contains the wavefunction data for in the UNK file. The shape should be (nbnd, ngx, ngy, ngz) for regular calculations and (nbnd, 2, ngx, ngy, ngz) for noncollinear calculations.

Type:

np.ndarray

static from_file(filename: str) object[source]

Reads the UNK data from file.

Parameters:

filename (str) – path to UNK file to read

Returns:

Unk object

ik: int[source]
is_noncollinear: bool[source]
nbnd: int[source]
ng: Sequence[int][source]
write_file(filename: str) None[source]

Write the UNK file.

Parameters:

filename (str) – path to UNK file to write, the name should have the form ‘UNKXXXXX.YY’ where XXXXX is the kpoint index (Unk.ik) and YY is 1 or 2 for the spin index or NC if noncollinear