CCL: Some confusions about indices of two-electron integrals in programming



 Sent to CCL by: Jussi Lehtola [jussi.lehtola[#]helsinki.fi]
 On Fri, 9 Mar 2012 14:55:33 +0800 (CST)
 "Jun Zhang coolrainbow##yahoo.cn" <owner-chemistry(0)ccl.net>
 wrote:
 > Hello Everyone:
 >
 > We know that in quantum chemistry programming the two-electron
 > integrals (ERI) are computed in batch (e.g., <ss|spx>,<ss|spy>,
 > <ss|spz> at the same time) to make efficient use of the common
 > immediate quantities. But what confused me is the index fetching.
 > That is, when <ss|spx> is to calculate, how to determine the indices
 > of the 3 integrals <ss|spx>,<ss|spy>, <ss|spz> in memory?
 And then,
 > how to make the following subroutines know that <ss|spy> and
 <ss|spz>
 > have been calculated?
 >
 > It will be better if you can recommend meÂsome codes to read.Â
 Thank
 > you in advance.
 The indexing with two-electron integrals is rather nontrivial. Even
 more nontrivial would be writing a two-electron integral code, as there
 are many possible paths to the wanted target integral.
 Fortunately, Ed Valeev has written libint, which uses Obara-Saika and
 Head-Gordon-Pople recursion relations to automatically generate optimal
 code to obtain the wanted integral. http://sourceforge.net/p/libint/
 What you get out of libint is just the target integrals. From the
 libint programmer's manual:
 "Shell-sets of integrals contain integrals in ârow majorâ
 order.For
 exam- ple, if the number of functions in each shell is na , nb , nc ,
 and nd , respectively, then the integral (ab|cd) is found at position
 abcd = ((a*nb + b)*nc + c)*nd + d."
 --
 --------------------------------------------------------
 Mr. Jussi Lehtola, M. Sc.         Doctoral Student
 jussi.lehtola(0)helsinki.fi         Department of Physics
 http://www.helsinki.fi/~jzlehtol  University of Helsinki
 Office phone: +358 9 191 50 632   Finland
 --------------------------------------------------------
 Jussi Lehtola, FM                 Tohtorikoulutettava
 jussi.lehtola(0)helsinki.fi         Fysiikan laitos
 http://www.helsinki.fi/~jzlehtol  Helsingin Yliopisto
 TyÃpuhelin: (0)9 191 50 632
 --------------------------------------------------------