  In this article, we present an interpolative separable density fitting (ISDF)
based algorithm to calculate exact exchange in periodic mean field
calculations. In the past, decomposing the two-electron integrals into tensor
hypercontraction (THC) form using ISDF was the most expensive step of the
entire mean field calculation. Here we show that by using a multigrid-ISDF
algorithm both the memory and the CPU cost of this step can be reduced. The CPU
cost is brought down from cubic scaling to quadratic scaling with a low
computational prefactor which reduces the cost by almost two orders of
magnitude. Thus, in the new algorithm, the cost of performing ISDF is largely
negligible compared to other steps. Along with the CPU cost, the memory cost of
storing the factorized two-electron integrals is also reduced by a factor of up
to 35. With the current algorithm, we can perform Hartree-Fock calculations on
a Diamond supercell containing more than 17,000 basis functions and more than
1,500 electrons on a single node with no disk usage. For this calculation, the
cost of constructing the exchange matrix is only a factor of four slower than
the cost of diagonalizing the Fock matrix. Augmenting our approach with linear
scaling algorithms can further speed up the calculations.
