<div dir="ltr">Dear CP2K users and developers,<div><br></div><div>I am reading the source code of CP2K, and I have got lots of insights about formulas and algorithms from it. However, I have encountered a question when reading the aobasis/ai_verfc.F file in src directory.</div><div><br></div><div>The ai_verfc module is used for calculating the matrix <a|erfc(r)/r|b> in all-electron calculation. This term is divided into a nuclear term <a|1/r|b> and an error function term <a|erf(r)/r|b>. In the code prefactors corresponding these two terms are calculated by </div><div><br></div><div><div>fnuc = 2.0_dp*pi*zetp*f0</div><div>ferf = 2.0_dp*SQRT(pi**5*zetw)*zetp*zetq*f0</div></div><div><br></div><div>and the basic s-orbital integrals are calculated by prefactors and incomplete gamma function</div><div><br></div><div><div>t = rcp2/zetp</div><div>CALL fgamma(nmax-1, t, f)</div></div><div>vnuc(1, 1, n) = fnuc*f(n-1)<br></div><div><br></div><div>t = -f4*rcp2/zetp<br></div><div>CALL fgamma(nmax-1, t, f)<br></div><div>verf(1, 1, n) = ferf*f(n-1)<br></div><div><br></div><div>Then the integrals over p or higher orbitals are calculated by a recursion procedure as is discussed in the literature: S. Obara and A. Saika, J. Chem. Phys. 84, 3963 (1986).</div><div><br></div><div>My question is that according to my derivations, my result for fnuc is consistent with the code, but my ferf is </div><div>ferf = 2.0_dp*pi*zetp*f0*(-f4)**(n-0.5)</div><div>which is not consistent with the code, and is dependent on the parameter n in the incomplete gamma function f(n).</div><div><br></div><div>And it is reasonable that on the limit of zetc going to infinity, the error function term <a|erf(r)/r|b> should be the same as the nuclear term <a|1/r|b>. But according to source code, it seems not to be the case.</div><div><br></div><div>Therefore I want to ask, is this a potential mistake in the source code, or did I miss anything else in the derivations? I really appreciate it if someone could help me solve this question.</div><div><br></div><div>Best wishes,</div><div>Junting</div></div>