# mmn2uHu

Wannier interpolation starts from certain matrix elements defined on the
*ab initio* (\({\bf q}\)) grid. Those matrix elements should be
evaluated within the *ab initio* code, namely within its interface to
Wannier90. However, only QuantumEspresso has the
most complete interface `pw2wannier90.x`

. The other codes provide only
the basic interface, which includes the eigenenergies
\(E_{n{\bf q}}\) (`.eig`

file) and overlaps

(file `.mmn`

), where \(\mathbf{b}\) vector connects neighbouring
\({\bf q}\)-points. This information allows to interpolate the band
energies (and their derivatives of any order) as well as Berry
connections (Yates et al. 2007) and Berry curvature (Wang et al. 2006).
However, to evaluate the orbital moment of a Bloch state, one needs
matrix elements of the Hamiltonian (Lopez et al. 2012) (`.uHu`

file)

The evaluation of (1) is very specific to the
details of the *ab initio* code, and implemented only in
`pw2wannier90.x`

and only for norm-conserving 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 \({\bf q}\)
point
\(\mathbf{1}=\sum_l^\infty \vert u_{l{\bf q}}\rangle\langle u_{l{\bf q}}\vert\)
we can rewrite (1) as

Similarly, the two quantities below allows to interpolate spin currnet matrices to calculate spin Hall conductivity. In Ryoo’s scheme (Ryoo et al. 2019)
, they are required as input data (`.sHu`

and `.sIu`

)

These equations are implemented within the `wannierberri.utils.mmn2uHu`

submodule, which allows to generate the `.uHu`

, `.sHu`

, and `.sIu`

file out of `.mmn`

, `.spn`

,
and `.eig`

files. The equality in (2) and (3) is
exact only in the limit \(l_{\rm 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 the
bandstructure of bcc Fe was calculated based on the QE code and a
norm-sonserving pseudopotential from the PseudoDojo library(van Setten
et al. 2018; Hamann 2013). Next, the orbital magnetization was
calculated using the `.uHu`

file computed with `pw2wannier90.x`

and
using the `wannierberri.utils.mmn2uHu`

interface with different summation
limit \(l_{\rm max}\) in (2). As can be
seen in Fig. 1 already \(l_{\rm max}=200\)
(corresponding energy \(\sim 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 as choice of WFs and
pseudopotentials. In particular, for tellurium we observed (Tsirkin,
Puente, and Souza 2018) that including only a few bands above the
highest \(p\)-band 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_{\rm max}=600\).

This utility calculates the matrices .uHu, .uIu, .sHu, and/or .sIu from the .mmn, .spn matrices, and also reduces the number of bands in .amn, .mmn, .eig and .spn files

Usage example:

```
python3 -m wannierberri.utils.mmn2uHu seedname NBout=10 NBsum=100,200 targets=mmn,uHu formatted=uHu
```

- Options
`-h`- print the help message

- IBstart
- the first band in the output file (counting starts from 1).default: 1
- IBstartSum
- the first band in the sum (counting starts from 1).default: 1
- NBout
- the number of bands in the output files.Default : all bands
- NBsum
- the number of bands in the summation. (one may specify several numbers, usefull to test convergence with the number of bands).Default:all bands
- input
- path to the input files.Default: ./
- output
- path to the output files
- targets
- files to write :
`amn`

,`mmn`

,`spn`

,`uHu`

,`uIu`

,`sHu`

,`sIu`

,`eig`

default:`amn`

,``mmn``,``eig``,``uHu`` - formatted
- files to write as formatted
`uHu`

,`uIu`

,`sHu`

,`sIu`

,`spn`

,`spn_in`

,`spn_out`

,`all`

default: none