Electron density and density matrix approximations using potential energy error bounds