  We present a method which enables solid-state density functional theory
calculations to be applied to systems of almost unlimited size. Computations of
physical effects up to the micron length scale but which nevertheless depend on
the microscopic details of the electronic structure, are made possible. Our
approach is based on a generalization of the Bloch state which involves an
additional sum over a finer grid in reciprocal space around each ${\bf
k}$-point. We show that this allows for modulations in the density and
magnetization of arbitrary length on top of a lattice-periodic solution. Based
on this, we derive a set of ultra long-range Kohn-Sham equations. We
demonstrate our method with a sample calculation of bulk LiF subjected to an
arbitrary external potential containing nearly 3500 atoms. We also confirm the
accuracy of the method by comparing the spin density wave state of bcc Cr
against a direct supercell calculation starting from a random magnetization
density. Furthermore, the spin spiral state of $\gamma$-Fe is correctly
reproduced and the screening by the density of a saw-tooth potential over 20
unit cells of silicon is verified.
