  We propose and construct a numerical algorithm to calculate the Berry
conductivity in topological band insulators. The method is applicable to cold
atom systems as well as solid state setups, both for the insulating case where
the Fermi energy lies in the gap between two bulk bands as well as in the
metallic regime and interpolates smoothly between both regimes. The algorithm
is gauge-invariant by construction, efficient and yields the Berry conductivity
with known and controllable statistical error bars. We apply the algorithm to
several paradigmatic models in the field of topological insulators, including
Haldane's model on the honeycomb lattice, the multi-band Hofstadter model and
the BHZ model, which describes the 2D spin Hall effect observed in
CdTe/HgTe/CdTe quantum well heterostructures.
