Wannier90 files
Warning
Several APIs (for example read_amn, write_amn, read_chk, and write_chk) support Fortran unformatted (binary) files. Those files are compiler/platform dependent, so portability across all environments is not guaranteed.
Prefer text formats for maximum interoperability, and use binary when you need compatibility with a specific upstream/downstream toolchain.
Current tests cover:
- Linux + gfortran 11.2
Public API
WannierIO.read_amn Function
read_amn(file)
read_amn(file, ::FortranText)
read_amn(file, ::FortranBinaryStream)Read wannier90 amn file.
Arguments
file: The name of the input file, or anIO.
Return
A: dense array of sizen_bands × n_wann × n_kpts.header: first line of the file
Note there are three versions of this function: the 1st one is a wrapper function that automatically detect the format (text or binary) of the file, and does some additional pretty printing to give user a quick hint of the dimensions of the A matrix; it internally calls the 2nd or the 3rd version for actual reading.
Wannier90 only has Fortran text format for amn, however I wrote a custom version of QE pw2wannier90.x that can output Fortran binary format (using Fortran stream IO) to save some disk space. The 1st function auto detect the file format so it is transparent to the user.
WannierIO.write_amn Function
write_amn(file, A; header=default_header(), binary=false)
write_amn(file, A, ::FortranText; header=default_header())
write_amn(file, A, ::FortranBinaryStream; header=default_header())Write wannier90 amn file.
Arguments
file: The name of the output file, or anIO.A: dense array of sizen_bands × n_wann × n_kpts
Keyword arguments
header: 1st line of the filebinary: write as Fortran unformatted file, which is the Wannier90 default. Here thebinarykwargs is provided for convenience.
Same as read_amn there are three versions of this function, the 1st one is a wrapper function, it calls the 2nd or the 3rd version depending on the binary kwargs.
WannierIO.read_w90_band Method
read_w90_band(prefix, recip_lattice)Arguments
prefix: prefix of the output filesprefix_band.dat,prefix_band.kpt, andprefix_band.labelinfo.datrecip_lattice: each column is a reciprocal lattice vector in Å.
Return
kpath: aCrystalBase.KPathobjecteigenvalues:n_bands × n_kptsmatrix of band energies
Note
The read_w90_band(prefix) function returns a NamedTuple containing basis variables such as kpoints, symmetry_point_indices, etc. Here, once we know the recip_lattice, we can return a more convenient KPath.
WannierIO.read_w90_band Method
read_w90_band(prefix)Read prefix_band.dat, prefix_band.kpt, prefix_band.labelinfo.dat.
Arguments
prefix: prefix of the filenames (or called seedname in wannier90), NOT the full filename.
Return
x:n_kpts, x axis value of kpath, in cartesian lengtheigenvalues:n_bands × n_kptsmatrix of band energieskpoints: a vector of lengthn_kpts, fractional coordinateskweights: a vector of lengthn_kpts, weights of kpointssymmetry_point_indices: index of high-symmetry points inprefix_band.datsymmetry_point_labels: name of high-symmetry points
WannierIO.read_w90_band_dat Method
read_w90_band_dat(io)Read prefix_band.dat file generated by wannier90.x, or prefix-band.dat file generated by postw90.x.
Return
x:n_kpts, x axis value of kpath, in cartesian lengtheigenvalues:n_bands × n_kptsmatrix of band energiesextras: optional (thepostw90.xmight generate a file with a third column), same size aseigenvalues, often the color of each eigenvalue, e.g., spin projection
WannierIO.read_w90_band_kpt Method
read_w90_band_kpt(io)Read a prefix_band.kpt file.
Return
kpoints: a vector of lengthn_kpts, fractional coordinateskweights: a vector of lengthn_kpts, weights of kpoints
WannierIO.read_w90_band_labelinfo_dat Method
read_w90_band_labelinfo_dat(io)Read prefix_band.labelinfo file.
Return
symmetry_point_indices: index of high-symmetry points inprefix_band.datsymmetry_point_labels: name of high-symmetry points
WannierIO.write_w90_band Method
write_w90_band(prefix, kpath, eigenvalues)Write prefix_band.dat, prefix_band.kpt, prefix_band.labelinfo.dat.
This is a more user-friendly version that works with CrystalBase.KPath; the WannierIO.write_w90_band(prefix; kwargs...) is the low-level version. eigenvalues is an n_bands × n_kpts matrix of band energies.
WannierIO.write_w90_band Method
write_w90_band(
prefix;
x,
eigenvalues,
kpoints,
kweights,
symmetry_point_indices,
symmetry_point_labels
)Write prefix_band.dat, prefix_band.kpt, prefix_band.labelinfo.dat.
Arguments
prefix: prefix ofprefix_band.dat, prefix_band.kpt, prefix_band.labelinfo.dat
Keyword Arguments
x:n_kpts, x axis value, in cartesian lengtheigenvalues:n_bands × n_kptsmatrix of band energieskpoints: length-n_kptsvector, fractional coordinateskweights: a vector of lengthn_kpts, weights of kpointssymmetry_point_indices: index of high-symmetry points inprefix_band.datsymmetry_point_labels: name of high-symmetry points
WannierIO.write_w90_band_dat Method
write_w90_band_dat(io; x, eigenvalues, extras)Write prefix_band.dat file.
Arguments
file: The name of the output file, or anIO.
Keyword Arguments
x:n_kpts, x axis value, in cartesian lengtheigenvalues:n_bands × n_kptsmatrix of band energiesextras: optional, same size aseigenvalues, will be written as the third column ofprefix_band.dat. Theprefix-band.datfile generated bypostw90.xsometimes has a third column for e.g. the color of the eigenvalues
WannierIO.write_w90_band_kpt Method
write_w90_band_kpt(io; kpoints, kweights)Write prefix_band.kpt file.
Arguments
file: The name of the output file, or anIO.
Keyword Arguments
kpoints: length-n_kptsvector, fractional coordinateskweights:n_kpts, optional, weights of kpoints, default to 1.0.
WannierIO.write_w90_band_labelinfo_dat Method
write_w90_band_labelinfo_dat(
io;
x,
kpoints,
symmetry_point_indices,
symmetry_point_labels
)Write prefix_band.labelinfo.dat file.
Arguments
file: The name of the output file, or anIO.
Keyword Arguments
x: length-n_kptsx-axis coordinates (Cartesian path length)kpoints: length-n_kptsvector of fractional coordinatessymmetry_point_indices: indices of high-symmetry points along the pathsymmetry_point_labels: labels of high-symmetry points
WannierIO.gauge_matrices Method
gauge_matrices(chk)Extract the combined U = Udis * Uml matrices from Chk.
WannierIO.gauge_matrices_dis Method
gauge_matrices_dis(chk)Extract disentanglement Udis matrices from Chk.
WannierIO.read_chk Method
read_chk(filename)
read_chk(file, ::FortranText)
read_chk(file, ::FortranBinary)Read wannier90 chk checkpoint file.
Arguments
file: The name of the input file, or anIO.
Similar to read_amn, the 1st version auto detect chk file format (binary or text) and read it.
WannierIO.write_chk Function
write_chk(filename, chk::Chk; binary=false)
write_chk(file, chk::Chk, ::FortranText)
write_chk(file, chk::Chk, ::FortranBinary)Write wannier90 chk file.
Similar to write_amn, the 1st version is a convenience wrapper.
Arguments
file: The name of the output file, or anIO.chk: theChkstruct
Keyword arguments
binary: write as Fortran binary file or not. Although wannier90 default is Fortran binary format, here the default isfalsesince Fortran binary depends on compiler and platform, so it is not guaranteed to always work.
WannierIO.read_eig Function
read_eig(file)
read_eig(file, ::FortranText)
read_eig(file, ::FortranBinaryStream)Read the wannier90 eig file.
Arguments
file: The name of the input file, or anIO.
Return
eigenvalues: a matrix of sizen_bands × n_kpts
The 1st version is a convenience wrapper function for the 2nd and 3rd versions.
sourceWannierIO.write_eig Function
write_eig(file, eigenvalues; binary=false)
write_eig(file, eigenvalues, ::FortranText)
write_eig(file, eigenvalues, ::FortranBinaryStream)Write eig file.
Arguments
file: The name of the output file, or anIO.eigenvalues: a matrix of sizen_bands × n_kpts
Keyword arguments
binary: if true write in Fortran binary format.
WannierIO.write_HH_R_dat Method
write_HH_R_dat(io, hhr)Write the real space Hamiltonian to a prefix_HH_R.dat file.
Arguments
file: The name of the output file, or anIO.hhr: aHHRDatstruct
Note
Wannier90 postw90.x has a hidden input parameter effective_model, setting it to true and postw90.x will read this HH_R.dat to fill the real space Hamiltonian, and do subsequent Wannier interpolation, e.g., in BoltzWann. However, the vanilla postw90.x code does not take into account the degeneracy of R vectors, and also does not use MDRS interpolation. I have modified the postw90.x code to use MDRS, and also changed a bit the number of digits for the Hamiltonian in HH_R.dat, so that it is the same as the prefix_tb.dat file, i.e., from Fortran F12.6 to E15.8.
WannierIO.read_w90_hr_dat Method
read_w90_hr_dat(io)Read prefix_hr.dat.
Return
Rvectors:-vectors on which operators are defined Rdegens: degeneracies of each-vector H: Hamiltonianheader: the first line of the file
WannierIO.write_w90_hr_dat Method
write_w90_hr_dat(io, hrdat)Write prefix_hr.dat.
Arguments
See the fields of HrDat.
WannierIO.read_isym Method
read_isym(io_or_filename)Read prefix.isym and convert to the standard Seitz convention.
Equivalent to Isym(read_isym_raw(filename)); see Isym(::RawIsym) for the conversion and Isym for the conventions of the returned struct.
WannierIO.read_isym_raw Method
read_isym_raw(io)Read prefix.isym without any convention conversion.
The returned RawIsym mirrors the file (QE conventions); use it for debugging and direct comparison with pw2wannier90. For everything else use read_isym, which returns the standard Seitz convention.
WannierIO.read_mmn Function
read_mmn(file)
read_mmn(file, ::FortranText)
read_mmn(file, ::FortranBinaryStream)Read wannier90 mmn file.
Arguments
file: The name of the input file, or anIO.
Return
Mmnstruct containing the data in the file
WannierIO.write_mmn Function
write_mmn(file, mmn; binary=false)
write_mmn(file, mmn, ::FortranText)
write_mmn(file, mmn, ::FortranBinaryStream)Write wannier90 mmn file.
Arguments
file: The name of the output file, or anIO.mmn: aMmnstruct
Keyword arguments
binary: if true write in Fortran binary format
WannierIO.Nnkp Type
Container for wannier90 nnkp data.
Each field mirrors one block of the file. A projection block the file does not have is nothing: wannier90 writes exactly one of projections (spinless) and spinor_projections (spinor), which may be empty when auto_projections is used.
struct Nnkp{T<:Real}Fields
lattice:real_latticeblock, each column is a lattice vector, in Årecip_lattice:recip_latticeblock, each column is a reciprocal lattice vector, in Å⁻¹kpoints:kpointsblock, length-n_kptsvector, fractional coordinatesprojections:projectionsblock, ornothingif the file has nonespinor_projections:spinor_projectionsblock, ornothingif the file has noneauto_projections:auto_projectionsblock: the number of Wannier functions for automatic initial projections, ornothingif the file has nonekpb_k:nnkptsblock: index of the neighboring kpoint,n_bvecs × n_kptskpb_G:nnkptsblock: translation of the neighboring kpoint, fractional w.r.t.recip_lattice,n_bvecs × n_kpts.b = kpoints[kpb_k[ib, ik]] + kpb_G[ib, ik] - kpoints[ik]is theib-th bvector of theik-th kpoint.exclude_bands:exclude_bandsblock, band indices excluded from the calculation
WannierIO.Nnkp Method
Nnkp(; lattice, recip_lattice, kpoints, kpb_k, kpb_G,
projections = nothing, spinor_projections = nothing,
auto_projections = nothing, exclude_bands = Int[])Construct a Nnkp from its blocks; the optional blocks default to absent.
WannierIO.read_nnkp Function
read_nnkp(file)
read_nnkp(file, ::W90InputText)
read_nnkp(file, ::W90InputToml)Read wannier90 nnkp file.
Arguments
file: The name of the input file, or anIO.
Return
- a
Nnkpstruct, one field per block of the file
Wannier90 nnkp file is a plain text format, the 2nd version reads nnkp file in Wannier90 format. The thrid version read a TOML-format nnkp file, which is defined by this package, see write_nnkp. The 1st version auto detects the format and parse it.
WannierIO.write_nnkp Function
write_nnkp(file, nnkp; header)
write_nnkp(file, nnkp, ::W90InputText; header)
write_nnkp(file, nnkp, ::W90InputToml; header)Write a nnkp file that can be used by DFT codes, e.g., QE pw2wannier90.
The text format prints every real number as the shortest decimal that reads back as the same Float64, so that the lattice, kpoints, projection centers and axes keep their full precision: wannier90 prints 7 or 8 decimals, and a kpoint such as 1/7 or a hexagonal axis would otherwise enter pw2wannier90 rounded. Readers that parse the file in Fortran list-directed form, as pw2wannier90 does, accept any number of digits.
Arguments
file: The name of the output file, or anIO.nnkp: aNnkp; each block that is notnothingis written
Keyword arguments
header: first line of the file
WannierIO.format_projections Method
format_projections(projections) -> StringThe begin projections ... end projections block of a .win file for the HydrogenOrbitals projections, one f=…:l=…,mr=…:z=…:x=… line per orbital (fractional centers, Cartesian axes; :r=… and :zona=… when not the default 1). For SpinorHydrogenOrbitals (which need spinors = .true.), consecutive spin-up and spin-down copies of one orbital with a common quantization axis are written as one line with (u,d)[…], single ones with (u)[…] or (d)[…].
See also parse_projections for the inverse.
WannierIO.parse_projections Function
parse_projections(win)
parse_projections(lines, lattice, atoms; spinors = false)
parse_projections(lines, crystal::Crystal; spinors = false)Expand the projections block of a win file into the orbitals that wannier90.x -pp writes to the nnkp file: a Vector{HydrogenOrbital}, or with spinors a Vector{SpinorHydrogenOrbital}.
The first form takes a parsed win (read_win) and checks that the block defines at least num_wann orbitals. The second takes the raw lines of the block, the lattice vectors as columns (Å), and the atoms_frac pairs label => fractional position. The third takes them from a Crystal, whose atom_labels must then be valid element labels; the second also accepts dummy labels such as X1.
The syntax is that of wannier90, case insensitive and ignoring spaces: an optional first line Ang or Bohr (the unit of c=), then one site:orbitals[:modifiers][(spins)][[spin axis]] per line, where
siteisc=x,y,z(Cartesian),f=x,y,z(fractional), or an atom label, which expands to every atom of that label, in the order ofatoms;orbitalsare;-separated groups, each eitherl=…with an optional,mr=…,…list, or,-separated names (s,p,px,dxy,fz3,sp3,sp3-1, …);modifiersarez=x,y,z,x=x,y,z,r=nandzona=α, separated by:;(u),(d)or(u,d)(default) selects the spin components and[x,y,z]the spin quantization axis (default[0,0,1]), both only withspinors.
As in wannier90, the orbitals of a line are ordered by site, then l (hybrids l < 0 first), then mr, then spin (up first), whatever the order in which they are written; the axes are normalized and made orthogonal. A nonorthogonal x= of the axially symmetric pz, dz2, fz3 is replaced by the first of x̂, ŷ orthogonalized against z=, where wannier90 draws a random axis. Throws an ArgumentError for random projections, which wannier90 draws from an unseeded generator, and, more strictly than wannier90, for text after a closing ) or ] and for unknown modifiers, which it ignores.
See also format_projections for the inverse.
WannierIO.read_w90_r_dat Method
read_w90_r_dat(io)Read prefix_r.dat.
Return
RDatstruct containing the data in the file
WannierIO.write_w90_r_dat Method
write_w90_r_dat(io, rdat)Write prefix_r.dat.
Arguments
See the fields of RDat.
WannierIO.read_spn Function
read_spn(filename)
read_spn(file, ::FortranText)
read_spn(file, ::FortranBinary)Read the wannier90 spn file.
Arguments
file: The name of the input file, or anIO.
Return
Spnstruct containing the data in the file
WannierIO.write_spn Function
write_spn(filename, spn; binary=false)
write_spn(file, spn, ::FortranText)
write_spn(file, spn, ::FortranBinary)Write the spn file.
Arguments
file: The name of the output file, or anIO.spn: aSpnstruct
WannierIO.read_w90_tb_dat Method
read_w90_tb_dat(io)Read prefix_tb.dat.
Return
TbDatstruct containing the data in the file
WannierIO.write_w90_tb_dat Method
write_w90_tb_dat(io, tbdat)Write prefix_tb.dat.
Arguments
See the fields of TbDat.
WannierIO.read_uHu Function
read_uHu(filename)
read_uHu(file, ::FortranText; transpose_band_indices=true)
read_uHu(file, ::FortranBinary; transpose_band_indices=true)Read the wannier90 uHu file.
Arguments
file: The name of the input file, or anIO.
Keyword Arguments
transpose_band_indices: QE pw2wannier90.x writes the matrix in a strange transposed manner; if reading a QE-generateduHufile, this flag should be true to restore the band indices order, so that the returned matrix has the correct order, i.e.,uHu[ik][ib1, ib2][m, n]is
Return
uHu: a length-n_kptsvector, each element is an_bvecs * n_bvecsmatrix, then each element is an_bands * n_bandsmatrixheader: 1st line of the file
WannierIO.write_uHu Function
write_uHu(filename, uHu; binary=false, header)
write_uHu(file, uHu, ::FortranText; header)
write_uHu(file, uHu, ::FortranBinary; header)Write the uHu file.
Arguments
file: The name of the output file, or anIO.uHu: a length-n_kptsvector, each element is an_bvecs * n_bvecsmatrix, then each element is an_bands * n_bandsmatrix
Keyword Arguments
transpose_band_indices: seeread_uHu
WannierIO.read_uIu Function
read_uIu(filename)
read_uIu(file, ::FortranText; transpose_band_indices=true)
read_uIu(file, ::FortranBinary; transpose_band_indices=true)Read the wannier90 uIu file.
Arguments
file: The name of the input file, or anIO.
Keyword Arguments
transpose_band_indices: QE pw2wannier90.x writes the matrix in a strange transposed manner; if reading a QE-generateduIufile, this flag should be true to restore the band indices order, so that the returned matrix has the correct order, i.e.,uIu[ik][ib1, ib2][m, n]is
Return
uIu: a length-n_kptsvector, each element is an_bvecs * n_bvecsmatrix, then each element is an_bands * n_bandsmatrixheader: 1st line of the file
WannierIO.write_uIu Function
write_uIu(filename, uIu; binary=false, header)
write_uIu(file, uIu, ::FortranText; header)
write_uIu(file, uIu, ::FortranBinary; header)Write the uIu file.
Arguments
file: The name of the output file, or anIO.uIu: a length-n_kptsvector, each element is an_bvecs * n_bvecsmatrix, then each element is an_bands * n_bandsmatrix
Keyword Arguments
transpose_band_indices: seeread_uIu
WannierIO.read_u_mat Method
read_u_mat(file)Read wannier90 prefix_u.mat or prefix_u_dis.mat file.
Arguments
file: The name of the input file, or anIO.
Return
U:Udis(for disentanglement) orU(for maximal localization) matrices, array of sizen_bands × n_wann × n_kptskpoints: fractional kpoint coordinatesheader: 1st line of the file
Warning
The wannier90 output prefix_u_dis.mat internally sorts the band indices according to the disnentanglement window, therefore it can be different from the original Bloch states, see the code and comments in gauge_matrices_dis.
WannierIO.write_u_mat Method
write_u_mat(file, U, kpoints; header=default_header(), digits=10)Write wannier90 prefix_u.mat or prefix_u_dis.mat file.
Arguments
file: The name of the output file, or anIO.U:Udis(for disentanglement) orU(for maximal localization) matriceskpoints: fractional kpoint coordinates
Keyword arguments
header: 1st line of the file, optionaldigits: decimal digits of every real number; wannier90 writes 10, and its free-format reader accepts more. Use 16 to store aFloat64gauge losslessly.
Warning
The wannier90 output prefix_u_dis.mat internally sorts the band indices according to the disnentanglement window, therefore it can be different from the original Bloch states, see the code and comments in gauge_matrices_dis. This function just writes whatever is inside the input U matrix, without consider the order of disentanglement window.
WannierIO.read_unk Function
read_unk(filename)
read_unk(file, ::FortranText)
read_unk(file, ::FortranBinary)Read wannier90 UNK file for the periodic part of Bloch wavefunctions.
Arguments
file: The name of the input file, or anIO.
Return
ik: k-point index, start from 1Ψ: periodic part of Bloch wavefunctions in real space, size =(n_gx, n_gy, n_gz, n_bands, n_spin)
WannierIO.write_unk Function
write_unk(filename, ik, Ψ; binary=false)
write_unk(file, ik, Ψ, ::FortranText)
write_unk(file, ik, Ψ, ::FortranBinary)Write UNK file for the periodic part of Bloch wavefunctions.
Arguments
file: The name of the output file, or anIO.ik: at which kpoint? start from 1Ψ: Bloch wavefunctions,size(Ψ) = (n_gx, n_gy, n_gz, n_bands, n_spin)
Keyword arguments
binary: write as Fortran unformatted file
WannierIO.read_win Function
read_win(file; standardize=true)
read_win(file, ::W90InputText; standardize=true)
read_win(file, ::W90InputToml; standardize=true)Read wannier90 input win file.
Arguments
file: The name of the input file, or anIO.
Keyword Arguments
standardize: sanity check and fix the input parameters, e.g., setnum_bands = num_wannifnum_bandsis not specified, convertatoms_cartalways toatoms_frac, etc. See alsostandardize_win!.
WannierIO.write_win Function
write_win(file, params; header)
write_win(file, params, ::W90InputText; header)
write_win(file, params, ::W90InputToml; header)Write input parameters into a wannier90 win file.
Arguments
file: The name of the output file, or anIO.params: aDict(orOrderedDict) of parameters to be written into thewinfile
Examples
using OrderedCollections, WannierIO
params = OrderedDict(
"num_wann" => 4,
"num_bands" => 4,
# unit_cell_cart is a matrix, its columns are the lattice vectors in angstrom
"unit_cell_cart" => [
0.0 2.71527 2.71527
2.71527 0.0 2.71527
2.71527 2.71527 0.0
],
# atoms_frac is a vector of pairs of atom_label and fractional coordinates
"atoms_frac" => [
"Si" => [0.0, 0.0, 0.0],
"Si" => [0.25, 0.25, 0.25],
],
# each element in projections will be written as a line in the win file
"projections" => [
"random",
],
"kpoint_path" => [
["G" => [0.0, 0.0, 0.0], "X" => [0.5, 0.0, 0.5]],
["X" => [0.5, 0.0, 0.5], "U" => [0.625, 0.25, 0.625]],
],
"mp_grid" => [2, 2, 2],
# kpoints is a matrix, its columns are the fractional coordinates
"kpoints" => [
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.5],
[0.0, 0.5, 0.0],
[0.0, 0.5, 0.5],
[0.5, 0.0, 0.0],
[0.5, 0.0, 0.5],
[0.5, 0.5, 0.0],
[0.5, 0.5, 0.5],
],
# additional parameters, e.g.,
"num_iter" => 500,
)
write_win("silicon.win", params)WannierIO.read_wout Method
read_wout(io; iterations)Parse wannier90 wout file.
Keyword Arguments
iterations: iftrue, parse all the iterations of disentanglement and maximal localization. Default isfalse.
Return
lattice: each column is a lattice vector in Årecip_lattice: each column is a reciprocal lattice vector in Å⁻¹atom_labels: atomic labelsatom_positions: in fractional coordinateskgrid: kpoint grid used in Wannierizationcenters: center of each final WF, in Åspreads: spread of each final WF, in Ųsum_centers: sum of final WF centers, in Åsum_spreads: sum of final WF spreads, in ŲΩI,ΩD,ΩOD,Ωtotal: final spread (components) in Ųphase_factors: optional, global (multiplicative) phase factor for obtaining real-valued (or close to real) MLWFsim_re_ratios: optional, maximum Im/Re ratioiterations: disentanglement and max localization convergence history, only parsed when kwargiterations=true
WannierIO.read_w90_wsvec_dat Method
read_w90_wsvec_dat(io)Read prefix_wsvec.dat.
Return
WsvecDatstruct containing the data in the file
WannierIO.write_w90_wsvec_dat Method
write_w90_wsvec_dat(io, wsvec)Write prefix_wsvec.dat.
Private API
Lower-level helpers and internal utilities are documented here for power users. Most users should prefer the exported high-level functions above.
WannierIO.default_band_kpt_kweights Method
default_band_kpt_kweights(kpoints)Wannier90 default kweights in prefix_band.kpt is all 1.0.
WannierIO.read_w90_band_kpt_labelinfo Method
read_w90_band_kpt_labelinfo(prefix, recip_lattice)Read kpoints and labels from wannier90 formats: prefix_band.kpt, prefix_band.labelinfo.dat.
Arguments
prefix: the prefix of the input filesprefix_band.kptandprefix_band.labelinfo.datrecip_lattice: the reciprocal lattice matrix
Returns
kpath: aCrystalBase.KPathobject
WannierIO.write_w90_band_kpt_labelinfo Method
write_w90_band_kpt_labelinfo(prefix, kpath)Write kpoints into wannier90 formats: prefix_band.kpt, prefix_band.labelinfo.dat.
Arguments
prefix: the prefix of the output filesprefix_band.kptandprefix_band.labelinfo.datkpath: aCrystalBase.KPathobject
Tip
This allows writing auto generated high-symmetry kpoints and labels from crystal structure (by CrystalBase.KPath(::Crystal)) into files. Then other codes can use the kpoints for band structure calculations, e.g., QE pw.x bands calculation, or in the win input file for Wannier90.
Example
using Spglib, Brillouin, CrystalBase, WannierIO
win = read_win("si2.win")
# Set the number of kpoints along the 1st segment to 100 points
kp = KPath(Crystal(win); n_points_first_segment = 100)
write_w90_band_kpt_labelinfo("si2", kp)WannierIO.Chk Type
Struct for storing matrices in prefix.chk file.
struct Chk{T<:Real}One-to-one mapping to the wannier90 chk file, but renaming the variable names so that they are consistent with the rest of the code.
Fields
header: The header line, usually contains date and timen_bands: number of bands, can be auto set in constructor according to dimensions of other variablesn_exclude_bands: number of excluded bands, can be auto set in constructorexclude_bands: Indices of excluded bands, starts from 1. Vector of integers, size:n_exclude_bandslattice: Matrix of size 3 x 3, each column is a lattice vector in Å unitrecip_lattice: Matrix of size 3 x 3, each column is a reciprocal lattice vector in Å⁻¹ unitn_kpts: number of kpoints, can be auto set in constructorkgrid: dimensions of kpoint grid, 3 integerskpoints: kpoint coordinates, fractional, length-n_kptsvectorn_bvecs: number of b-vectors, can be auto set in constructorn_wann: number of Wannier functions, can be auto set in constructorcheckpoint: a string to indicate the current step (after disentanglement, after maximal localization, ...) in wannier90have_disentangled: Have finished disentanglement or notΩI: Omega invariant part of MV spreads, in Ų unitdis_bands: Indices of bands taking part in disentanglement, not frozen bands! stored as a densen_bands × n_kptsboolean matrix. This is needed since W90 puts all the disentanglement bands in the first several rows ofUdis, (and the first few columns ofUdisare the frozen bands) so directly multiplying eigenvalues e.g.(Udis * U)' * diag(eigenvalues) * (Udis * U)is wrong!n_dis: number of bands taking part in disentanglement at each kpoint. can be auto set in constructor fromdis_bandsUdis: Semi-unitary matrix for disentanglement with sizen_bands × n_wann × n_kpts, i.e., theu_matrix_optin wannier90.Uml: Unitary matrix for maximal localization with sizen_wann × n_wann × n_kpts, i.e., theu_matrixin wannier90. The abbreviationmlstands for maximal localization, so as to differentiate from the (combined) unitary matrixU = Udis * Uml.M: Wannier-gauge overlap matrix with sizen_wann × n_wann × n_bvecs × n_kpts, i.e., them_matrixin wannier90r: Wannier function centers, length-n_wannvector, Cartesian coordinates in Å unit, i.e., thewannier_centresvariable in wannier90ω: Wannier function spreads, length-n_wannvector, Ų unit, i.e., thewannier_spreadsvariable in wannier90
WannierIO.Chk Method
Chk(
header,
exclude_bands,
lattice,
recip_lattice,
kgrid,
kpoints,
checkpoint,
have_disentangled,
ΩI,
dis_bands,
Udis,
Uml,
M,
r,
ω
)Convenience constructor of Chk struct that auto set some fields.
WannierIO._check_eig_order Method
_check_eig_order(eigenvalues; digits)Check that eigenvalues are in order.
Some times there are small noises, use digits to set the number of digits for comparisons.
WannierIO._reshape_eig Method
_reshape_eig(idx_b, idx_k, eig)Reshape a vector of eigenvalues into a matrix of eigenvalues.
Auto detect the number of bands and kpoints.
sourceWannierIO.HHRDat Type
Container for prefix_HH_R.dat data.
struct HHRDat{T<:Real, IT<:Integer}Fields
header: Header lineRvectors:Rvectors of lengthn_rvecsRdegens: Degeneracy vector for each R vector, ornothingH: Hamiltonian with sizen_wann × n_wann × n_rvecs
WannierIO.HrDat Type
Container for prefix_hr.dat data.
struct HrDat{T<:Real, IT<:Integer}Fields
header: Header lineRvectors:Rvectors on which operators are defined, lengthn_RvecsRdegens: Degeneracies of eachRvector, lengthn_RvecsH: Hamiltonian matrices in real space, with sizen_wann × n_wann × n_Rvecs
WannierIO.Isym Type
Container for prefix.isym data in the standard Seitz convention. Produced by Isym(::RawIsym) (or directly by read_isym).
struct IsymFields
header: Header linen_symops: Number of symmetry operationsspinors: Whether spinors are consideredsymops: Symmetry operations in standard Seitz conventionn_kpts_ibz: Number of IBZ kpointskpoints_ibz: IBZ kpoints in fractional coordinatesn_bands: Number of bandslittlegroup_reps: Little-group representation matricesd(ĥ, k), sparse in(ik_ibz, ig): only elements of the little group of each IBZ kpoint are presentn_wann: Number of Wannier functionsorbital_reps: Orbital representation matrices, dense in the operations:orbital_reps[ig]storesD(g_ig)
WannierIO.Isym Method
Isym(raw)Convert a RawIsym (file/QE conventions) to an Isym in the standard Seitz convention:
symmetry operations are converted by
SymOp(::RawSymOp)orbital_reps[ig]storesD(g_ig), the inverse of the raw entryrepmat_wann[ig], which is the matrix of the exact inverse operationg_ig^{-1}(D^†for a unitary operation; for an antiunitary one, which acts asD KwithKcomplex conjugation, the inverse acts asD^T K, soDis the transpose of the raw entry)littlegroup_repsare copied unchanged (the file'sdmatrices are already the standardd(ĥ, k) = ⟨ψ_m|ĥ ψ_n⟩)
For spinors all three objects then share one SU(2) sign choice (u(g) or -u(g) for each operation), that of the u field of the operations: pw2wannier90 rotates the wave functions with u(g) and builds the raw orbital entry of g^{-1} with u(g)^†. Re-indexing the raw entry of the stored inverse element invs(ig) instead would flip the sign for some operations (the twofold rotations and mirrors), because the SU(2) matrix of the stored inverse is ±u(g)^{-1}.
WannierIO.LittleGroupRep Type
A representation matrix
(the column index is the original state), an n_bands × n_bands matrix. Identical in the raw and standard layers.
A vector of them is sparse: only the elements of the little group of each IBZ kpoint are present, so each entry carries its kpoint ik_ibz and operation ig.
WannierIO.OrbitalRep Type
A representation matrix
(the column index is the original orbital), an n_wann × n_wann matrix.
An OrbitalRep carries no operation index: a vector of them is dense and in the order of the symmetry operations, so orbital_reps[ig] belongs to symops[ig]. Pass the pair (zip(symops, orbital_reps)) where a single representation must know its operation.
Warning
In the raw layer (RawIsym), entry ig stores Isym(::RawIsym), entry ig stores u field of the operation (that of the little-group matrices). An antiunitary operation acts as
WannierIO.RawIsym Type
Raw container for prefix.isym data, mirroring the file exactly.
struct RawIsymFields
header: Header linen_symops: Number of symmetry operationsspinors: Whether spinors are consideredsymops: Symmetry operations in QE conventionn_kpts_ibz: Number of IBZ kpointskpoints_ibz: IBZ kpoints in fractional coordinatesn_bands: Number of bandsrepmat_band: Representation matricesd(ĥ, k)for the little groups of all IBZ kpoints (file sectionRepresentation matrix of G_k)n_wann: Number of Wannier functionsrepmat_wann: Representation matrices for the Wannier functions, storingD(inv(g))at indexig, the operation index the file gives for each entry (file sectionRotation matrix of Wannier functions)
WannierIO.RawSymOp Type
A symmetry operation as stored in the isym file, in QE's convention. Field names follow the pw2wannier90 source variables.
Conventions (fractional coordinates):
kpoints:
k' = s * k(witht_rev:k' = -s * k)real space:
g r = inv(s') * (r + ft)
WannierIO.SymOp Type
A symmetry operation in the standard (ITA) Seitz convention, all in fractional coordinates:
real space:
g r = W * r + vkpoints:
k' = Wk * kwhereWk = transpose(inv(W))(withtime_reversal:k' = -Wk * k)
WannierIO.SymOp Method
SymOp(op)Convert a RawSymOp (QE convention) to a SymOp (standard Seitz convention).
The conversion is
W = transpose(inv(s)) # real-space rotation, g r = W r + v
v = W * ft # translation
Wk = s # k-space rotation, k' = Wk kWannierIO.Mmn Type
Container for wannier90 mmn data.
struct Mmn{T<:Real, IT<:Integer}Fields
header: Header line (1st line of the file)M: Overlap matrices with sizen_bands × n_bands × n_bvecs × n_kpts.kpb_k: Neighbor kpoint indices with sizen_bvecs × n_kpts.kpb_G: Translation vectors for neighboring kpoints with sizen_bvecs × n_kpts. The translation vectorGis defined asb = kpoints[kpb_k[ib, ik]] + kpb_G[ib, ik] - kpoints[ik], wherebis theib-th bvector of theik-th kpoint.
WannierIO._check_dimensions_kpb Method
Check the dimensions between the quantities are consistent.
sourceWannierIO.HydrogenOrbital Type
Hydrogen-like analytic orbitals.
Follows the definition in Wannier90, see https://wannier90.readthedocs.io/en/latest/user_guide/wannier90/postproc/#projections-block https://wannier90.readthedocs.io/en/latest/user_guide/wannier90/projections/
struct HydrogenOrbital <: WannierIO.OrbitalFields
center: 3 real numbers of the projection center, in fractional coordinatesn: positive integer, principle quantum number for the radial functionl: non-negative integer, angular momentum of real spherical harmonicsm: integer, magnetic quantum number, α: positive real number, controlling the spread of the radial functionzaxis: 3 real numbers, the z-axis from which the polar angleis measured, default is [0, 0, 1]xaxis: 3 real numbers, the x-axis from which the azimuthal angleis measured, must be orthogonal to zaxis, default is[1, 0, 0]
WannierIO._nnkp_block_isend Method
Check if a line marks the end of a named block in an nnkp file.
sourceWannierIO._nnkp_block_nextline Method
Read one line from an nnkp block and strip surrounding whitespace.
sourceWannierIO._nnkp_check_line Method
Check whether an nnkp line starts a block and return (isblock, block_name).
WannierIO._nnkp_parse_block! Method
Dispatch to nnkp block parsers and store parsed values in params.
WannierIO._nnkp_parse_block_auto_projections Method
Parse auto_projections block and return the number of Wannier functions.
WannierIO._nnkp_parse_block_exclude_bands Method
Parse exclude_bands block and return the excluded band indices.
WannierIO._nnkp_parse_block_kpoints Method
Parse kpoints block and return a vector of k-points.
WannierIO._nnkp_parse_block_projections Method
Parse projections block and return a vector of HydrogenOrbital.
WannierIO._nnkp_parse_block_real_lattice Method
Parse real_lattice block and return a 3x3 lattice matrix.
WannierIO._nnkp_parse_block_recip_lattice Method
Parse recip_lattice block and return a 3x3 reciprocal lattice matrix.
WannierIO._nnkp_parse_block_spinor_projections Method
Parse spinor_projections block and return a vector of SpinorHydrogenOrbital.
WannierIO._nnkp_reals Method
Format the reals xs as the shortest decimals that read back as the same Float64, each right-aligned in a column wide enough for a fractional coordinate printed to full precision.
WannierIO._nnkp_skip_block Method
Skip unknown nnkp blocks by consuming lines up to the matching end <block>.
WannierIO._nnkp_toml_orbital Method
Construct an Orbital of type T from a TOML-parsed dict of its fields.
WannierIO._W90_ORBITAL_STATES Constant
The (l, mr) states of each named orbital of the w90 projection syntax.
WannierIO._orthonormal_axes Method
Normalize the zaxis and xaxis of the orbital (l, mr) and make them orthogonal, as w90 does: a nonorthogonal xaxis is projected onto the plane normal to zaxis if they are within 1e-2 of orthogonal, and replaced for the axially symmetric pz, dz2, fz3 (where w90 draws a random one, here the first of x̂, ŷ orthogonalized against zaxis).
WannierIO._parse_projection_coord Method
Parse a comma-separated triplet x,y,z, as w90 utility_string_to_coord.
WannierIO._parse_projection_line! Method
Append the orbitals of one projection line to projections.
WannierIO._projection_sites Method
Fractional centers of the site part (before the first :) of a projection line.
WannierIO._projection_states Method
The set of (l, mr) states of the angular part of a projection line.
WannierIO._strip_trailing_group Method
Remove a trailing […] (open = '[') or (…) (open = '(') group from s. Returns (rest, content), content === nothing if there is no group.
WannierIO.RDat Type
Container for prefix_r.dat data.
struct RDat{T<:Real, IT<:Integer}Fields
header: Header lineRvectors:-vectors on which operators are defined rx: x-component of position operator, sizen_wann × n_wann × n_Rvecsry: y-component of position operator, sizen_wann × n_wann × n_Rvecsrz: z-component of position operator, sizen_wann × n_wann × n_Rvecs
WannierIO.Spn Type
Container for wannier90 spn data.
struct Spn{T<:Real}Fields
header: Header lineSx: Spin x matrices. A length-n_kptsvector, each element is an_bands-by-n_bandsmatrix.Sy: Spin y matrices. A length-n_kptsvector, each element is an_bands-by-n_bandsmatrix.Sz: Spin z matrices. A length-n_kptsvector, each element is an_bands-by-n_bandsmatrix.
WannierIO.TbDat Type
Container for prefix_tb.dat data.
struct TbDat{T<:Real, IT<:Integer}Fields
header: Header linelattice: Lattice matrix, columns are lattice vectors in ÅRvectors:-vectors on which operators are defined Rdegens: Degeneracies of each-vector H: Hamiltonian matriceswith size n_wann × n_wann × n_Rvecsrx: x-component of position operatorry: y-component of position operatorrz: z-component of position operator
CrystalBase.Crystal Method
Crystal(win::AbstractDict)Build a CrystalBase.Crystal from the unit_cell_cart and atoms_frac blocks of a parsed win file, see read_win.
Example
win = read_win("si2.win")
crystal = Crystal(win)WannierIO._win_block_isend Method
Check if a line marks the end of a named block in a win file.
sourceWannierIO._win_block_mustend Method
Assert that a line marks the end of a named block, or raise an error.
sourceWannierIO._win_block_nextline Method
Read the next non-empty line from a win file block, with optional case control.
Win files are case-insensitive, but some blocks (e.g., atoms_frac) preserve atomic labels. This function supports both via the :lower kwarg.
WannierIO._win_check_line Method
Check if a line starts a block (begins with 'begin ') or contains a key-value pair.
Returns (isblock, content) where content is the block name or key-value line.
WannierIO._win_convert_keyval_type Method
Convert a string value to the appropriate type based on value_type symbol.
sourceWannierIO._win_convert_keyval_types! Method
Convert all key-value parameter strings to their appropriate types, in-place.
sourceWannierIO._win_format_keyval Method
Format a key-value pair for output, handling special types like int3 and indices.
sourceWannierIO._win_keyval_types Method
Return a dictionary mapping parameter names to their value types for parsing.
Used to determine how to parse key-value pairs from win files.
sourceWannierIO._win_parse_block Method
Dispatch to the appropriate block parser based on the block name.
sourceWannierIO._win_parse_block_atoms Method
Parse a atoms_frac or atoms_cart block from a win file.
Returns a vector of (atom_label => fractional/Cartesian coordinates) pairs.
sourceWannierIO._win_parse_block_explicit_kpath Method
Parse a explicit_kpath block from a win file.
Returns a vector of k-point coordinates along the path.
sourceWannierIO._win_parse_block_explicit_kpath_labels Method
Parse a explicit_kpath_labels block from a win file.
Returns a vector of (label => k-point) pairs for high-symmetry points.
sourceWannierIO._win_parse_block_kpoint_path Method
Parse a kpoint_path block from a win file.
Returns a vector of segments, each containing (start_label => start_kpt, end_label => end_kpt) pairs.
sourceWannierIO._win_parse_block_kpoints Method
Parse a kpoints block from a win file.
Returns a vector of k-point coordinates.
sourceWannierIO._win_parse_block_string Method
Parse a generic block as a vector of strings (for unknown block types).
sourceWannierIO._win_parse_block_unit_cell_cart Method
Parse a unit_cell_cart block from a win file.
Returns lattice vectors as a 3×3 matrix (columns are lattice vectors in angstrom).
sourceWannierIO._win_parse_keyval Method
Parse a key-value line, separating key and value by = or : delimiters.
sourceWannierIO._win_write_block_explicit_kpath_labels Method
Write a explicit_kpath_labels block to the output.
WannierIO._win_write_comment Method
Write a comment line to the output, prefixing with # if needed.
sourceWannierIO.standardize_win! Method
standardize_win!(params)Sanity check and add missing input parameters from a win file.
See also read_win.
WannierIO._wout_parse_atoms Method
Parse block
| Site Fractional Coordinate Cartesian Coordinate (Ang) |
+----------------------------------------------------------------------------+
| Si 1 0.00000 0.00000 0.00000 | 0.00000 0.00000 0.00000 |
| Si 2 0.25000 0.25000 0.25000 | 1.35763 1.35763 1.35763 |
*----------------------------------------------------------------------------*WannierIO._wout_parse_disentangle Method
Parse block
Extraction of optimally-connected subspace
------------------------------------------
+---------------------------------------------------------------------+<-- DIS
| Iter Omega_I(i-1) Omega_I(i) Delta (frac.) Time |<-- DIS
+---------------------------------------------------------------------+<-- DIS
1 25.38943399 21.32896063 1.904E-01 0.00 <-- DIS
2 21.53095611 20.16097533 6.795E-02 0.01 <-- DIS
3 20.40788223 19.35260423 5.453E-02 0.01 <-- DIS
4 19.53883989 18.75563591 4.176E-02 0.02 <-- DIS
...
341 16.22884440 16.22884440 -1.883E-10 2.43 <-- DIS
342 16.22884440 16.22884440 -1.799E-10 2.44 <-- DIS
<<< Delta < 2.000E-10 over 3 iterations >>>
<<< Disentanglement convergence criteria satisfied >>>
Final Omega_I 16.22884440 (Ang^2)
+----------------------------------------------------------------------------+
Time to disentangle bands 2.546 (sec)WannierIO._wout_parse_final_state Method
See _wout_parse_wf_center_spread for the format of the block to be parsed.
WannierIO._wout_parse_im_re_ratio Method
Parse block
Wannier Function Num: 1 Maximum Im/Re Ratio = 4.566451
Wannier Function Num: 2 Maximum Im/Re Ratio = 4.566481
Wannier Function Num: 3 Maximum Im/Re Ratio = 4.566335
Wannier Function Num: 4 Maximum Im/Re Ratio = 2.154381WannierIO._wout_parse_lattice Method
Parse block
Lattice Vectors (Ang)
a_1 0.000000 2.715265 2.715265
a_2 2.715265 0.000000 2.715265
a_3 2.715265 2.715265 0.000000WannierIO._wout_parse_phase_factor Method
Parse block
Wannier Function Num: 1 Phase Factor = 0.996157 +0.087588i
Wannier Function Num: 2 Phase Factor = 0.996157 +0.087588i
Wannier Function Num: 3 Phase Factor = 0.996157 +0.087588i
Wannier Function Num: 4 Phase Factor = 0.998869 +0.047543iWannierIO._wout_parse_recip_lattice Method
Parse block
Reciprocal-Space Vectors (Ang^-1)
b_1 -1.157011 1.157011 1.157011
b_2 1.157011 -1.157011 1.157011
b_3 1.157011 1.157011 -1.157011WannierIO._wout_parse_repeated_equals Method
Parse blocks like
Wannier Function Num: 1 Phase Factor = 0.996157 +0.087588i
Wannier Function Num: 2 Phase Factor = 0.996157 +0.087588i
Wannier Function Num: 3 Phase Factor = 0.996157 +0.087588i
Wannier Function Num: 4 Phase Factor = 0.998869 +0.047543ior
Wannier Function Num: 1 Maximum Im/Re Ratio = 4.566451
Wannier Function Num: 2 Maximum Im/Re Ratio = 4.566481
Wannier Function Num: 3 Maximum Im/Re Ratio = 4.566335
Wannier Function Num: 4 Maximum Im/Re Ratio = 2.154381The line contains the 1st, the remaining lines will be read from io. The last line should be an empty line.
WannierIO._wout_parse_wannierize Method
Parse block
*------------------------------- WANNIERISE ---------------------------------*
+--------------------------------------------------------------------+<-- CONV
| Iter Delta Spread RMS Gradient Spread (Ang^2) Time |<-- CONV
+--------------------------------------------------------------------+<-- CONV
------------------------------------------------------------------------------
Initial State
WF centre and spread 1 ( -0.000005, 0.000021, 0.000023 ) 2.56218734
WF centre and spread 2 ( 0.000013, -0.000054, 0.000016 ) 3.19493515
WF centre and spread 3 ( -0.000005, -0.000054, -0.000055 ) 3.19482997
WF centre and spread 4 ( 0.000012, 0.000015, -0.000058 ) 3.19526437
WF centre and spread 5 ( 1.357637, 1.357611, 1.357610 ) 2.56218214
WF centre and spread 6 ( 1.357619, 1.357684, 1.357617 ) 3.19532825
WF centre and spread 7 ( 1.357638, 1.357687, 1.357686 ) 3.19513205
WF centre and spread 8 ( 1.357620, 1.357617, 1.357694 ) 3.19460833
Sum of centres and spreads ( 5.430528, 5.430529, 5.430534 ) 24.29446759
0 0.243E+02 0.0000000000 24.2944680346 2.48 <-- CONV
O_D= 0.2135529 O_OD= 7.8520707 O_TOT= 24.2944680 <-- SPRD
------------------------------------------------------------------------------
Cycle: 1
WF centre and spread 1 ( -0.000005, 0.000020, 0.000022 ) 2.46316318
WF centre and spread 2 ( 0.000014, -0.000057, 0.000015 ) 3.19187236
WF centre and spread 3 ( -0.000005, -0.000057, -0.000058 ) 3.19179103
WF centre and spread 4 ( 0.000012, 0.000014, -0.000061 ) 3.19222621
WF centre and spread 5 ( 1.357637, 1.357612, 1.357611 ) 2.46315800
WF centre and spread 6 ( 1.357618, 1.357687, 1.357618 ) 3.19226713
WF centre and spread 7 ( 1.357637, 1.357690, 1.357689 ) 3.19209166
WF centre and spread 8 ( 1.357619, 1.357619, 1.357697 ) 3.19156919
Sum of centres and spreads ( 5.430528, 5.430529, 5.430534 ) 24.07813875
1 -0.216E+00 0.2558717278 24.0781391952 2.49 <-- CONV
O_D= 0.2218113 O_OD= 7.6274835 O_TOT= 24.0781392 <-- SPRD
Delta: O_D= 0.8258326E-02 O_OD= -0.2245872E+00 O_TOT= -0.2163288E+00 <-- DLTA
------------------------------------------------------------------------------
Cycle: 2
...
------------------------------------------------------------------------------
Cycle: 45
WF centre and spread 1 ( 0.000001, 0.000006, 0.000006 ) 1.95373328
WF centre and spread 2 ( 0.000016, -0.000065, 0.000019 ) 3.27910139
WF centre and spread 3 ( -0.000008, -0.000065, -0.000066 ) 3.27921479
WF centre and spread 4 ( 0.000014, 0.000016, -0.000070 ) 3.27965818
WF centre and spread 5 ( 1.357631, 1.357627, 1.357627 ) 1.95372427
WF centre and spread 6 ( 1.357616, 1.357695, 1.357615 ) 3.27949625
WF centre and spread 7 ( 1.357641, 1.357699, 1.357697 ) 3.27951005
WF centre and spread 8 ( 1.357617, 1.357616, 1.357707 ) 3.27899768
Sum of centres and spreads ( 5.430528, 5.430529, 5.430534 ) 23.58343588
45 -0.186E-09 0.0000077396 23.5834363262 2.88 <-- CONV
O_D= 0.2612087 O_OD= 7.0933833 O_TOT= 23.5834363 <-- SPRD
Delta: O_D= 0.2557594E-06 O_OD= -0.2559458E-06 O_TOT= -0.1863789E-09 <-- DLTA
------------------------------------------------------------------------------
<<< Delta < 2.000E-10 over 3 iterations >>>
<<< Wannierisation convergence criteria satisfied >>>WannierIO._wout_parse_wf_center_spread Method
Parse block
WF centre and spread 1 ( -0.000005, 0.000021, 0.000023 ) 2.56218734
WF centre and spread 2 ( 0.000013, -0.000054, 0.000016 ) 3.19493515
WF centre and spread 3 ( -0.000005, -0.000054, -0.000055 ) 3.19482997
WF centre and spread 4 ( 0.000012, 0.000015, -0.000058 ) 3.19526437
WF centre and spread 5 ( 1.357637, 1.357611, 1.357610 ) 2.56218214
WF centre and spread 6 ( 1.357619, 1.357684, 1.357617 ) 3.19532825
WF centre and spread 7 ( 1.357638, 1.357687, 1.357686 ) 3.19513205
WF centre and spread 8 ( 1.357620, 1.357617, 1.357694 ) 3.19460833
Sum of centres and spreads ( 5.430528, 5.430529, 5.430534 ) 24.29446759WannierIO._wout_parse_Ω Method
line is the 1st, remaining lines will be read from io.
Spreads (Ang^2) Omega I = 3.956862958
================ Omega D = 0.008030049
Omega OD = 0.501987969
Final Spread (Ang^2) Omega Total = 4.466880976WannierIO.WsvecDat Type
Container for prefix_wsvec.dat data.
struct WsvecDat{IT<:Integer}Fields
header: Header linemdrs: Whether MDRS interpolation is enabled. i.e. theuse_ws_distancein the header.Rvectors: Thevectors Tvectors: MDRSvectors of size n_wann × n_wann × n_Rvecs, ornothingwhenmdrs == falseTdegens: Degeneracies of MDRSvectors of size n_wann × n_wann × n_Rvecs, ornothingwhenmdrs == falsen_wann: Number of Wannier functions
WannierIO.WsvecDat Method
For MDRS Rvectors, the n_wann is optional and can be automatically determined from the Tvectors.
WannierIO.WsvecDat Method
For Wigner-Seitz Rvectors, needs to provide a n_wann for number of Wannier functions.
Page index
WannierIO._W90_ORBITAL_STATESWannierIO.ChkWannierIO.ChkWannierIO.HHRDatWannierIO.HrDatWannierIO.HydrogenOrbitalWannierIO.IsymWannierIO.IsymWannierIO.LittleGroupRepWannierIO.MmnWannierIO.NnkpWannierIO.NnkpWannierIO.OrbitalRepWannierIO.RDatWannierIO.RawIsymWannierIO.RawSymOpWannierIO.SpnWannierIO.SymOpWannierIO.SymOpWannierIO.TbDatWannierIO.WsvecDatWannierIO.WsvecDatWannierIO.WsvecDatWannierIO._check_dimensions_M_kpbWannierIO._check_dimensions_kpbWannierIO._check_eig_orderWannierIO._n_mrWannierIO._nnkp_block_isendWannierIO._nnkp_block_mustendWannierIO._nnkp_block_nextlineWannierIO._nnkp_check_lineWannierIO._nnkp_check_required_blocksWannierIO._nnkp_from_paramsWannierIO._nnkp_parse_block!WannierIO._nnkp_parse_block_auto_projectionsWannierIO._nnkp_parse_block_exclude_bandsWannierIO._nnkp_parse_block_kpointsWannierIO._nnkp_parse_block_nnkptsWannierIO._nnkp_parse_block_projectionsWannierIO._nnkp_parse_block_real_latticeWannierIO._nnkp_parse_block_recip_latticeWannierIO._nnkp_parse_block_spinor_projectionsWannierIO._nnkp_read_arrayWannierIO._nnkp_realsWannierIO._nnkp_skip_blockWannierIO._nnkp_toml_orbitalWannierIO._nnkp_write_block_auto_projectionsWannierIO._nnkp_write_block_exclude_bandsWannierIO._nnkp_write_block_kpointsWannierIO._nnkp_write_block_nnkptsWannierIO._nnkp_write_block_projectionsWannierIO._nnkp_write_block_real_latticeWannierIO._nnkp_write_block_recip_latticeWannierIO._nnkp_write_block_spinor_projectionsWannierIO._nnkp_write_headerWannierIO._orthonormal_axesWannierIO._parse_projection_coordWannierIO._parse_projection_line!WannierIO._projection_sitesWannierIO._projection_statesWannierIO._reshape_eigWannierIO._strip_trailing_groupWannierIO._win_block_isendWannierIO._win_block_mustendWannierIO._win_block_nextlineWannierIO._win_check_lineWannierIO._win_check_required_paramsWannierIO._win_convert_keyval_typeWannierIO._win_convert_keyval_types!WannierIO._win_format_keyvalWannierIO._win_keyval_typesWannierIO._win_parse_blockWannierIO._win_parse_block_atomsWannierIO._win_parse_block_explicit_kpathWannierIO._win_parse_block_explicit_kpath_labelsWannierIO._win_parse_block_kpoint_pathWannierIO._win_parse_block_kpointsWannierIO._win_parse_block_stringWannierIO._win_parse_block_unit_cell_cartWannierIO._win_parse_keyvalWannierIO._win_write_block_atoms_cartWannierIO._win_write_block_atoms_fracWannierIO._win_write_block_explicit_kpathWannierIO._win_write_block_explicit_kpath_labelsWannierIO._win_write_block_kpoint_pathWannierIO._win_write_block_kpointsWannierIO._win_write_block_projectionsWannierIO._win_write_block_unit_cell_cartWannierIO._win_write_commentWannierIO._win_write_keyvalsWannierIO._wout_parse_atomsWannierIO._wout_parse_disentangleWannierIO._wout_parse_final_stateWannierIO._wout_parse_im_re_ratioWannierIO._wout_parse_kgridWannierIO._wout_parse_latticeWannierIO._wout_parse_phase_factorWannierIO._wout_parse_recip_latticeWannierIO._wout_parse_repeated_equalsWannierIO._wout_parse_wannierizeWannierIO._wout_parse_wf_center_spreadWannierIO._wout_parse_ΩWannierIO.default_band_kpt_kweightsWannierIO.format_projectionsWannierIO.gauge_matricesWannierIO.gauge_matrices_disWannierIO.parse_projectionsWannierIO.read_amnWannierIO.read_chkWannierIO.read_eigWannierIO.read_isymWannierIO.read_isym_rawWannierIO.read_mmnWannierIO.read_nnkpWannierIO.read_spnWannierIO.read_uHuWannierIO.read_uIuWannierIO.read_u_matWannierIO.read_unkWannierIO.read_w90_bandWannierIO.read_w90_bandWannierIO.read_w90_band_datWannierIO.read_w90_band_kptWannierIO.read_w90_band_kpt_labelinfoWannierIO.read_w90_band_labelinfo_datWannierIO.read_w90_hr_datWannierIO.read_w90_r_datWannierIO.read_w90_tb_datWannierIO.read_w90_wsvec_datWannierIO.read_winWannierIO.read_woutWannierIO.standardize_win!WannierIO.write_HH_R_datWannierIO.write_amnWannierIO.write_chkWannierIO.write_eigWannierIO.write_mmnWannierIO.write_nnkpWannierIO.write_spnWannierIO.write_uHuWannierIO.write_uIuWannierIO.write_u_matWannierIO.write_unkWannierIO.write_w90_bandWannierIO.write_w90_bandWannierIO.write_w90_band_datWannierIO.write_w90_band_kptWannierIO.write_w90_band_kpt_labelinfoWannierIO.write_w90_band_labelinfo_datWannierIO.write_w90_hr_datWannierIO.write_w90_r_datWannierIO.write_w90_tb_datWannierIO.write_w90_wsvec_datWannierIO.write_win