  We describe a robust method for determining Pipek-Mezey (PM) Wannier
functions(WF), which provide some formal advantages over the more common Boys
(also known as maximally-localized) Wannier functions. The
Broyden-Fletcher-Goldfarb-Shanno (BFGS) based PMWF solver is demonstrated to
yield dramatically faster convergence compared to the alternatives (steepest
ascent and conjugate gradient) in a variety of 1-, 2-, and 3-dimensional solids
(including some with vanishing gaps), and can be used to obtain Wannier
functions robustly in supercells with thousands of atoms. Evaluation of the PM
functional and its gradient in periodic LCAO representation used a particularly
simple definition of atomic charges obtained by Moore-Penrose pseudoinverse
projection onto the minimal atomic orbital basis.
