  Grid-based discretizations of the time dependent Schr\"odinger equation
coupled to an external magnetic field are converted to manifest gauge invariant
discretizations. This is done using generalizations of ideas used in classical
lattice gauge theory, and the process defined is applicable to a large class of
discretized differential operators. In particular, popular discretizations such
as pseudospectral discretizations using the fast Fourier transform can be
transformed to gauge invariant schemes. Also generic gauge invariant versions
of generic time integration methods are considered, enabling completely gauge
invariant calculations of the time dependent Schr\"odinger equation. Numerical
examples illuminating the differences between a gauge invariant discretization
and conventional discretization procedures are also presented.
