In quantum chemical calculations, the electron density, ρ(r), is a function of the coordinates r, defined so ρ(r)dr is the number of electrons in a small volume dr. For closed-shell molecules, ρ ( r ) {\displaystyle \rho (\mathbf {r} )} can be written in terms of a sum of products of basis functions, φ: