# Berry phase calculations¶

In this tutorial we provide a set of examples of how to calculate various physical properties derived from the \(k\)-space Berry phases.

## Spontaneous polarization of tetragonal BaTiO3¶

As a first example we calculate the spontaneous polarization of the ferroelectric BaTiO3 in the tetragonal phase. The initial step is to generate a ground state calculation with wavefunctions. This can be don e with the script `gs_BaTiO3.py`

. We can then run the script

```
from gpaw.berryphase import get_polarization_phase
from ase.io import read
from ase.units import _e
import numpy as np
phi_c = get_polarization_phase('BaTiO3.gpw')
atoms = read('BaTiO3.gpw')
cell_v = np.diag(atoms.get_cell()) * 1.0e-10
V = np.prod(cell_v)
print('P:', (phi_c / (2 * np.pi) % 1) * cell_v * _e / V, 'C/m^2')
```

which calculates the polarization. It will take a few minutes on a single CPU, but can also be parallelized. It generates a .json file that contains the polarization and will read if the script is run again. It is thus possible to submit the polarization script and print the polarization by rerunning the script above in the terminal. The calculation adds the contribution from the electrons and the nucleii, which implies that the result is independent of the positions of the atoms relative to the unit cell. The results should be 0.33 \(C/m^2\), which agrees with the values from literature.

## Born effective charges of tetragonal BaTiO3¶

The Berry phase module can also be used to calculate Born effective charges. They are defined by

where \(u_j^a\) is the position of atom \(a\) in direction \(j\) relative to the equilibrium position and \(P_i\) is the polarization in direction \(i\). Like the case of phonons all atoms are moved in all possible directions and the induced polarization is calculated for each move. For the BaTiO3 structure calculated above the calculation is performed with the script

```
from gpaw import GPAW
from gpaw.borncharges import borncharges
calc = GPAW('BaTiO3.gpw', txt=None)
borncharges(calc)
```

Again the results are written to a .json file and the Born effective charges can be viewed with the script

```
import json
import numpy as np
with open('borncharges-0.01.json') as fd:
Z_avv = json.load(fd)['Z_avv']
for a, Z_vv in enumerate(Z_avv):
print(a)
print(np.round(Z_vv, 2))
```

Due to symmetry all the tensors are diagonal. Note, however, the large differences between the components for each of the O atoms. The Born effective charges tell us how the atoms are affected by an external electric field.

## Topological properties of stanene from parallel transport¶

As a last example we demonstrate how the \(k\)-space Berry phases can be applied to extract topological properties of solids. For an isolated band we can calculate the Berry phase

where \(k_i\) is the component of crystal momentum corresponding to \(\mathbf{b}_i\) in reduced coordinates. The Berry phase is only gauge invariant modulo \(2\pi\) and since \(\gamma_1(k_2, k_3)=\gamma_1(k_2+1, k_3)=\gamma_1(k_2, k_3+1)\) modulo \(2\pi\), we can count how many multiples of the \(2\pi\) that \(\gamma_1\) changes while \(k_2\) of \(k_3\) is adiabatically cycled through the Brillouin zone. This is the Chern number, which gives rise to a topological \(\mathbb{Z}\) classification of all two-dimensional insulators. For multiple valence bands the situation is slightly more complicated and one has to introduce the notion of parallel transport to obtain the Berry phases of individual bands. We refer to Ref. 1 for details.

For materials with time-reversal symmetry the Chern number vanishes. Instead, any insulator in two dimensions can be classified according to a \(\mathbb{Z}_2\) index \(\nu\) that counts the number of times berry phases acquire a particular value in half the Brillouin zone modulo two. Below we give the example of stanene, which is referred to as a quantum spin Hall insulator due to the non-trivial topology reflected by \(\nu=1\). The ground state can be set up with the script `gs_Sn.py`

. Afterwards the Berry phases of all occupied bands are calculated with

```
import os
from gpaw.berryphase import parallel_transport
from gpaw import GPAW
import gpaw.mpi as mpi
calc = GPAW('gs_Sn.gpw',
kpts={'size': (7, 200, 1), 'gamma': True},
fixdensity=True,
symmetry='off',
txt='Sn_berry.txt')
calc.get_potential_energy()
calc.write('gs_berry.gpw', mode='all')
parallel_transport('gs_berry.gpw', direction=0, name='7x200')
if mpi.world.rank == 0:
os.system('rm gs_berry.gpw')
```

Finally the berry phase spectrum can be plottet with `plot_phase.py`

and the result is shown below.

Note the degeneracy of all phases at the time-reversal invariant points \(\Gamma\) and \(M\). Also note that any horizontal line is transversed by an odd number of phases in half the Brillouin zone (for example the \(\Gamma-M\) line). We also display the expectation value of \(S_z\) according to color. This is possible because the individual phases correspond to the first moments of hybrid Wannier functions localized along the \(x\)-direction and these functions have a spinorial structure with a well-defined value of \(\langle S_z\rangle\). 1