the resulting Wannier functions is varying strongly, indicating hopping of the solution among different local minima due to the stochastic nature of the algorithm. At the top panel of figure \[fig:ga\_sm\] one can observe how the algorithm is stuck in a local minimum over several thousands of generations, before it escapes and reaches the global minimum valley at around the 50000th generation. An improvement of the locality for later generations is clearly seen from the modulus square of the optimized Wannier functions (figure \[fig:ga\_sm\], right panels). The discontinuous nature of the GA method ensures with stochastic certainty that the global minimum of the SM is found, providing the best localization of the Wannier functions with respect to a given locality measure. At the same time, however, the numerical load of the GA method exceeds the one of the CG method by far, making it inappropriate for routine application for an efficient construction of maximally localized Wannier functions.

Integrated modulus optimization\[sec:IM\]
=========================================

![Locality ($\mathcal{I}_{n}$) of the Wannier functions optimized with respect to the IM locality measure using the CG method. Four different randomly chosen initial sets of Bloch phases were used for the CG optimization. Top: Sq-D crystal, TM polarization. Bottom: 