The theory of almost commuting matrices can be used to quantify topological
obstructions to the existence of localized Wannier functions with time-reversal
symmetry in systems with time-reversal symmetry and strong spin-orbit coupling.
We present a numerical procedure that calculates a Z_2 invariant using these
techniques, and apply it to a model of HgTe. This numerical procedure allows us
to access sizes significantly larger than procedures based on studying twisted
boundary conditions. Our numerical results indicate the existence of a metallic
phase in the presence of scattering between up and down spin components, while
there is a sharp transition when the system decouples into two copies of the
quantum Hall effect. In addition to the Z_2 invariant calculation in the case
when up and down components are coupled, we also present a simple method of
evaluating the integer invariant in the quantum Hall case where they are
decoupled.Comment: Added detail regarding the mapping of almost commuting unitary
matrices to almost commuting Hermitian matrices that form an approximate
representation of the sphere. 6 pages, 6 figure