1%!TEX root=./user_guide.tex
2\chapter{Methodology}\label{sec:method}
3\wannier\ computes maximally-localised Wannier functions (MLWF)
4following the method of Marzari and Vanderbilt
5(MV)~\cite{marzari-prb97}.  For entangled energy bands, the method of
6Souza, Marzari and Vanderbilt (SMV)~\cite{souza-prb01} is used. We
7introduce briefly the methods and key definitions here, but full
8details can be found in the original papers and in
9Ref.~\cite{mostofi-cpc08}.
10
11First-principles codes typically solve the electronic structure of
12periodic materials in terms of Bloch states, $\psi_{n{\bf k}}$.
13These extended states are characterised by a band index $n$ and crystal
14momentum ${\bf k}$. An alternative representation can be given in terms
15of spatially localised functions known as Wannier functions (WF). The WF
16centred on a lattice site ${\bf R}$, $w_{n{\bf R}}({\bf r})$,
17is written in terms of the set of Bloch states as
18\begin{equation}
19w_{n{\bf R}}({\bf r})=\frac{V}{(2\pi)^3}\int_{\mathrm{BZ}}
20\left[\sum_{m} U^{({\bf k})}_{mn} \psi_{m{\bf k}}({\bf
21    r})\right]e^{-\mathrm{i}{\bf k}.{\bf R}} \:\mathrm{d}{\bf k} \ ,
22\end{equation}
23where $V$ is the unit cell volume, the integral is over the Brillouin
24zone (BZ), and $\Uk$ is a unitary matrix that mixes the Bloch
25states at each ${\bf k}$. $\Uk$ is not uniquely defined and different
26choices will lead to WF with varying spatial localisations. We define
27the spread $\Omega$ of the WF as
28\begin{equation}
29\Omega=\sum_n \left[\langle w_{n{\bf 0}}({\bf r})| r^2 | w_{n{\bf
30      0}}({\bf r}) \rangle - | \langle w_{n{\bf 0}}({\bf r})| {\bf r}
31      | w_{n{\bf 0}}({\bf r}) \rangle |^2 \right].
32\end{equation}
33The total spread can be decomposed into a gauge invariant term
34$\Omega_{\rm I}$ plus a term ${\tilde \Omega}$ that is dependant on the gauge
35choice $\Uk$. ${\tilde \Omega}$ can
36be further divided into terms diagonal and off-diagonal in the WF basis,
37$\Omega_{\rm D}$ and $\Omega_{\rm OD}$,
38\begin{equation}
39\Omega=\Omega_{\rm I}+{\tilde \Omega}=\Omega_{\rm I}+\Omega_{\rm
40  D}+\Omega_{\rm OD}
41\end{equation}
42where
43\begin{equation}
44\Omega_{{\rm I}}=\sum_n \left[\langle w_{n{\bf 0}}({\bf r})| r^2 | w_{n{\bf
45      0}}({\bf r}) \rangle - \sum_{{\bf R}m} \left| \langle w_{n{\bf
46      R}}({\bf r})| {\bf r} | w_{n{\bf 0}}({\bf r}) \rangle \right| ^2
47      \right]
48\end{equation}
49\begin{equation}
50\Omega_{\rm D}=\sum_n \sum_{{\bf R}\neq{\bf 0}} |\langle w_{n{\bf
51    R}}({\bf r})| {\bf r} | w_{n{\bf 0}}({\bf r}) \rangle|^2
52\end{equation}
53\begin{equation}
54\Omega_{\rm OD}=\sum_{m\neq n} \sum_{{\bf R}} |\langle w_{m{\bf R}}({\bf
55  r})| {\bf r} | w_{n{\bf 0}}({\bf r}) \rangle |^2
56\end{equation}
57The MV method minimises the gauge dependent spread $\tilde{\Omega}$
58with respect the set of $\Uk$ to obtain MLWF.
59
60\wannier\ requires two ingredients from an initial electronic
61structure calculation.
62\begin{enumerate}
63\item The overlaps between the cell periodic part of the Bloch states
64  $|u_{n{\bf k}}\rangle$
65\begin{equation}
66M_{mn}^{(\bf{k,b})}=\langle u_{m{\bf k}}|u_{n{\bf k}+{\bf b}}\rangle,
67\end{equation}
68where the vectors ${\bf b}$, which connect a given k-point with its
69neighbours, are determined by \wannier\ according to the prescription
70outlined in Ref.~\cite{marzari-prb97}.
71\item As a starting guess the projection of the Bloch states
72  $|\psi_{n\bf{k}}\rangle$ onto trial localised orbitals $|g_{n}\rangle$
73\begin{equation}
74A_{mn}^{(\bf{k})}=\langle \psi_{m{\bf k}}|g_{n}\rangle,
75\end{equation}
76\end{enumerate}
77Note that $\Mkb$, $\Ak$ and $\Uk$ are all small, $N \times N$
78matrices\footnote{Technically, this is true for the case of an
79  isolated group of $N$ bands from which we obtain $N$ MLWF. When
80  using the disentanglement procedure of Ref.~\cite{souza-prb01},
81  $\Ak$, for example, is a rectangular matrix. See
82  Section~\ref{sec:disentangle}.}  that are independent of the basis
83set used to obtain the original Bloch states.
84
85To date, \wannier\ has been used in combination with electronic codes
86based on plane-waves and pseudopotentials (norm-conserving and
87ultrasoft~\cite{vanderbilt-prb90}) as well as mixed basis set techniques such as
88FLAPW~\cite{posternak-prb02}.
89
90\section{Entangled Energy Bands}\label{sec:disentangle}
91The above description is sufficient to obtain MLWF for an isolated set
92of bands, such as the valence states in an insulator. In order to
93obtain MLWF for entangled energy bands we use the ``disentanglement''
94procedure introduced in Ref.~\cite{souza-prb01}.
95
96We define an energy window (the ``outer window''). At a given
97k-point $\bf{k}$, $N^{({\bf k})}_{{\rm win}}$ states lie within this
98energy window. We obtain a set of $N$ Bloch states by
99performing a unitary transformation amongst the Bloch states which
100fall within the energy window at each k-point:
101 \begin{equation}
102| u_{n{\bf k}}^{{\rm opt}}\rangle = \sum_{m\in N^{({\bf k})}_{{\rm win}}}
103U^{{\rm dis}({\bf k})}_{mn} | u_{m{\bf k}}\rangle
104\end{equation}
105where $\bf{U}^{{\rm dis}({\bf k})}$ is a rectangular $N^{({\bf k})}_{{\rm win}} \times N$
106 matrix\footnote{As ${\bf U}^{{\rm dis}({\bf k})}$ is a rectangular
107 matrix this is a unitary operation in the sense that $({\bf U}^{{\rm
108 dis}({\bf k})})^{\dagger}{\bf U}^{{\rm dis}({\bf k})}={\bf 1}_N$.}. The
109 set of $\bf{U}^{{\rm dis}({\bf k})}$ are obtained by minimising
110 the gauge invariant spread $\Omega_{{\rm I}}$ within the outer energy
111 window. The MV procedure can then be used to minimise $\tilde{\Omega}$
112 and hence obtain MLWF for this optimal subspace.
113
114It should be noted that the energy bands of this optimal subspace may
115not correspond to any of the original energy bands (due to mixing
116between states). In order to preserve exactly the properties of a
117system in a given energy range (e.g., around the Fermi level) we
118introduce a second  energy window. States lying within this inner, or
119``frozen'', energy window are included unchanged in the optimal
120subspace.
121