  Quantum Monte Carlo simulations of interacting electrons in solids often use
Slater-Jastrow trial wave functions with Jastrow factors containing one- and
two-body terms. In uniform systems the long-range behavior of the two-body term
may be deduced from the random-phase approximation (RPA) of Bohm and Pines.
Here we generalize the RPA to nonuniform systems. This gives the long-range
behavior of the inhomogeneous two-body correlation term and provides an
accurate analytic expression for the one-body term. It also explains why
Slater-Jastrow trial wave functions incorporating determinants of Hartree-Fock
or density-functional orbitals are close to optimal even in the presence of an
RPA Jastrow factor. After adjusting the inhomogeneous RPA Jastrow factor to
incorporate the known short-range behavior, we test it using variational Monte
Carlo calculations. We find that the most important aspect of the two-body term
is the short-range behavior due to electron-electron scattering, although the
long-range behavior described by the RPA should become more important at high
densities.
