## Introduction

This tutorial describes how to prepare and write a Hamiltonian matrix in Wannier functions basis using the exciting-plus code. The theoretical background for Wannier functions generation and Hamiltonian production procedure is described in EPJB 65, 91 (2008). The procedure of Hamiltonian generation consists of three steps:

- Self-consistent DFT calculation.
- Preparation of input parameters for projection.
- Generation of Wannier functions and writing of obtained Hamiltonian.

Below we illustrate this procedure on examples of nickel oxide and bcc-iron. The details about performing DFT calculations can be found in a code distribution or at the Exciting-plus web-site.

## Example 1: Nickel oxide

Input file

```
tasks
0 ! Ground state run starting from the atomic densities
10 ! Total, partial and interstitial density of states (DOS).
20 ! Band structure plot.
xctype !PBE exchange-correlation potential, PRL 77, 3865 (1996)
20 0 0
autormt ! muffin-tin radii should be determined automatically
.true.
betamax ! maximum adaptive mixing parameter
0.1
scale
7.893389
avec
1.0 0.5 0.5
0.5 1.0 0.5
0.5 0.5 1.0
atoms
2 ! nspecies
'Ni.in' ! spfname
2 ! natoms
0.0 0.0 0.0 0.0 0.0 0.0 ! atpos, bfcmt
0.5 0.5 0.5 0.0 0.0 0.0 ! atpos, bfcmt
'O.in' ! spfname
2 ! natoms
0.25 0.25 0.25 0.0 0.0 0.0 ! atpos, bfcmt
0.75 0.75 0.75 0.0 0.0 0.0 ! atpos, bfcmt
nempty ! the number of empty states
20
ngridk ! the k-point mesh sizes
4 4 4
dosmsum ! partial DOS is to be summed over m
.true.
plot1d
5 100
0.00000 0.00000 0.00000 ! G
0.00000 0.50000 0.00000 ! X
0.25000 0.25000 0.25000 ! L
0.25000 0.50000 0.00000 ! W
0.00000 0.00000 0.00000 ! G
wannier
.false. ! switch on/off wannier block
.false. ! .false. -> don't apply potential correction to WF states
4 2 1 ! N of atoms, N of orbital groups, N of energy intervals
5 ! number of orbitals in orbital group #1 : Ni-d
5 6 7 8 9 ! order of cubic harmonics : xy, yz, 3z^2-r^2, xz, x^2-y^2
1 1 1 1 1 ! spin
1 1 1 1 1 ! energy window for each orbital
3 ! number of orbitals in orbital group #3 : O-p
2 3 4 ! order of cubic harmonics : y, z, x
1 1 1 ! spin
1 1 1 ! energy window for each orbital
-0.1 0.3 0.0 ! Definition of energy interval:E_bottom, E_top
1 1 ! 1 atom takes 1 orbital group
2 1 ! 2 atom takes 1 orbital group
3 2 ! 3 atom takes 2 orbital group
4 2 ! 4 atom takes 2 orbital group
```

Copy species files

The results of our calculations are presented in Fig.1. We are interested in the Ni 3*d* and O 2*p* bands located at 0.15 - 0.3 Ha and -0.05 - 0.15 Ha, respectively. These bands are well separated from other by energy gaps.

**Figure 1:**Band structure obtained in non-spin-polarized GGA calculation for NiO. In the figure the green lines indicate the upper and lower boundaries of energy window, which will be used later for projection, violet line denotes Fermi energy.

To start projection to WF basis set *d* orbitals of Ni + *p* orbitals of O = 2) and energy interval(s) used in projection.

In next lines there are definition of mentioned orbital groups, energy intervals and relations between them. Line 4 sets number of orbitals in the first group to "5" (degeneracy of *d* states). Next three lines define first orbital group: it contains *d* orbitals in certain order (see Exciting-plus documentation), for all orbitals we take spin "1" (as a result of non-spin-polarized calculation) and energy interval "1". The next four lines define second orbital group: it contains 3 *p* orbitals of oxygen, for all 3 orbitals we take spin "1" and energy interval "1". It is important to note that states with different orbital symmetry cannot be mixed in the same orbital group.

The next line contains definition of energy interval shown in Fig.1 by green color: E_{bottom} =-0.1 Ha, E_{top} =0.3 Ha, third parameter is not used, set it to zero.

Next block of lines defines binding between atoms in structure block of *d*). From atom "3" and "4" of crystal structure (O) we take orbitals, defined in orbital group "2" (*p*).

**Figure 2:**Comparison of bands in LAPW and WF basis for NiO.

One should run

When you will be satisfied with the result, set

## Example 2: Iron in bcc structure

The second example to consider is building of Hamiltonian for bcc-Fe. Starting steps are the same as described above for NiO. Copy species file

```
tasks
0 ! Ground state run starting from the atomic densities
10 ! Total, partial and interstitial density of states (DOS).
20 ! Band structure plot.
```

nempty
15

ngridk
12 12 12

avec
2.769866077 2.769866077 2.769866077
2.769866077 2.769866077 -2.769866077
2.769866077 -2.769866077 2.769866077

atoms
1 : nspecies
'Fe.in' : spfname
1 : natoms;
0.0 0.0 0.0 0.0 0.0 0.0 : atposl, bfcmt below

rgkmax
9.5

plot1d
6 500
0.0 0.0 0.0 ! G
0.5 0.5 0.0 ! N
0.5 0.5 0.5 ! P
0.0 0.0 0.0 ! G
0.5 0.5 0.0 ! N
0.5 -0.5 0.5 ! H

wannier
.false. ! switch on/off wannier block
.false. ! .false. -> don't apply potential correction to WF states
3 3 1 ! N of atoms, N of orbital groups, N of energy intervals
1 ! number of orbitals in orbital group #1 : Fe-s
1 ! order of cubic harmonics : s
1 ! spin
1 ! energy window for each orbital
3 ! number of orbitals in orbital group #1 : Fe-p
2 3 4 ! order of cubic harmonics : y, z, x
1 1 1 ! spin
1 1 1 ! energy window for each orbital
5 ! number of orbitals in orbital group #1 : Fe-d
5 6 7 8 9 ! order of cubic harmonics : xy, yz, 3z^2-r^2, xz, x^2-y^2
1 1 1 1 1 ! spin
1 1 1 1 1 ! energy window for each orbital
-0.1 1.5 0.0 ! energy window #1 : s-p-d complex of bands
1 1 ! atom 1 (Fe) gets first orbital group
1 2 ! atom 1 (Fe) gets second orbital group
1 3 ! atom 1 (Fe) gets third orbital group

wannier_soft_eint
-0.1 0.6 0.005 0.15

The obtained band structure is presented in Fig.3. We would like to include *s* , *p* and *d* states of iron into Wannier basis set. All bands are above 0 Ha, so E_{bottom} =-0.1 Ha is a good choice. Setting of E_{top} is a bit more tricky. Our basis includes 9 bands, but there is no band gap above them. With any choice of E_{top}, defined energy window will include less or more than 9 bands. Let set E_{top} =1.5 Ha, this window guarantees including of all 9 bands in basis.

There is only one atom in considered unit cell and three orbital groups for *s* , *p* and *d* states. The connection between orbital groups and atom includes 3 lines. From atom "1" of crystal structure (Fe) we take orbitals, defined in orbital group "1" (*s*); in next line, from the same atom "1" we take orbitals, defined in orbital group "2" (*p*); and in last line again from atom "1" we take orbitals, defined in orbital group "3" (*d*).

**Figure 3:**Band structure obtained in non-spin-polarized GGA calculation for bcc-Fe. Violet bold line denotes Fermi energy, green bold lines indicate bottom and top of energy window, that will be used for projection.

To solve the problem with admixture of high lying energy bands we add to input file

Set *d* bands), but projection of high-lying state is not good. Nevertheless, if you are not interested in high energy physical properties, this projection is good enough for DFT+DMFT calculations.

Set

**Figure 4:**Comparison of bands in LAPW and WF basises for bcc-Fe.