# Efficient GPU Implementation of the McMurchie-Davidson Method for Shell-Based ERI Computations
## 2 Two-Electron Repulsion Integrals  
This section describes the preliminaries behind the computation of two-electron repulsion integrals (termed Basis-ERIs). Concretely speaking, a Basis-ERI is defined as a double integral over the entire space involving four basis functions \(\chi_{\mu}\), \(\chi_{\
u}\), \(\chi_{\lambda}\), and \(\chi_{\sigma}\), as follows:\[(\mu\
u|\lambda\sigma)=\iint\chi_{\mu}(\mathbf{r}_{1})\chi_{\
u}(\mathbf{r}_{1})\frac{1}{ \tau_{12}}\chi_{\lambda}(\mathbf{r}_{2})\chi_{\sigma}(\mathbf{r}_{2})dr_{1}dr_{2} \tag{6}\]  
where  
\[(\mu\
u|\lambda\sigma)\] notation often used in quantum chemistry to denote a Basis-ERI. \[(\mu\
u|\] _bra_ term. \[|\lambda\sigma)\] _ket_ term. \[\mathbf{r}_{1},\ \mathbf{r}_{2}\] position vectors representing the three-dimensional coordinates \[(x,y,z)\] of two electrons. \[r_{12}\] norm of the vector \[\mathbf{r}_{1}-\mathbf{r}_{2}\] (Euclidean distance) representing the Coulomb interaction between two electrons. \[\chi_{\mu}\] notation for a basis function. In the above-mentioned formulation, the Basis-ERIs are to be computed for every combination of four basis functions. Therefore, if one considers \(M\) basis functions, the reader may note that the total number of combinations of Basis-ERIs is \(M^{4}\). For instance, when one considers a molecular system with basis functions \(\chi_{1}\) and \(\chi_{2}\), thus \(M=2\), one is to compute \(2^{4}=16\) Basis-ERIs. In order to illustrate the above-mentioned configuration, Figure 1a shows the matrix-based configurations of the possible interactions between the two basis functions \(\chi_{1}\) and \(\chi_{2}\), in which the elements in the column direction correspond to the _bra_ terms, whereas the elements in the row direction correspond to the _ket_ terms. Also, each cell in the matrices of Figure 1a represents a single Basis-ERI. One can benefit from the symmetry implications in Equation (6), as follows:  
Figure 1: Example of the configuration of two basis functions \(\chi_{1}\) and \(\chi_{2}\) (\(M=2\)). (**a**) The quartet combinations, and (**b**) the symmetry-based combinations for Basis-ERIs when \(M=2\). By considering symmetrical relations, it becomes possible to reduce the number of Basis-ERIs, as shown by the upper triangular matrix in (**b**). \[(\mu\
u|\lambda\sigma)\]0  
As a result, the number of Basis-ERIs that require computation is reduced to  
\[(\mu\
u|\lambda\sigma)\]1  
In order to illustrate the merits of the symmetry relations, Figure 1b shows the possible combinations considering symmetry considerations. By observing Figure 1a,b, the reader may note that, by including symmetry in the formulation of Basis-ERIs, it becomes possible to reduce the total number of Basis-ERIs, as shown by the upper triangular matrix in Figure 1b. As such, the overall Basis-ERI calculation determines each element in the upper triangular matrix of Figure 1b. Furthermore, in quantum chemistry, the basis function \(\chi_{\mu}(\mathbf{r})\) is often expressed as a linear combination of Gaussian basis functions as follows:  
\[(\mu\
u|\lambda\sigma)\]2  
where \(G_{\mu_{e}}\) denotes the Gaussian-type orbitals (GTOs), \(K_{\mu}\) denotes the number of terms in the linear combination, and \(d_{\mu_{e}}\) denotes the coefficients of the linear combination. In the above, the Gaussian-type orbital \(G_{\mu_{e}}\) is defined as follows:  
\[(\mu\
u|\lambda\sigma)\]3  
where \(\mathbf{A}=(A_{x},A_{y},A_{z})\) represents the orbital center (Cartesian coordinate center), \(c_{e}\) is a normalization constant, \(\mu_{x}\), \(\mu_{y}\), and \(\mu_{z}\) are non-negative integers that determine the orbital shape, and \(\alpha_{e}\) is a parameter representing the spread of orbitals. In other words, a basis function consists of a set of Gaussian-type orbitals with the same center \(\mathbf{A}\), the same azimuthal quantum numbers \(\mu_{x}\), \(\mu_{y}\), \(\mu_{z}\), but different coefficients \(d_{\mu_{e}}\) and parameters \(\alpha_{e}\).