Absolute newbie in quantum chemistry here. I was recently looking through some Fortran libraries from my university to see if I understand all of the mathematics. In a Hartree-Fock library, I found the following code snippet for calculation of the overlap-integral between two contracted s-type GTOs.
rab = sum( (r_a-r_b)**2 )
do i=1,npa
do j=1,npb
eab = alp(i)+bet(j)
oab = 1.0_wp/eab
cab = ci(i)*cj(j)
xab = alp(i)*bet(j)*oab
est = rab*xab
ab = exp(-est)
s00 = cab*ab*sqrt(pi*oab)**3
!overlap
sab = sab+s00
enddo
enddo
with r_a
and r_b
being the positions of the two gaussians in cartesian coordinates and alp(i)
and bet(i)
containing the orbital coefficients of the primitives. From this code snippet I read that the overlap-integral is calculated via:
$$
K_{AB}=e^{-r_{AB}(\frac{\alpha \beta}{\alpha+\beta})}\tag{1}
$$
$$
S= K_{AB} \cdot \sqrt{\frac{\pi}{\alpha+\beta}}^3\tag{2}
$$
But if I try to get to this formula myself, I get a slightly different result:
For the overlap integral of two Gaussians $\phi_{A}$ and $\phi_{B}$
$$ \phi_{A}(\alpha,r-R_A)=e^{-\alpha(r-R_A)^2}\tag{3} $$
$$ \phi_{B}(\beta,r-R_B)=e^{-\beta(r-R_B)^2}\tag{4} $$
we can use the Gaussian-product-theorem to combine both Gaussians to one function $\phi_{AB}$: $$ \phi_{A}(\alpha,r-R_A) \cdot \phi_{B}(\beta,r-R_B) = K_{AB} \cdot \phi_{AB}(\alpha+\beta,r-\frac{\alpha R_A + \beta R_B}{\alpha + \beta})\tag{5} $$ $$ \phi_{AB} = K_{AB} \cdot \left (\frac{2\alpha\beta}{(\alpha+\beta)\pi} \right )^{\frac{3}{4}} \cdot e^{-\alpha\beta(r-\frac{\alpha R_A+\beta R_B}{\alpha+\beta})^2}\tag{6} $$
Now integrating this Gaussian should yield the overlap integral between our starting functions. The integral of an arbitrary gaussian can be solved via: $$ \int \phi_A(\alpha ,r-R_A) = \sqrt{\frac{\pi}{\alpha}}\tag{7} $$ $$\tag{8} \int\phi_{AB}=K_{AB} \cdot \left (\frac{2\alpha\beta}{(\alpha+\beta)\pi}\right )^{\frac{3}{4}} \cdot \sqrt{\frac{\pi}{\alpha\beta}} $$
Which, as far as I can see, is already a different equation to the one I read from the code. Where is my mistake? I know this is some pretty basic stuff, any help is appreciated.