Density functional theory and density matrices