Foster-Boys localization
The Foster-Boys localization method (Pipek and Mezey 1989) minimizes the spatial extent of the occupied MOs, i.e. it minimizes \[\begin{equation} \require{physics} B = % \sum_i^{N_P} % \int \int \dd{\vb{r}_1} \dd{\vb{r}_2} % \phi_i^*(\vb{r}_1) \phi_i(\vb{r}_1) % \thinspace \norm{ \vb{r}_1 - \vb{r}_2 }^2 \thinspace % \phi_i^*(\vb{r}_2) \phi_i(\vb{r}_2) % \thinspace , \end{equation}\] which can be found to be equal to (Pipek and Mezey 1989) \[\begin{equation} B = 2 \sum_i^{N_P} % \qty( % \int \dd{\vb{r}} % \phi_i^*(\vb{r}) % \thinspace \norm{\vb{r}}^2 \thinspace % \phi_i(\vb{r}) % ) % - 2 \sum_i^{N_P} % \norm{ \qty( % \int \dd{\vb{r}} % \phi_i^*(\vb{r}) % \thinspace \vb{r} \thinspace % \phi_i(\vb{r}) % ) % }^2 % \thinspace . \end{equation}\] Since the trace in the first term is invariant with respect to orbital rotations, the task of minimizing \(B\) can be chosen to be equivalent to maximizing the trace of the squared norm of the matrix elements of the dipole operator. (Pipek and Mezey 1989)