We develop the theory and practical expressions for the full quantum-mechan
ical distribution of the intrinsic macroscopic polarization of an insulator
in terms of the ground state wave function. The central quantity is a cumu
lant generating function, which yields, upon successive differentiation, al
l the cumulants and moments of the probability distribution of the center o
f mass X/N of the electrons, defined appropriately to remain valid for exte
nded systems obeying twisted boundary conditions. The first moment is the a
verage polarization, where we recover the well-known Berry phase expression
. The second cumulant gives the mean-square fluctuation of the polarization
, which defines an electronic localization length xi(i) along each directio
n i: xi(i)(2) = ((X-i(2)) - (X-i)(2))/N. It follows from the fluctuation-di
ssipation theorem that in the thermodynamic limit xi(i) diverges for metals
and is a finite, measurable quantity for insulators. In noninteracting sys
tems xi(i)(2) is related to the spread of the Wannier functions. It is poss
ible to define for correlated insulators maximally localized ''many-body Wa
nnier functions," which for large N become localized in disconnected region
s of the high-dimensional configuration space, establishing a direct connec
tion with Kohn's theory of the insulating state. Interestingly, the express
ion for xi(i)(2), which involves the second derivative of the wave function
with respect to the boundary conditions, is directly analogous to Kohn's f
ormula for the "Drude weight" as the second derivative of the energy.