  We define topological invariants in terms of the ground states wave functions
on a torus. This approach leads to precisely defined formulas for the Hall
conductance in four dimensions and the topological magneto-electric $\theta$
term in three dimensions, and their generalizations in higher dimensions. They
are valid in the presence of arbitrary many-body interaction and disorder.
These topological invariants systematically generalize the two-dimensional
Niu-Thouless-Wu formula, and will be useful in numerical calculations of
disordered topological insulators and strongly correlated topological
insulators, especially fractional topological insulators.
