Abstract
Wannier interpolation is a powerful tool for performing Brillouin zone integrals over dense grids of k points, which are essential to evaluate such quantities as the intrinsic anomalous Hall conductivity or Boltzmann transport coefficients. However, more complex physical problems and materials create harder numerical challenges, and computations with the existing codes become very expensive, which often prevents reaching the desired accuracy. In this article, I present a series of methods that boost the speed of Wannier interpolation by several orders of magnitude. They include a combination of fast and slow Fourier transforms, explicit use of symmetries, and recursive adaptive grid refinement among others. The proposed methodology has been implemented in the python code WannierBerri, which also aims to serve as a convenient platform for the future development of interpolation schemes for other phenomena.
Introduction
Wannier functions^{1,2} (WFs) are a powerful tool for evaluating various electronic properties of solids, ranging from electric polarization^{3,4,5} and orbital magnetization^{6,7,8} to topological properties^{9,10,11,12,13}. Moreover, WFs provide a way to describe a group of energy bands in a crystal by a compact Hamiltonian, thus allowing a fast evaluation of the band structure at any point of the Brillouin zone (BZ) without an extra call to the ab initio code^{14}. This procedure called Wannier interpolation is similar in spirit to the tightbinding method^{15}, but with the significant advantage that it offers a systematic way of precise description of any number of bands without truncation of the hopping integrals. Moreover, not only the band energies but also the matrix elements of various observables and operators, which are expressed in terms of wavefunctions and their derivatives over momentum space are precisely interpolated, while the tightbinding approach contains an unavoidable error due to the limited basis set. Wannier interpolation is particularly useful in the search for Weyl points in the band structure^{11,16}, and in the evaluation of momentumspace integrals of rapidly varying functions. Such integrals appear, for example, in calculations of the anomalous Hall conductivity^{17}, orbital magnetization^{18}, Boltzmann transport coefficients^{19}, and optical properties^{20,21}. By now, Wannier interpolation schemes have been developed for many other properties that demand dense BZ samplings, such as electronphonon coupling^{22,23}, gyrotropic effects^{24}, and spin Hall conductivity^{25,26}.
Due to their gauge dependence, WFs are strongly nonunique and may be constructed in multiple ways. The most popular technique is the maximal localization procedure^{2,27}, implemented in the wellestablished code Wannier90^{28,29}, whose development is now driven by a broad community^{30}. The construction of a good set of WFs requires some careful input from the user. This includes specifying a set of trial orbitals, which serve as an initial guess for the target WFs, and, if the bands of interest do not form an isolated group, choosing the “disentanglement” energy windows^{14}. Recently, there has been significant progress in the automated construction of WFs with minimal user intervention. Different techniques have been proposed, such as the optimized projection functions method^{31}, the selected columns of the density matrix method^{32,33,34}, and an automated method to choose trial orbitals and energy windows^{35,36}. In addition, a database of Wannier Hamiltonians is currently being constructed^{37}. These advances constitute significant steps towards employing Wannier interpolation for highthroughput automated calculations of electronic properties of solids.
Most of the Wannier interpolation schemes mentioned above have been implemented within the popular codes—Wannier90 (namely its postprocessing module postw90.x) and WannierTools^{11}. These codes, being wellestablished and widely adopted by the community, have quite broad functionalities. However, more complex materials and physical effects pose harder numerical challenges, and calculation with those codes can become quite heavy. In particular, for a system with a large number of WFs and a complicated Fermi surface, it may be hard to achieve convergence with respect to momentumspace grid in a reasonable time. When it comes to highthroughput calculations, performance becomes even more important.
In this article, I present a series of methodological improvements that allow to improve dramatically the performance of the Wannier interpolation method, without compromising its accuracy. The proposed methodology is implemented in the python code WannierBerri (WB), which is freely available to install and open for contributors (see “Code availability”). The present article covers only the core methodology of the code which procure its efficiency. The more broad scope of the code can be found on its web page and will be detailed in future publications. Interesting to note that WannierBerri may be equally used for Wannier interpolation and tightbinding calculations, and also offers a convenient platform for the development of more functionality. The name of the code is derived from Wannier functions and the Basque word “berri” which means “new” and enters local toponyms (e.g., Lekunberri, Ekainberri).
The high efficiency of the WB code is achieved by the combination of several methodological improvements. First, note that in a typical calculation for a 3D bulk material using postw90.x, the bottleneck is the Fourier transform, which is implemented as a standard discrete Fourier transform. Therefore, it looks appealing to use fast Fourier transforms (FFTs)^{38,39} which are widely used in numerical calculations^{40,41}. However, it is problematic to do so over a very dense grid of points, which may include up to 10^{8} points. This issue is overcome in this work by a mixed scheme employing both fast and “slow” Fourier transforms. Next, the symmetries of the system may be used to reduce the evaluation only to the irreducible points and obtain the contributions from other points by applying symmetry operations. This also helps to render the result more symmetric (tensor components that should be equal or vanish will be exactly equal, or exactly vanish), even if the symmetries are slightly broken due to numerical inaccuracies in wannierization. Then I introduce an adaptive refinement algorithm that identifies points that give the largest contribution to the integral and makes the grid denser in the vicinity of such points. This helps to have a more accurate description near special points, where the integrand is rapidly changing—for example, near Weyl nodes or nodal lines. This is similar in spirit to the adaptive refinement scheme used in^{17,42}, but is more automatic and requires less input from the user. Finally, I introduce methods that drastically reduce the computational cost of the minimaldistance replica selection method (MDRS)^{30}, as well as the cost of scanning over multiple Fermi levels.
The article is organized as follows. First, I describe the set of proposed improvements to the existing Wannier interpolation methodology. Next, the usage of the code is demonstrated for the “textbook” example of the anomalous Hall conductivity of bcc iron, and the performance of the WB code is benchmarked against postw90 on the basis of that example. Finally, a broader functionality implemented in the WB code is described. “Methods” describes more computational details, and the routines to obtain the matrix elements that are not implemented in the interfaces of most ab initio codes to Wannier90, but essential to calculate the properties related to spin and orbital moment of Bloch electrons.
Results
General equations for Wannier interpolation
We start with a brief overview of the Wannier interpolation method, mainly with a goal to introduce notation necessary for further discussion. For more details, please refer to review ref. ^{2} and original articles cited therein. The problem of Wannier interpolation is stated in the following way. First, we evaluate the energies E_{nq} and wavefunctions ψ_{nq}(r) ≡ e^{iq⋅r}u_{nq}(r) from first principles on a rather coarse grid of \({N}_{{\bf{q}}}={N}_{{\bf{q}}}^{1}\times {N}_{{\bf{q}}}^{2}\times {N}_{{\bf{q}}}^{3}\) wavevectors q within the reciprocal unit cell. Next, we want to find the energies and wavefunctions at points on a denser grid of wavevectors k. Further, we will consistently use q and k to denote the ab initio and interpolation grids, respectively.
For a group of entangled bands, one can define a set of J WFs defined as
where \({{\mathcal{J}}}_{{\bf{q}}}\ge J\) and R are realspace lattice vectors. The matrices \({V}_{mn^{\prime} }({\bf{q}})\) contain all the information on the construction of WFs and may be generated by the Wannier90 code. They are constrained by \(\mathop{\sum }\nolimits_{m = 1}^{{{\mathcal{J}}}_{{\bf{q}}}}{V}_{mn}^{* }({\bf{q}}){V}_{mn^{\prime} }({\bf{q}})={\delta }_{nn^{\prime} }\) and are chosen in such a way that the WFs are localized, which yields that the Bloch wavefunctions in the Wannier gauge
vary slowly with the k vector, unlike the true wavefunctions. Now let us see how WFs may be used to interpolate the band energies. First, one evaluates the matrix elements of the Hamiltonian
Next, to obtain energies at an arbitrary point k one needs to construct the Wannier Hamiltonian
which further may be diagonalized as
where \({U}_{nl^{\prime} }({\bf{k}})\) are unitary matrices with columns corresponding to the eigenvectors of the Hamiltonian (4). In a similar way, for any operator \(\hat{X}\), for which the matrix elements are evaluated on the ab initio grid, one may obtain the realspace matrix elements
where in a simple case (e.g., \(\hat{X}={\boldsymbol{\sigma }}\))
or if \(\hat{X}\) involves momentumspace derivatives, (e.g., the position operator \({\hat{r}}_{\alpha }\equiv i\partial /\partial {k}_{\alpha }\)) may also involve matrix elements between neighboring q points (see refs. ^{17,18} for details). Then the matrix elements may be interpolated to any k point in the Wannier gauge by
and further rotated to the Hamiltonian gauge
Note that Eqs. (3), (4), and (5) are particular cases of (6), (8), and (9). Equation (6) can be performed by means of FFT, and its result is periodic in R with a supercell formed by vectors \({{\bf{A}}}_{i}={{\bf{a}}}_{i}{N}_{{\bf{q}}}^{i}\), where a_{i} (i = 1, 2, 3) are the primitive unit cell vectors. Among the equivalent R vectors, we choose those belonging to the corresponding Wigner–Seitz (WS) supercell. If an R vector belongs to the WS supercell boundary, we include all equivalent vectors on the boundary with the corresponding elements X(R) divided by the degeneracy of the R vector. Further, the MDRS method (see “Minimaldistance replica selection method (MDRS)”) may also slightly modify the set of R vectors.
As an example, the total Berry curvature of the occupied manifold is interpolated^{17} via
where the ingredients of the equation are obtained using Eqs. (8), (9) starting from \({D}_{nl,\alpha }\equiv \frac{{\overline{H}}_{nl,\alpha }^{{\rm{H}}}}{{E}_{l}{E}_{n}}\), \({H}_{\alpha }^{{\rm{W}}}\equiv {\partial }_{\alpha }{H}^{{\rm{W}}}\), \({A}_{mn,\alpha }({\bf{R}})\equiv \langle {\boldsymbol{0}}m {\hat{r}}_{\alpha } {\bf{R}}n\rangle\), \({\overline{{{\Omega }}}}_{\gamma }^{{\rm{W}}}\equiv {\epsilon }_{\alpha \beta \gamma }{\partial }_{\alpha }{A}_{\beta }^{{\rm{W}}}\), ∂_{α} ≡ ∂/∂k_{α}. The anomalous Hall conductivity is evaluated as an integral
Note, that while the direct Fourier transform (6) is performed only once for the calculation, and is not repeated for the multiple k points upon interpolation, the inverse Fourier transform (8) is repeated for every interpolation k point. In fact, it presents the most timeconsuming part of the calculation of AHE in relatively small 3D bulk systems as implemented in the Wannier90 code.
Mixed Fourier transform
In this section, we will see how the evaluation of Eq. (8) may be accelerated. It is easy to see that the computation time of a straightforward discrete Fourier transform scales with the number of R vectors and k points as t ∝ N_{R}N_{k}, and we are typically interested in a case N_{k} ≫ N_{R} (N_{R} ≈ N_{q}).
When the Fourier transform is done on a regular grid of k points, it is usually appealing to use the FFT. For that one needs to place the R vectors on a regular grid of size N_{k}, fill the missing spots with zeros and perform the standard FFT, for which the time will scale as \(t\propto {N}_{{\bf{k}}}\mathrm{log}\,{N}_{{\bf{k}}}\). However, there are some difficulties with such FFT. Mainly, because to perform FFT on a large grid implies storing the data for all k points in memory at the same time, which becomes a severe computational limitation. Also, FFT does not allow to reduce computation to only the symmetryirreducible k points and is more difficult to do in parallel. However, there is a way to combine the advantages of both the FFT and the usual discrete Fourier transform, leading to the concept of mixed Fourier transform.
We want to evaluate Eq. (8) for a set of k points.
where \(0\le {n}_{i}\, <\,{N}_{{\bf{k}}}^{i}\) – integers (i = 1, 2, 3), \({N}_{{\bf{k}}}^{i}\)—size of interpolation grid, b_{i}—reciprocal lattice vectors. Now suppose we can factorize \({N}_{{\bf{k}}}^{i}={N}_{{\rm{FFT}}}^{i}{N}_{{\bf{K}}}^{i}\). This is always possible unless \({N}_{{\bf{k}}}^{i}\) is a prime number. But for really dense grids, we can adjust \({N}_{{\bf{k}}}^{i}\) a bit, to be factorizable in any way we want. Then the set of points Eq. (12) is equivalent to a set of points k = K + κ, where
where \(0\le {l}_{i}\,<\,{N}_{{\bf{K}}}^{i}\), \({N}_{{\bf{K}}}={\prod }_{i}{N}_{{\bf{K}}}^{i}\), \(0\le {m}_{i}<{N}_{{\mathrm{FFT}}}^{i}\). This separation is illustrated in Fig. 1a, which shows a 2 × 2 grid of K points, each corresponding to 4 × 4 FFT grid (dots of a certain color). Now for each K point, we can define
and then Eq. (8) reads as
The principle idea of mixed Fourier transform consists in performing the Fourier transform Eq. (15) as FFT, while Eq. (14) is performed directly. To perform the FFT, we put all the R vectors on a grid \({N}_{{\rm{FFT}}}^{1}\times {N}_{{\rm{FFT}}}^{2}\times {N}_{{\rm{FFT}}}^{3}\), and a vector \({\bf{R}}=\mathop{\sum }\nolimits_{i = 1}^{3}{n}_{i}{{\bf{a}}}_{i}\) is placed on a slot with coordinates \({\widetilde{n}}_{i}={n}_{i}\ {\rm{mod}}\ {N}_{{\rm{FFT}}}^{i}\) (n_{i} are both positive and negative integers, while \(0\le {\widetilde{n}}_{i}<{N}_{{\rm{FFT}}}^{i}\)). If the FFT grid is not big enough, contributions from different R vectors may appear on the same slot. In this case, they should be added up, and it does not affect the final results. However, for optimal performance, such a situation should be avoided at least for the majority of R vectors. Typically, it is a good choice to take the size of the FFT grid approximately equal to the ab initio grid.
The advantages of this approach are the following. First, the computational time scales as t_{1} ∝ N_{K}N_{R} for Eq. (14) and \({t}_{2}\propto {N}_{{\bf{K}}}{N}_{{\rm{FFT}}}\mathrm{log}\,{N}_{{\rm{FFT}}}\) for Eq. (15). Because it is required that N_{FFT} ≥ N_{R} (to fit all R vectors in the FFT box), we have \({t}_{1}\le {t}_{2}\propto {N}_{{\bf{k}}}\mathrm{log}\,{N}_{{\rm{FFT}}}\) (in practice it occurs that t_{1} ≪ t_{2}), which scales better than both the Fast and “slow” Fourier transforms. Next, we can perform Eqs. (14) and (15) independently for different K points. This saves us memory and also offers a simple parallelization scheme. Also, we can further restrict evaluation only to symmetryirreducible K points (see “Symmetries”) and also perform adaptive refinement over K points (see “Recursive adaptive refinement”).
Moreover, the evaluation time of a mixed Fourier transform only logarithmically depends on the size of the ab initio grid (recall that N_{FFT} ~ N_{R} ~ N_{q}), while for the slow Fourier transform, the dependence is linear. However, in practice, we will see (see “Computation time”) that the Fourier transform in the present implementation consumes only a small portion of computational time, and therefore the overall computational time is practically independent of the size of the ab initio grid.
Symmetries
When we integrate some quantity over the BZ, at every K point (after summing over κ points), we obtain the result as a rankm tensor \({X}_{{i}_{1},\ldots ,{i}_{m}}({\bf{K}})\), for example, the berry curvature vector Ω_{γ} or the conductivity tensor σ_{xy}. Then the BZ integral is expressed as a sum
and we initially set {K} as a regular grid (13a) and w_{K} = 1/N_{K}. Suppose G is the magnetic point group of the system. (Because X(K) is invariant under translations, here we are interested in the point group, rather than space group.) We define the set of symmetryirreducible K points irr as a set of points that \(\forall {\bf{K}},{\bf{K}}^{\prime} \in {\rm{irr}}\), ∀ g ∈ G holds \(g{\bf{K}}\,\ne \,{\bf{K}}^{\prime}\), unless g = E (identity). Then we can rewrite the sum Eq. (16) as
where we choose g_{K} such that \({g}_{{\bf{K}}}^{1}{\bf{K}}\in {\rm{irr}}\) (this choice maybe not unique), and obviously g_{K} = E for K ∈ irr. Thus, only the irreducible K points need to be evaluated. Next, to make sure that the result respects the symmetries, despite possible numerical inaccuracies, we symmetrize the result as:
Note, that \(\widetilde{{\mathcal{X}}}={\mathcal{X}}\) if the model respects the symmetry precisely (e.g., when symmetryadapted WFs^{43} are used). Combining Eqs. (17) and (18) and using \(\mathop{\sum }\nolimits_{f}^{G}f\cdot {g}_{{\bf{K}}}=\mathop{\sum }\nolimits_{f}^{G}f\), we get
where G ⋅ K denotes the orbit of K under the action of group G. The latter equation reflects the implementation in the WB code. Starting from a regular grid of K points, we search for pairs of symmetryequivalent points. Whenever such a pair is found, one of the points is excluded and it’s weight is transferred to the other point. Compare Fig. 1a, b: the red points are removed and their weight is moved to green points. Thus we end with a set of irreducible K point with weights \({\widetilde{w}}_{{\bf{K}}}=\mathop{\sum }\nolimits_{{\bf{K}}^{\prime} }^{G\cdot {\bf{K}}}{w}_{{\bf{K}}^{\prime} }\). Next, we evaluate X(K) (employing the corresponding interpolation scheme) only at symmetryirreducible K points. Note, that although some k points corresponding to the same K point (same color in Fig. 1) are equivalent, we have to evaluate them all to be able to use the FFT. Finally, after summation, we symmetrize the result. The described procedure achieves two goals: (i) reduce the computational costs, and (ii) make the result precisely symmetric, even if the WFs are not perfectly symmetric. In the present example, we managed to obtain highly symmetric WFs (although without the employment of symmetryadapted WFs method), and therefore the symmetrization procedure does not change the result (within relative accuracy ~10^{−5}). However, for complex materials, such quality of WFs is not always easy to achieve.
Recursive adaptive refinement
It is wellknown that in calculations of quantities involving Berry curvature (33) or orbital moment (34) of Bloch states (e.g., AHC, Berry curvature dipole (29)^{44} or gyrotropic magnetoelectric tensor (30)^{24,45}), one performs integration over kspace of a function that rapidly changes with k. As a result, small areas of kspace give a major contribution to the integral. Such areas often appear in the vicinity of Weyl points, nodal lines, as well as avoided crossings. To accelerate convergence with respect to the number of k points, we utilize adaptive mesh refinement similar to refs. ^{17,42}. The authors of refs. ^{17,42} assumed a predefined threshold, and the k points yielding Berry curvature above the threshold was refined. This is inconvenient because one needs a good intuition to guess an optimal value for this threshold because it depends both on the quantity one wants to calculate, and the material considered.
In WB, it is implemented in a way that does not require an initial guess from the user. This procedure, in combination with the symmetrization described above, is illustrated in Fig. 1 in two dimensions (2D), while the actual work in 3D is described below. After excluding symmetryequivalent K points (Fig. 1b), the results are evaluated for every K point and stored. We assume that initially each K point has weight \({\widetilde{w}}_{{\bf{K}}}\) and corresponds to a volume defined by vectors \({{\bf{c}}}_{{\bf{K}}}^{i}={{\bf{b}}}_{i}/{N}_{{\bf{k}}}^{i}\) centered at K. Then we pick a few “most important K points”. The criteria of importance may be different—either the Maximal value for any E_{F}, or maximal value summed over all E_{F}, or yielding most variation over the E_{F} (if the evaluated quantity is a function of Fermi level E_{F}). Suppose we selected the magenta point, then those points are refined–replaced with eight points around it with coordinates
where all combinations of ± signs are used. In Fig. 1c, four new blue K points in the 2D case. The weight and volume of the initial point is distributed over the new points, thus \({w}_{{\bf{K}}^{\prime} }={\widetilde{w}}_{{\bf{K}}}/8\) and \({{\bf{c}}}_{{\bf{K}}^{\prime} }^{i}={{\bf{c}}}_{{\bf{K}}}^{i}/2\). Then the symmetrization is applied again (the four blue points are connected by fourfold rotation) to exclude the equivalent points, and the weight of the equivalent points is collected on the remaining point, while the vectors \({{\bf{c}}}_{{\bf{K}}^{\prime} }^{i}\) are not changed. After the new K points are evaluated, we go to the next iteration of refinement. On each iteration, any point may be refined, including both those from the initial regular grid, and those created during previous refinement iterations. The procedure stops after the predefined number of iterations was performed. Figure 1g shows how undesired artificial peaks of the AHC curve are removed iteration by iteration, yielding a smooth curve (see “Example: AHC of bcc iron” for details).
Minimaldistance replica selection method (MDRS)
The MDRS method^{30} allows to obtain a more accurate Wannier interpolation, in particular when moderate q grids are used in the ab initio calculations. With the MDRS method, the Fourier transform (8) is modified in the following way:
where \({{\bf{T}}}_{mn{\bf{R}}}^{(j)}\) are \({{\mathcal{N}}}_{mn{\bf{R}}}\) lattice vectors that minimize the distance ∣r_{m} − (r_{n} + R + T)∣ for a given set m, n, R. However, the evaluation of Eq. (21) is quite slower than Eq. (8), because every k, m, n, R an extra loop over j is needed. Therefore, calculations employing MDRS in postw90.x (which is enabled by default) takes more time. Instead, it is convenient to redefine the realspace matrix elements as
only once for the calculation, and then the transformation to kspace is performed via
Note, that the set of R vectors in Eq. (22) is increased compared to the initial set of vectors in Eq. (6) in order to fit all nonzero elements \({\widetilde{X}}_{mn}({\bf{R}})\). Equation (23) having essentially the same form as Eq. (8) can be evaluated via mixed Fourier transform, as described in section “Mixed Fourier transform”.
Thus the MDRS method is implemented in WB via Eqs. (22)–(23), and has practically no extra computational cost, while giving notable accuracy improvement.
Scanning multiple Fermi levels
It is often needed to study anomalous Hall conductivity (AHC) not only for the pristine Fermilevel E_{F} but considering it as a free parameter ϵ. On the one hand, it gives an estimate of the accuracy of the calculation, e.g., sharp spikes may indicate that the result is not converged. On the other hand, ϵdependence gives access to the question of the influence of doping and temperature, and also allows calculation of anomalous Nernst effect (27). As implemented in postw90.x, evaluation of multiple Fermi levels has a large computational cost. However, there is a way to perform the computation of AHC for multiple Fermi levels almost without extra costs. To show this, let’s rewrite Eqs. (10), (11) as \({\sigma }_{\alpha \beta }(\epsilon )={\epsilon }_{\alpha \beta \gamma }\frac{{e}^{2}}{\hslash }{{{\Omega }}}_{\gamma }(\epsilon )\), where Ω_{γ}(ϵ) = ∑_{K}w_{K}Ω_{γ}(K, ϵ) and
where k = K + κ, the definitions of P_{n} and Q_{ln} straightly follow from Eq. (10), and we omit the cartesian index γ further in this subsection. Now suppose we want to evaluate Ω(ϵ_{i}) for a series of Fermi levels ϵ_{i}. For different kpoints and Fermi levels ϵ, the sets of occupied O(k, ϵ) and unoccupied states U(k, ϵ) change, and repeating these summations many times may be computationally heavy. Instead, we note that when going from one Fermilevel ϵ_{i} to another ϵ_{i+1} only a few states at a few κ points change from unoccupied to occupied. Let’s denote the set of such κ points as δκ_{i} then, the change of the total Berry curvature is
where δO_{i}(k) ≡ O(k, ϵ_{i+1}) − O(k, ϵ_{i}). Note that if the step ϵ_{i+1} − ϵ_{i} is small, then δκ_{i} and δO_{i}(k) include only a few elements, if not empty. Hence, the evaluation of Eq. (25) will be very fast. Thus, the full summation Eq. (24) is needed only for the first Fermi level.
In a similar way, this approach may be applied to other Fermisea properties such as orbital magnetization, which may be written as
where \({C}_{mn,\gamma }({\bf{R}})\equiv {\epsilon }_{\alpha \beta \gamma }\langle {\boldsymbol{0}}m {r}_{\alpha }\cdot \hat{H}\cdot ({r}_{\beta }{R}_{\beta }) {\bf{R}}n\rangle\), \({B}_{mn,\beta }({\bf{R}})\equiv \langle {\boldsymbol{0}}m \hat{H}\cdot ({r}_{\beta }{R}_{\beta }) {\bf{R}}n\rangle\) and the other ingredients were explained under Eq. (10). Equation (26) is written following the approach of ref. ^{18}, but the result has a different form, which can be straightforwardly processed by analogy with Eqs. (24) and (25), where the first line of Eq. (26) expresses P_{n}(k), while the second and third lines correspond to Q_{ln}(k). Note that evaluation of C_{mn,γ}(R) requires additional matrix elements evaluated on the ab initio grid, see “Evaluation of additional matrix elements” for details.
Example: AHC of bcc iron
In this section, the usage of the WannierBerri code is demonstrated on a simple example—anomalous Hall conductivity of bcc iron. After the Wannier functions are constructed with Wannier90 (see “Computational details”), the calculation is performed by the following short python script. First, we import the needed packages:
import wannierberri as WB
import numpy as np
Then, we read the information about the system and WFs:
system=WB.System_w90(’Fe’,berry=True)
from files Fe.chk, Fe.eig, Fe.mmn (the first is written by Wannier90, the other two by the interface of the ab initio code, e.g., pw2wannier90.x), or we can read all information from a file Fe_tb.dat, which is also written by Wannier90, or maybe composed by the user from any tightbinding model:
system=WB.System_tb(’Fe_tb.dat’,berry=True)
Next, we define the symmetries that we wish to take into account. In the ab initio calculation, we have specified the magnetization along the z axis, hence the symmetries that are preserved are inversion \({\mathcal{I}}\), fourfold rotation around the z axis C_{4z}, and a combination of timereversal \({\mathcal{T}}\) and twofold rotation around the x axis C_{2x}. Here, we need only the generators of the symmetry group.
system.set_symmetries([
’Inversion’,’C4z’,’TimeReversal*C2x’])
The other symmetries will be automatically obtained by taking products of these generators, for example, the mirror is \({M}_{z}={({C}_{4z})}^{2}\cdot {\mathcal{I}}\).
Next, we need to set the grids of k, K, and κ points. Most conveniently, it can be done by setting the “length” parameter (in Å):
grid=WB.Grid(system,length=100)
This will guarantee the grid to be consistent with the symmetries, and the spacing of k points will be \({{\Delta }}k\approx \frac{2\pi }{{\rm{length}}}\). In this particular case, the reciprocal lattice vectors have length ∣b_{i}∣ = 3.1 Å^{−1}, hence the suggested grid size is \(\frac{{\rm{length}}\cdot  {{\bf{b}}}_{i} }{2\pi }\approx 49\). However, the grid size is adjusted to 50 × 50 × 50 points in order to factorize it as 10 × 10 × 10κ grid and 5 × 5 × 5K grid.
Next, we want to integrate the Berry curvature to get the AHC. This is done by the WB.integrate method.
WB.integrate(system, grid,
Efermi=np.linspace(17.,18.,1001),
smearEf=10, # 10K
quantities=["ahc","cumdos"],
numproc=16,
adpt_num_iter=50,
fout_name="Fe")
and in addition to AHC, we evaluate the cumulative density of states (cDOS) Eq. (32). We consider Fermi level as a free parameter, scanning over a set of Fermi levels from 17 to 18 eV with a step of 1 meV, and small smearing over the Fermi level corresponding to temperature 10 K (~1 meV) is used. It is known, that in the BZ integration, some k points may give a large contribution to the integral. This is especially strong for Berry curvature, which blows up near band degeneracies and avoided crossings, that fall close to the Fermi level. This is reflected as huge spikes in the E_{F}resolved curves—see blue curve in Fig. 1g. To make the calculation more precise around such points, an adaptive recursive refinement algorithm is used, and we set the number of iterations to 50.
From the cDOS, we can find the precise position of the Fermi level E_{F} = 17.618 eV—the energy at which the cumulative DOS reaches eight electrons per unit cell. This is more accurate than the result evaluated from a coarse ab initio grid. Next, it is instructive to plot the AHC after each iteration. In Fig. 1g, one can see that after 50 iterations the chaotic peaks are removed, and we can get a reasonably smooth curve, although we have started from a rather coarse grid of only 50 × 50 × 50 k points. In practice, it is still recommended to start with denser grids, when possible.
To demonstrate why the adaptive refinement is so useful for calculations of AHC, we can also visualize the Berry curvature. With the following lines
WB.tabulate(system, grid,
quantities=["berry"],
frmsf_name="Fe",
numproc=16,
ibands=np.arange(4,9),
Ef0=12.610)
we produce files Fe_berry?.frmsf, containing the energies and Berry curvature of bands 48 (band counting starts from zero) tabulated over the 3D Brillouin zone. The format of the files allows being directly passed to the FermiSurfer visualization tool^{46} which can produce a plot like Fig. 2, which clearly shows that Berry curvature is large in the regions where two bands come close to each other.
This short example demonstrates that the calculations with WB may be run with a few lines of Python script and the broader functionality will be detailed further.
Computation time
Now let us compare the time for the calculations of anomalous Hall conductivity using postw90.x and WannierBerri. We will take the example of bcc Fe and vary different parameters while using the same computational resource (see “Methods”).
The computation consists of two phases. First, some preliminary operations are done. Those include reading the input files and performing Fourier transform from ab initio grid q to realspace vectors R : Eqs. (3), (6), and (7). This operation takes in WB (postw90.x) between 2 (3) seconds for the small q grid 4 × 4 × 4 and 2 (3) minutes for a large grid of 16 × 16 × 16. This time is mostly taken by reading the large formatted text file Fe.mmn, and it is done only once and does not scale with the density of the interpolation grid. In WB this is done in the constructor of the System_w90 class, and the object can be saved on disk using a pickle module so that this operation does not repeat for further calculations.
Next comes the interpolation part itself, for which the evaluation time scales linearly with the number of k points used. Further, the time for an interpolation grid 200 × 200 × 200 is given, which is a rather good grid to make an accurate calculation for this material.
We start with comparing time with the MDRS switched off and without the use of symmetries in WB. As can be seen in Fig. 3, for a small q grid 4 × 4 × 4 WB is just slightly faster then postw90.x. However, for dense q grids the computational time of postw90.x grows linearly with the number of q points, while in WB it stays almost the same. This happens because in postw90.x the Fourier transform is the major timeconsuming routine. On the other hand, in WB, although the cost of the mixed Fourier transform is expected to grow logarithmically with the ab initio grid, we do not see it because Fourier transform amounts only to ~10% of the computational time.
Next, we switch on the MDRS method and the computational time of postw90.x grows by a factor of 5. On the other hand, the computational time of WannierBerri does not change (not shown).
Finally, let’s switch on the use of symmetries in WB. Thus the computational time decreases by a factor of 8. In the ultradense grid limit, one would expect the speedup to be approximately equal to the number of elements in the group—16 in the present example, due to exclusion of symmetryequivalent K points. But this does not happen, because we use an FFT grid of 25 × 25 × 25 κ points for all ab initio grids, hence the K grid is only 8 × 8 × 8, and a considerable part of K points are at highsymmetry positions. Therefore they have less symmetric partners to be excluded from the calculation.
Thus we can see that the difference in computational time with postw90.x and WB reaches three orders of magnitude for this example. Note that the examples above were performed only for the pristine Fermi level. Now let’s see what happens upon scanning the Fermi levels (Fig. 4). In WB, the computational time remains practically unchanged when we use up to N_{ϵ} ≈ 1000 Fermi levels, and only start to grow considerably at N_{ϵ} ~ 10^{4}. On the other hand in postw90.x, the computational time significantly grows with N_{ϵ}, which is especially remarkable for small q grids, where the growth becomes linear already from N_{ϵ} ~10. For denser q grids, the fixed amount of time (independent of N_{ϵ}) is larger, so the linear growth starts at higher N_{ϵ}.
In this section, we did not use the adaptive refinement procedure. However, when one starts from a rather large grid of K points, the new K points coming from the refinement procedure constitute only a small portion of the initial grid, and hence do not contribute much to computation time.
We have shown that the methods suggested in this article help to significantly reduce the computation time from days to minutes. However, bcc iron is a simple example with only one atom per unit cell, and only 18 WFs are needed. More complicated systems will require more time. For example, to obtain a converged value of anomalous Nernst conductivity in PrAlGe^{47} using wannier19 (an early version of WB), the calculation took approximately 30 h on the same computation node. Estimates predict that the same calculation with postw90.x could take several months. Thus it is the case where the numerical advance not only saves time but also brings the calculation from the unreasonably timeconsuming area, where most people would avoid working, to a reasonably feasible computation time.
The functionality implemented in WannierBerri
This appendix outlines the functionality that is currently implemented in WannierBerri. For more detailed and updated information, please refer to the online documentation.
The code may be used to evaluate the following quantities, represented as Brillouin zone integrals:

“ahc” : intrinsic anomalous Hall conductivity \({\sigma }_{\alpha \beta }^{{\rm{AHE}}}\)^{48} via Eq. (11)

Anomalous Nernst conductivity^{49} \({\alpha }_{\alpha \beta }^{{\rm{ANE}}}\) may be obtained from σ_{αβ}(ϵ)^{AHE} evaluated over a dense grid of Fermi levels ϵ
where \(f(\varepsilon )=1/\left(1+{e}^{\frac{\varepsilon \mu }{{k}_{{\rm{B}}}T}}\right)\);

“Morb” : orbital magnetization

“berry_dipole”: Berry curvature dipole
which describes nonlinear Hall effect^{44};

“gyrotropic_Korb” and gyrotropic_Kspin: gyrotropic magnetoelectric effect (GME)^{45} tensor (orbital and spin contributions):

“conductivity_Ohmic”: ohmic conductivity within the Boltzmann transport theory in constant relaxation time (τ) approximation:

“dos”: density of states n(E);

“cumdos”: cumulative density of states
For a more complete and updated list, please refer to the documentation at [wberriorg].
Currently, the following quantities are available to tabulate:

“berry”: Berry curvature

“morb”: orbital moment of Bloch states

“spin”: the expectation value of the Pauli operator

“V”: the band gradients ∇_{k}E_{nk}.
Discussion
In this article, I have presented a series of methods that boost the performance of Wannier interpolation to a higher level. The methods are implemented in the Python code WannierBerri. It is important to note that the mixed Fourier transform and the optimization of MDRS method and Fermilevel iteration while giving a large computational advantage, do not affect the result within machine precision. Hence, WannierBerri can be easily benchmarked with the established postw90.x code. The code not only allows to perform highspeed and highprecision calculations of AHC and a palette of other properties but also serves as a platform for implementing more functionalities involving Wannier interpolation. Thus it has the potential to become a community code. Interestingly, the code uses the same routines to perform calculations both based on WFs and tightbinding models. Finally, in combination with recent advances in automated construction of WFs, it paves a way to highthroughput calculations of properties of solids that require Wannier interpolation.
Methods
Computational details
The input files for WannierBerri are prepared by a combination of an ab initio code and Wannier90. In this article, we used the QuantumEspresso (QE) code^{50}, and closely followed the Tutorial#18 of Wannier90. First, we perform selfconsistent calculations on a grid 16 × 16 × 16 q points, fixing the magnetization along [001] axis. We use Generalized gradient approximation (GGA)^{51} for exchangecorrelation functional and a normconserving pseudopotential from the PseudoDojo library^{52,53}, and spin–orbit coupling is taken into account. Next, we perform a nonselfconsistent calculations using a Γcentered grid of 8 × 8 × 8 q points. Further, we define the set of trial orbitals sp_{3}d_{2}2, d_{xy}, d_{xz}, and d_{yz}, which set the initial guess for 18 WFs describing the conduction band of Fe. And prepare the input files for Wannier90 by means of the pw2wannier90.x interface. Finally, the maximally localized Wannier functions are constructed by the Wannier90 code. The resulting files may be used to start calculations both by postw90.x and WannierBerri. Further, we repeat this procedure for a series of nonselfconsistent q grids. The reader may refer to the documentation of Wannier90 and QE for more details.
Calculations were performed on identical 32core virtual nodes of the ScienceCloud cluster at the University of Zürich. The nodes are based on AMD EPYC 7702 64Core Processors with frequency 2GHz and 128 GB RAM per node, and one node was used per task. The computation time reported in Figs. 3 and 4 refers to this computational setup.
External libraries used in the code
The WannierBerri code is developed in the objectoriented Python3 language and makes use of the popular numerical libraries, which include NumPy^{54}, SciPy^{55}, and lazypropery. Fast Fourier transform is implemented via libraries pyFFTW (wrapper of FFTW3 library^{56}) and NumPy, and the user has an option to choose between them, although no notable difference in performance has been observed. The calculations are performed in parallel over K points by means of the multiprocessing module and the parameter “numproc” specifies that a Pool of 16 worker processes is used.
Evaluation of additional matrix elements
Wannier interpolation starts from certain matrix elements defined on the ab initio (q) grid. Those matrix elements should be evaluated within the ab initio code, namely within its interface to Wannier90. However, only QuantumEspresso^{50} has the most complete interface pw2wannier90.x. The other codes provide only the basic interface, which includes the eigenenergies E_{nq} (.eig file) and overlaps
(file .mmn), where b vector connects neighboring q points. This information allows to interpolate the band energies (and their derivatives of any order) as well as Berry connections^{20} and Berry curvature^{17}. However, to evaluate the orbital magnetization via Eq. (26) or the orbital moment of Bloch states (34), one needs matrix elements of the Hamiltonian^{18} (.uHu file)
The evaluation of Eq. (37) is very specific to the details of the ab initio code, and implemented only in pw2wannier90.x and only for normconserving pseudopotentials. To enable the study of properties related to the orbital moment with other ab initio codes, the following workaround may be employed. By inserting a complete set of Bloch states at a particular q point \({\mathbb{1}}=\mathop{\sum }\nolimits_{l}^{\infty }\left{u}_{l{\bf{q}}}\right\rangle \left\langle {u}_{l{\bf{q}}}\right\), we can rewrite Eq. (37) as
This equation is implemented within the wannierberri.mmn2uHu submodule, which allows to generate the .uHu file out of .mmn and .eig files. The equality in Eq. (38) is exact only in the limit \({l}_{\max }\to \infty\) and infinitely large basis set for the wavefunctions representation. So in practice, one has to check convergence for a particular system. As an example, we calculate the orbital magnetization of bcc Fe using the .uHu file computed with pw2wannier90.x and using the wannierberri.mmn2uHu interface with different summation limit \({l}_{\max }\) in (38). As can be seen in Fig. 5 already \({l}_{\max }=200\) (corresponding energy ~230 eV) yields a result very close to that of pw2wannier90.x. However, one should bear in mind that convergence depends on many factors, such as the choice of WFs and pseudopotentials. In particular, for tellurium, we observed^{24} that including only a few bands above the highest pband is enough to obtain accurate results. However for iron, using a pseudopotential shipped with the examples of Wannier90, we failed to reach convergence even with \({l}_{\max }=600\).
To interpolate the spin operator expectation value, the matrix \({s}_{mn}({\bf{q}})=\langle {u}_{m{\bf{q}}} \hat{\sigma } {u}_{n{\bf{q}}}\rangle\) is needed. To facilitate study of spindependent properties within VASP^{57} code, a submodule wannierberri.vaspspn is included, which computes S_{mnq} based on the normalized pseudowavefunction read from the WAVECAR file. Note that the use of pseudowavefunction instead of the full PAW^{58} wavefunction is an approximation, which however in practice gives a rather accurate interpolation of spin.
The mmn2uHu and vaspspn modules were initially developed and used in ref. ^{24} as separate scripts, but were not published so far. Now they are included in the WannierBerri package with the hope of being useful to the community.
Data availability
All input files needed to generate the Wannier functions and perform the example of the code, as well as the resulting output data plotted in the figures may be freely downloaded from the Materials Cloud Archive (https://doi.org/10.24435/materialscloud:1r8w).
Code availability
All software used and developed in this article are opensource and available for free. WannierBerri is available to install via PyPI repository https://pypi.org/project/wannierberri and open for contributions via GitHub https://github.com/stepantsirkin/wannierberri. Updated documentation is available at http://wannierberri.org/. External libraries used in WB are available via PyPI repository (https://pypi.org). Wannier90^{28,29,30} is available at http://www.wannier.org/. QuantumEspresso^{50} is available at https://www.quantumespresso.org/. Figures were produced using matplotlib^{59} (Figs. 1, 3–5) and FermiSurfer^{46} (Fig. 2), and also with help of Inkscape vector graphics editor (https://inkscape.org).
References
Wannier, G. H. The structure of electronic excitation levels in insulating crystals. Phys. Rev. 52, 191–197 (1937).
Marzari, N., Mostofi, A. A., Yates, J. R., Souza, I. & Vanderbilt, D. Maximally localized Wannier functions: theory and applications. Rev. Mod. Phys. 84, 1419–1475 (2012).
Vanderbilt, D. & KingSmith, R. D. Electric polarization as a bulk quantity and its relation to surface charge. Phys. Rev. B 48, 4442–4455 (1993).
KingSmith, R. D. & Vanderbilt, D. Theory of polarization of crystalline solids. Phys. Rev. B 47, 1651–1654 (1993).
Resta, R. Macroscopic polarization in crystalline dielectrics: the geometric phase approach. Rev. Mod. Phys. 66, 899–915 (1994).
Thonhauser, T., Ceresoli, D., Vanderbilt, D. & Resta, R. Orbital magnetization in periodic insulators. Phys. Rev. Lett. 95, 137205 (2005).
Ceresoli, D., Thonhauser, T., Vanderbilt, D. & Resta, R. Orbital magnetization in crystalline solids: multiband insulators, chern insulators, and metals. Phys. Rev. B 74, 024408 (2006).
Xiao, D., Chang, M.C. & Niu, Q. Berry phase effects on electronic properties. Rev. Mod. Phys. 82, 1959–2007 (2010).
Soluyanov, A. A. & Vanderbilt, D. Computing topological invariants without inversion symmetry. Phys. Rev. B 83, 235401 (2011).
Bradlyn, B. et al. Topological quantum chemistry. Nature 547, 298–305 (2017).
Wu, Q., Zhang, S., Song, H.F., Troyer, M. & Soluyanov, A. A. WannierTools: An open source software package for novel topological materials. Comput. Phys. Commun. 224, 405–416 (2018).
Bouhon, A., BlackSchaffer, A. M. & Slager, R.J. Wilson loop approach to fragile topology of split elementary band representations and topological crystalline insulators with timereversal symmetry. Phys. Rev. B 100, 195135 (2019).
Varnava, N., Souza, I. & Vanderbilt, D. Axion coupling in the hybrid Wannier representation. Phys. Rev. B 101, 155130 (2020).
Souza, I., Marzari, N. & Vanderbilt, D. Maximally localized Wannier functions for entangled energy bands. Phys. Rev. B 65, 035109 (2001).
Slater, J. C. & Koster, G. F. Simplified LCAO method for the periodic potential problem. Phys. Rev. 94, 1498–1524 (1954).
GosálbezMartínez, D., Souza, I. & Vanderbilt, D. Chiral degeneracies and Fermisurface Chern numbers in bcc Fe. Phys. Rev. B 92, 085138 (2015).
Wang, X., Yates, J. R., Souza, I. & Vanderbilt, D. Ab initio calculation of the anomalous Hall conductivity by Wannier interpolation. Phys. Rev. B 74, 195118 (2006).
Lopez, M. G., Vanderbilt, D., Thonhauser, T. & Souza, I. Wannierbased calculation of the orbital magnetization in crystals. Phys. Rev. B 85, 014435 (2012).
Pizzi, G., Volja, D., Kozinsky, B., Fornari, M. & Marzari, N. BoltzWann: a code for the evaluation of thermoelectric and electronic transport properties with a maximallylocalized Wannier functions basis. Comput. Phys. Commun. 185, 422–429 (2014).
Yates, J. R., Wang, X., Vanderbilt, D. & Souza, I. Spectral and Fermi surface properties from Wannier interpolation. Phys. Rev. B 75, 195121 (2007).
IbanezAzpiroz, J., Tsirkin, S. S. & Souza, I. Ab initio calculation of the shift photocurrent by Wannier interpolation. Phys. Rev. B 97, 245143 (2018).
Giustino, F., Cohen, M. L. & Louie, S. G. Electronphonon interaction using Wannier functions. Phys. Rev. B 76, 165108 (2007).
Poncé, S., Margine, E., Verdi, C. & Giustino, F. EPW: electronphonon coupling, transport and superconducting properties using maximally localized Wannier functions. Comput. Phys. Commun. 209, 116–133 (2016).
Tsirkin, S. S., Puente, P. A. & Souza, I. Gyrotropic effects in trigonal tellurium studied from first principles. Phys. Rev. B 97, 035158 (2018).
Qiao, J., Zhou, J., Yuan, Z. & Zhao, W. Calculation of intrinsic spin Hall conductivity by Wannier interpolation. Phys. Rev. B 98, 214402 (2018).
Ryoo, J. H., Park, C.H. & Souza, I. Computation of intrinsic spin Hall conductivities from first principles using maximally localized Wannier functions. Phys. Rev. B 99, 235113 (2019).
Marzari, N. & Vanderbilt, D. Maximally localized generalized Wannier functions for composite energy bands. Phys. Rev. B 56, 12847 (1997).
Mostofi, A. A. et al. wannier90: a tool for obtaining maximallylocalised Wannier functions. Comput. Phys. Commun. 178, 685–699 (2008).
Mostofi, A. A. et al. An updated version of wannier90: a tool for obtaining maximally localised Wannier functions. Comput. Phys. Commun. 185, 2309–2310 (2014).
Pizzi, G. et al. Wannier90 as a community code: new features and applications. Matter 32, 165902 (2020).
Mustafa, J. I., Coh, S., Cohen, M. L. & Louie, S. G. Automated construction of maximally localized Wannier functions for bands with nontrivial topology. Phys. Rev. B 94, 125151 (2016).
Damle, A., Lin, L. & Ying, L. Compressed representation of KohnSham orbitals via selected columns of the density matrix. J. Chem. Theory Comput. 11, 1463–1469 (2015).
Damle, A. & Lin, L. Disentanglement via entanglement: a unified method for Wannier localization. Multiscale model. Sim 16, 1392–1410 (2018).
Vitale, V. et al. Automated highthroughput Wannierisation. npj Comput. Mater. 6, 66 (2020).
Zhang, Z. et al. Highthroughput screening and automated processing toward novel topological insulators. J. Phys. Chem. Lett. 9, 6224–6231 (2018).
Garrity, K. F. & Choudhary, K. Database of Wannier Tightbinding Hamiltonians using highthroughput density functional theory. http://arxiv.org/abs/2007.01205 [condmat.mtrlsci] (2020).
Garrity, K.F., Choudhary, K. JARVISWannierTB : database Wannier Tightbinding hamiltonian derived properties of 3D and 2D materials, online https://jarvis.nist.gov/jarviswtb/. Accessed 06/02/2021.
Cooley, J. W. & Tukey, J. W. An algorithm for the machine computation of the complex Fourier series. Math. Comput. 19, 297–301 (1965).
Heideman, M., Johnson, D. & Burrus, C. Gauss and the history of the fast Fourier transform. IEEE ASSP Mag. 1, 14–21 (1984).
Duhamel, P. & Vetterli, M. Fast fourier transforms: a tutorial review and a state of the art. Signal Process. 19, 259–299 (1990).
Van Loan, C. Computational Frameworks for the Fast Fourier Transform (Society for Industrial and Applied Mathematics, 1992).
Yao, Y. et al. First principles calculation of anomalous Hall conductivity in ferromagnetic bcc Fe. Phys. Rev. Lett. 92, 037204 (2004).
Sakuma, R. Symmetryadapted Wannier functions in the maximal localization procedure. Phys. Rev. B 87, 235109 (2013).
Sodemann, I. & Fu, L. Quantum nonlinear Hall effect induced by Berry curvature dipole in timereversal invariant materials. Phys. Rev. Lett. 115, 216806 (2015).
Zhong, S., Moore, J. E. & Souza, I. Gyrotropic magnetic effect and the magnetic moment on the Fermi surface. Phys. Rev. Lett. 116, 077201 (2016).
Kawamura, M. FermiSurfer: Fermisurface viewer providing multiple representation schemes. Comput. Phys. Commun. 239, 197–203 (2019).
Destraz, D. et al. Magnetism and anomalous transport in the Weyl semimetal PrAlGe: possible route to axial gauge fields. npj Quantum Mater. 5, 5 (2020).
Nagaosa, N., Sinova, J., Onoda, S., MacDonald, A. H. & Ong, N. P. Anomalous Hall effect. Rev. Mod. Phys. 82, 1539–1592 (2010).
Xiao, D., Yao, Y., Fang, Z. & Niu, Q. Berryphase effect in anomalous thermoelectric transport. Phys. Rev. Lett. 97, 026603 (2006).
Giannozzi, P. et al. Quantum ESPRESSO toward the exascale. J. Chem. Phys. 152, 154105 (2020).
Perdew, J. P., Burke, K. & Ernzerhof, M. Generalized gradient approximation made simple. Phys. Rev. Lett. 77, 3865–3868 (1996).
van Setten, M. et al. The PseudoDojo: training and grading a 85 element optimized normconserving pseudopotential table. Comput. Phys. Commun. 226, 39–54 (2018).
Hamann, D. R. Optimized normconserving Vanderbilt pseudopotentials. Phys. Rev. B 88, 085117 (2013).
Oliphant, T. E. A Guide to NumPy (Trelgol Publishing, 2006).
Virtanen, P. et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat. Methods 17, 261–272 (2020).
Frigo, M. & Johnson, S. G. The design and implementation of FFTW3. In Fawwaz T. Ulaby (ed) Proceedings of the IEEE 93. Special issue on "Program Generation, Optimization, and Platform Adaptation", 216–231 (IEEE, 2005).
Kresse, G., et al. Vienna Ab initio Simulation Package (VASP) code. online https://www.vasp.at/. Accessed 06/12/2021.
Blöchl, P. E. Projector augmentedwave method. Phys. Rev. B 50, 17953–17979 (1994).
Hunter, J. D. Matplotlib: a 2D graphics environment. Comput. Sci. Eng. 9, 90–95 (2007).
Acknowledgements
I thank Ivo Souza and CheolHwan Park for useful discussions and comments helping to improve the paper. I also acknowledge Xiaoxiong Liu, Miguel Ángel Jiménez Herrera, Patrick M. Lenggenhager, JaeMo Lihm, and Minsu Ghim for fixing bugs and further development of the code, which will be described elsewhere. I acknowledge support from the Swiss National Science Foundation (grant number: PP00P2_176877), the NCCR Marvel and the European Union’s Horizon 2020 research and innovation program (ERCStGNeupert757867PARATOP).
Author information
Authors and Affiliations
Contributions
The work was done by a single author, including the development of methodology, development of the core of the WannierBerri code, testing, and preparing the manuscript. Other researchers made contributions to the code, which are not used and not described in this paper.
Corresponding author
Ethics declarations
Competing interests
The author declares no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Tsirkin, S.S. High performance Wannier interpolation of Berry curvature and related quantities with WannierBerri code. npj Comput Mater 7, 33 (2021). https://doi.org/10.1038/s41524021004985
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41524021004985
This article is cited by

High Chern number van der Waals magnetic topological multilayers MnBi2Te4/hBN
npj 2D Materials and Applications (2023)

Shift current response in elemental twodimensional ferroelectrics
npj Computational Materials (2023)

Spincharge separation and quantum spin Hall effect of $$\beta$$bismuthene
Scientific Reports (2023)

Electronic and topological properties of kagome lattice LaV3Si2
Tungsten (2023)

Spinneutral currents for spintronics
Nature Communications (2021)