  Electron repulsion integral tensor has ubiquitous applications in quantum
chemistry calculations. In this work, we propose an algorithm which compresses
the electron repulsion tensor into the tensor hypercontraction format with
$\mathcal{O}(n N^2 \log N)$ computational cost, where $N$ is the number of
orbital functions and $n$ is the number of spatial grid points that the
discretization of each orbital function has. The algorithm is based on a novel
strategy of density fitting using a selection of a subset of spatial grid
points to approximate the pair products of orbital functions on the whole
domain.
