Ground-state densities from the Rayleigh-Ritz variation principle and from density-functional theory.