pythtb.Wannier.maxloc#
- Wannier.maxloc(alpha=0.5, max_iter=1000, tol=1e-05, grad_min=0.001, verbose=False)[source]#
Unitary transformation to minimize the gauge-dependent spread.
This procedure implements the Marzari-Vanderbilt maximal localization algorithm [1]. Given a (disentangled) subspace (
.tilde_states), it finds the optimal unitary transformation that minimizes the gauge-dependent part of the Wannier spread \(\widetilde{\Omega}\). The algorithm proceeds iteratively, applying gradient-descent updates to the unitary matrices at each k-point until convergence.- Parameters:
- alphafloat, optional
Step size for gradient descent. Typical values are between 0 and 1.
- max_iterint, optional
Maximum number of iterations for the optimization. Default is 1000.
- tolfloat, optional
Convergence tolerance for the change in spread. Default is 1e-5.
- grad_minfloat, optional
Minimum gradient magnitude for convergence. Default is 1e-3.
- verbosebool, optional
If True, print progress messages. Default is False.
Notes
The gauge-dependent contribution to the total Wannier spread is
\[\widetilde{\Omega} = \Omega - \Omega_I,\]where \(\Omega\) is the total quadratic spread functional and \(\Omega_I\) is the gauge-invariant part obtained during the disentanglement step.
The minimization is achieved by unitary rotations of the form
\[| u_{m\mathbf{k}}^{\text{new}} \rangle = \sum_{n} U_{nm}(\mathbf{k}) \, | u_{n\mathbf{k}}^{\text{old}} \rangle,\]with \(U(\mathbf{k}) \in U(N)\), where \(N\) is the dimension of the disentangled subspace at each k-point.
The gradient of \(\widetilde{\Omega}\) with respect to an infinitesimal anti-Hermitian generator \(A(\mathbf{k})\) is computed, and the unitary matrices are updated via
\[U(\mathbf{k}) \;\to\; \exp[-\epsilon A(\mathbf{k})] \, U(\mathbf{k}),\]where \(\epsilon = \alpha/4 \sum_{\mathbf{b}}w_b\) is the step size (given
alpha).Iteration proceeds until the gradient norm falls below
grad_minand the change in spread is smaller thantol, or the maximum number of iterations is reached.
References
[1]Marzari, N., & Vanderbilt, D. Maximally localized generalized Wannier functions for composite energy bands. Phys. Rev. B 56, 12847 (1997).