Sie sind auf Seite 1von 12

HSERILib: Gaussian integral evaluation

Timothy J. Giese
a)
Department of Chemistry, University of Minnesota Minneapolis, Minnesota 55455, USA
(Original version December 22, 2006; Current version March 11, 2008)
This manuscript is a modied version of the documentation I had written for a library which computed
the electron repulsion integrals based on the work of Hamilton and Schaefer. No attempt is made
herein at deriving the recurrence relationships, but if the reader is familiar with several important
papers on the subject, then the notation and description of the algorithm will be reasonably clear. It
is not the intent of this document to be a authoritative introduction to Gaussian integral evaluation;
however, the explanations in notation, and particularly the appendices, will compliment the literature.
CONTENTS
I. Introduction 1
II. Overview 1
III. Methods 2
A. Notation 2
B. Electron repulsion integrals 4
1. Summary of the algorithm 4
2. Auxiliary integrals 4
3. Vertical recurrence relation 5
4. Electron (angular momentum) transfer relation 5
5. Contraction 6
6. Horizontal recurrence relation 6
C. The 1-electron integrals 7
1. Electrostatic potential integrals 7
2. Overlap and moment integrals 7
3. Kinetic energy integrals 8
A. The Gamma function, double factorial, and binomial
coefcient 8
B. Real spherical harmonics 9
C. Cartesian Gaussian functions 9
D. Solid harmonic Gaussian functions 10
E. Cartesian-to-solid harmonic transformation 11
F. Cartesian Gaussian-to-solid harmonic Gaussian
transformation 11
I. INTRODUCTION
Ecient evaluation of quantum calculations is a daunting
task, in large part, due to the necessity of computing multi-
center integrals over non-local operators. A Gaussian basis
greatly reduces the complexity of integral evaluation because
the product of 2 Gaussian functions is, itself, a single Gaus-
sian function located on a new center. In Hartree-Fock theory,
a)
Electronic mail: giese025@umn.edu
the non-local operators integrated within a set of basis func-
tions
i
(r) are referred to as electron repulsion integrals,
[i j|kl] =
_ _

i
(r)
j
(r)
k
(r

)
l
(r

)
|r r

|
d
3
rd
3
r

, (1)
and it is the evaluation of these integrals that dominate the
eort in solving the Hartree-Fock equations.
HSERILib is an acronym for Hamilton-Schaefer Electron
Repulsion Integral Library. As the acronym suggests, it is
a library of ecient Fortran 90/95 routines for computing
electron repulsion integrals using the approach described by
Hamilton and Schaefer
1
. HSERILib was written in Oct. 2006
by Timothy J. Giese and is distributed under the terms of the
GNUPublic License. Acopy of the license terms are provided
in the source code distribution.
The outline of this manuscript follows. Sec. II itemizes
the integrals implemented in the library. Sec. III briey de-
scribes the algorithms used to compute the integrals.
II. OVERVIEW
HSERILib contains routines to compute:
4-center, 2-electron electron repulsion integrals
3-center, 1-electron electrostatic potential integrals
(electron-nuclear attraction)
3-center, 1-electron multipole moment integrals
2-center, 1-electron overlap integrals
2-center, 1-electron kinetic energy integrals
Each of these integrals can be computed with Cartesian or
solid harmonic Gaussian functions under various normaliza-
tion conventions. A Cartesian Gaussian function has the gen-
eral form

i
(r R
i
) = N
LX
lmn
(x X
i
)
l
i
(y Y
i
)
m
i
(z Z
i
)
n
i
e

i
|rR|
2
, (2)
whereas a solid harmonic Gaussian is written

i
(r R
i
) = N
LX
LM
|r R|
L
i
e

i
|rR|
2
Y
L
i
M
i
(). (3)
2
The constants N
LX
lmn
and N
LX
LM
(X [0, 1, 2]) correspond to L0,
L1, and L2normalization conventions (the desired normal-
ization conventions are input parameters to the routines). Ap-
pendices C and D describe in detail the various normaliza-
tion conventions and corresponding normalization constants.
In brief, L0 normalization is equivalent to un-normalized
Gaussian functions, L1normalization reproduces unit mul-
tipole moment (in the case of solid harmonic Gaussians) or
Cartesian moment (for the case of Cartesian Gaussians), and
L2normalization reproduces unit self-overlap. This exibil-
ity in normalization allows one to compute integrals involving
orbitals which are expanded into a basis or a density which is
expanded into an auxiliary basis, or a combination of these,
e.g., one can compute the Coulomb interaction between a
product of 2 basis functions (which would be a density if they
were a basis of orbitals) with a single, auxiliary basis of den-
sity. This exibility will be discussed in more detail later.
Regardless of normalization, one denes a contracted
Gaussian function (Cartesian or solid harmonic) as

i
(r) =

Ii
C
i,I

I
(r) (4)
where I runs over a set of primitive Gaussian functions and
C
i,I
is a corresponding set of contraction coecients for the
i
th
contracted Gaussian. In some writings it is assumed that
the contraction coecients contain or have absorbed, in some
way, the primitive normalization constants; however, in this
manuscript (and in the implementation of the library), the con-
traction coecients do not implicitly contain normalization
constants.
Having dened a Gaussian function and noting that the
representation (Cartesian or solid harmonic) and the normal-
ization (L0, L1, or L2) are user-input to the library sub-
routines, this section now explicitly denes the integrals com-
puted by the library. In the notation that follows, square
brakets are used to denote primitive quantities and parentheses
are used to denote contracted quantities.
The electron repulsion integrals computed by HSERILib
are
(i j|kl) =

Ii

Jj

Kk

Ll
C
i,I
C
j,J
C
k,K
C
l,L
[IJ|KL]
=
_ _

i
(r)
j
(r)
k
(r

)
l
(r

)
|r r

|
d
3
rd
3
r

.
(5)
The electrostatic potential integrals are
(i|
1
|r R
k
|
| j) =

Ii

Jj
C
i,I
C
j,J
[I|
1
|r R
k
|
|J]
=
_

i
(r)
j
(r)
|r R
k
|
d
3
r.
(6)
The Cartesian moment integral is
(i|(x X
k
)
l
(y Y
k
)
m
(z Z
k
)
n
| j) =

Ii

Jj
C
i,I
C
j,J
[I|(x X
k
)
l
(y Y
k
)
m
(z Z
k
)
n
|J]
=
_

i
(r)
j
(r)(x X
k
)
l
(y Y
k
)
m
(z Z
k
)
n
d
3
r,
(7)
whereas the (solid harmonic) multipole moment integral is written
(i|
_
4
2l + 1
|r R
k
|
l
Y
lm
()| j) =

Ii

Jj
C
i,I
C
j,J
[I|
_
4
2l + 1
|r R
k
|
l
Y
lm
()|J]
=
_

i
(r)
j
(r)
_
4
2l + 1
|r R
k
|
l
Y
lm
()d
3
r.
(8)
The overlap and kinetic energy integrals are
(i| j) =

Ii

Jj
C
i,I
C
j,J
[I|J]
=
_

i
(r)
j
(r)d
3
r
(9)
and

1
2
(i|
2
| j) =
1
2

Ii

Jj
C
i,I
C
j,J
[I|
2
|J]
=
1
2
_

i
(r)
2

j
(r)d
3
r,
(10)
respectively.
III. METHODS
A. Notation
The algorithm used to compute electron repulsion inte-
grals is relatively complicated. Therefore, before beginning
the description, it is imperative to introduce a notation that
is amenable to a symbolic description. The Cartesian Gaus-
sian [Eq. (2)] of angular momentum L contains the polynomial
3
x
l
y
m
z
n
where l, m, and n are integers. A shell of functions is a
set of functions that dier by their values of l, m, and n only,
but whose total angular momentum (L = l + m + n) are the
same. For example, p
x
, p
y
, and p
z
represent the shell of p-
functions. In general, there are (L + 1)(L + 2)/2 Cartesian
Gaussians within a shell of angular momentum L. The values
of l, m, and n are said to be in canonical order when they are
retrievable by this simple loop structure (written in Perl)
my $canind=0;
for my $i ( 0 .. $L )
{
my $l = $L-$i;
for my $n ( 0 .. $i )
{
my $m = $i-$n;
$canind++;
printf (%2i,%2i,%2i) =
. x x $l
. y x $m
. z x $n
. ($canind)\n, $l,$m,$n;
};
};
where $canind is called the canonical index. For example,
when L = 3, the output of the above Perl-code is
( 3, 0, 0) = xxx (1)
( 2, 1, 0) = xxy (2)
( 2, 0, 1) = xxz (3)
( 1, 2, 0) = xyy (4)
( 1, 1, 1) = xyz (5)
( 1, 0, 2) = xzz (6)
( 0, 3, 0) = yyy (7)
( 0, 2, 1) = yyz (8)
( 0, 1, 2) = yzz (9)
( 0, 0, 3) = zzz (10)
Each ordered set (l, m, n) can be written as an element of
a vector [of length (L + 1)(L + 2)/2] and the canonical index
of this vector returns a particular ordered set. For example,
let f refer to the ordered sets of L = 3 (shown above), then
f
3
= (2, 0, 1), where the rst element of the vector starts with
index 1 (Fortran notation).
In addition, a description of the algorithm will require the
use of the vector 1. It will be used to relate quartets diering
by their polynomials. Angular momentum can be increased
or decreased by incrementing a power in the polynomial, for
example
g
3
= (3, 0, 1) = (2, 0, 1) + (1, 0, 0) = f
3
+ 1
1
, (11)
where f
3
and g
3
are the third ordered sets in L = 3 and L = 4,
respectively, and 1
i
is
1
1
= (1, 0, 0)
1
2
= (0, 1, 0)
1
3
= (0, 0, 1)
(12)
Note that g has 15 elements, whereas f has 10, and it is only
coincidence that the canonical indices of f and g are both 3
in the above example, i.e., the example is not an attempt to
describe a simple 1:1 connection of canonical indices between
vectors of diering angular momenta.
In the following sections, one will encounter the N
i
(a
j
)
operator introduced by Obara and Saika
2
. The result of N
i
on
a
j
is the integer value of the i
th
component in the ordered set
of a
j
. If the ordered sets were thought of as 3 1 arrays, then
N
i
(a
j
) = 1
T
i
a
j
. (13)
As an example,
N
1
(f
3
) = (1 0 0)
_

_
2
0
1
_

_
= 2 (14)
Using the notation described in this section, one can write
a quartet of electron repulsion integrals
(ab|cd) =
_

_
_

_
(a
1
b
1
|c
1
d
1
)
(a
1
b
1
|c
1
d
2
)
.
.
.
(a
1
b
1
|c
1
d
N
d
)
_

_
_

_
(a
1
b
1
|c
2
d
1
)
(a
1
b
1
|c
2
d
2
)
.
.
.
(a
1
b
1
|c
2
d
N
d
)
_

_
.
.
.
_

_
(a
1
b
1
|c
N
c
d
1
)
(a
1
b
1
|c
N
c
d
2
)
.
.
.
(a
1
b
1
|c
N
c
d
N
d
)
_

_
.
.
.
.
.
.
.
.
.
(a
N
a
b
N
b
|c
N
c
d
N
d
)
_

_
(15)
In other words, the quartet (ab|cd) is a short-hand nota-
tional reference to (L
a
+1)(L
a
+2)(L
b
+1)(L
b
+2)(L
c
+1)(L
c
+
2)(L
d
+ 1)(L
d
+ 2)/16 electron repulsion integrals. Note that
by dropping the canonical index subscript, it is implied that
the quartet generically treats all canonical indices. In other
words it is understood that all indices of the canonically or-
dered set of polynomials is treated in turn and their formulas
dier from the generic notation by inclusion of the canonical
index subscript, e.g.
N
i
(a) =
_

_
N
i
(a
1
)
N
i
(a
2
)
.
.
.
N
i
(a
N
a
)
_

_
(16)
This section concludes by tabulating various quantities
that will be used throughout the remainder of the manuscript.
4

ab
=
a
+
b
(17)

cd
=
c
+
d
(18)
=

ab

cd

ab
+
cd
(19)
R
ab
= R
a
R
b
(20)
R
cd
= R
c
R
d
(21)
R
p
=

a
R
a
+
b
R
b

ab
(22)
R
q
=

c
R
c
+
d
R
d

cd
(23)
R
pq
= R
p
R
q
(24)
R
wp
=

ab
R
pq
(25)
R
pa
= R
p
R
a
(26)
=

b
R
ab
+
d
R
cd

cd
(27)
T = |R
pq
|
2
(28)
K = e

a
b

ab
|R
ab
|
2

c
d

cd
|R
cd
|
2
(29)
B. Electron repulsion integrals
1. Summary of the algorithm
Having introduced a notation for referring to quartets of
electron repulsion integrals, the following is a brief descrip-
tion of evaluating the integrals. We begin from elementary op-
erations and work to reach the target class (ab|cd) and it will
be assumed that L
a
L
b
, L
c
L
d
and L
a
+ L
b
L
c
+ L
d
. In
the summary that follows, variable ranges are specied with
square brakets preceded by the symbol . The procedure is
summarized:
1. Form the auxiliary integrals [ss|ss]
(m)
for m [0, L
a
+
L
b
+ L
c
+ L
d
].
2. Use the vertical recurrence relationship (VRR) to form
all [xs|ss], where x [0, L
a
+ L
b
+ L
c
+ L
d
].
3. Transfer angular momentum from electron 1 to electron
2 (ET, electron-transfer step) to form all [xs|ys], where
x [L
a
, L
a
+ L
b
] and y [L
c
, L
c
+ L
d
]
4. Add the result (multiplied by the corresponding con-
traction coecients) to the contracted intermediate re-
sults (xs|ys) for all x [L
a
, L
a
+L
b
] and y [L
c
, L
c
+L
d
]
5. Apply the horizontal recurrence relation to form (ab|ys)
for all y [L
c
, L
c
+ L
d
]
6. Apply the horizontal recurrence relation again to form
(ab|cd)
2. Auxiliary integrals
The auxiliary integral is written
[ss|ss]
(m)
=
2K
5
2

ab

cd

ab
+
cd
F
m
(T) (30)
where
F
m
(T) =
_
1
0
x
2m
e
T x
2
dx. (31)
Closed form expressions of F
m
(T) are easily obtained from
the Mathematica program using the command
TableForm[
Table[
{m,Expand[
Integrate[
x(2 m) Exp[-T x2]
,{x,0,1} ]
]
}, {m,0,4}]
]
The expressions for the rst few values of m are
F
0
(T) =

erf(

T)
2

T
(32)
F
1
(T) = F
0
(T) (2T)
1
e
T
_
(2T)
1
_
(33)
F
2
(T) = F
0
(T) (2T)
2
e
T
_
(2T)
1
+ 3(2T)
2
_
(34)
F
3
(T) =F
0
(T) (2T)
3
e
T

_
(2T)
1
+ 5(2T)
2
+ (5 3)(2T)
3
_
(35)
F
4
(T) =F
0
(T) (2T)
4
e
T
_
(2T)
1
+ 7(2T)
2
+ (7 5)(2T)
3
+ (7 5 3)(2T)
4
_ (36)
By inspection, the general closed form expression is written
F
m
(T) =F
0
(T) (2T)
m
e
T
m

i=1
(2m 1)!!
(2m 2i + 1)!!
(2T)
i
;
(37)
however, faster computation is possible by performing a
power series expansion in T, i.e.,
F
m
(T) =e
T
_
e
T
F
m
(T)
_
=e
T
_

i=0
(2m 1)!!(2T)
i
(2m + 2i + 1)!!
_

_
.
(38)
The denominator in Eq. (38) increases rapidly with respect to i
and all terms in the sum are positive, therefore, the summation
is terminated when additional terms would negligibly change
the result of the sum. The following Mathematica command
tabulates the rst 5 terms in the above expansion for m [0, 5]
5
Table[
Series[
Exp[T] * Integrate[x(2 m) Exp[-T x2],
{x,0,1} ],
{T,0,4}],
{m,0,5}]
Computation of F
m
(T) can further be improved by em-
ploying the recurrence
F
m
(T) =
2TF
m+1
(T) + e
T
2m + 1
. (39)
In summary, the procedure for computing auxiliary inte-
grals is
1. Compute T [Eq. (29)].
2. Evaluate F
m
max
(T) using Eq. (38) under some conver-
gence tolerance.
3. Compute F
m
(T) for m [0, m
max
1] using Eq. (39).
4. Perform the multiplications in Eq. (30).
Other ecient algorithms for evaluating F
m
(T) exist and
are described elsewhere
35
. The evaluation of (ab|cd) requires
m
max
= L
a
+ L
b
+ L
c
+ L
d
. When m = 0, [ss|ss]
(0)
is a true
electron repulsion integral and the superscript is dropped, e.g
[ss|ss]
(0)
= [ss|ss]. The auxiliary integrals are needed, how-
ever, to increase the angular momentum using the VRR.
3. Vertical recurrence relation
The auxiliary [ss|ss]
(m)
integrals are used to initiate the
process of increasing the angular momentum on the rst in-
dex, via the VRR
[(x + 1
i
)s|ss]
(m)
=R
pa,i
[xs|ss]
(m)
+ R
wp,i
[xs|ss]
(m+1)
+
N
i
(x)
2
ab
_
[(x 1
i
)s|ss]
(m)

ab
[(x 1
i
)s|ss]
(m+1)
_
.
(40)
As an explicit example, consider the evaluation of [p
1
s|ss]
(0)
and [d
1
s|ss]
(0)
:
[p
1
s|ss]
(0)
= R
pa,1
[ss|ss]
(0)
+ R
wp,1
[ss|ss]
(1)
(41)
[d
1
s|ss]
(0)
=R
pa,1
[p
1
s|ss]
(0)
+ R
wp,1
[p
1
s|ss]
(1)
+
2
2
ab
_
[ss|ss]
(0)

ab
[ss|ss]
(1)
_
.
(42)
In both cases, 1
i
= 1
1
because
p
1
= (1, 0, 0) = (0, 0, 0) + (1, 0, 0) = s + 1
1
(43)
d
1
= (2, 0, 0) = (1, 0, 0) + (1, 0, 0) = p
1
+ 1
1
. (44)
The reason why all [ss|ss]
(0)
, [ss|ss]
(1)
, [ss|ss]
(L
a
+L
b
+L
c
+L
d
)
integrals where required was because the construction of all
[ps|ss]
(0)
, [ps|ss]
(1)
, [ps|ss]
(L
a
+L
b
+L
c
+L
d
1)
is a prerequi-
site to further incrementation of angular momentum. In
other words, the number of required auxiliary integrals
decreases as the angular momentum is incremented. The
process of increasing the angular momentum and decreasing
the number of required auxiliary integrals continues until
[(a + b + c + d)s|ss]
(0)
is reached. At the terminal class, no
auxiliary integrals need be generated. Once the process is
terminated at [(a + b + c + d)s|ss]
(0)
, all previously generated
auxiliary classes (m > 0) can be discarded as they are not
used in the remainder of the algorithm.
As an example, Table I shows the integral classes that
need to be computed, in the order in which they are computed,
and which results need to be stored to satisfy the dependencies
of the remaining steps in the algorithm.
TABLE I. The VRR step carried out in the calculation of (pp|pp).
The array columns and rows run over classes of [xs|ss]
(m)
. The nu-
merical entries are the order in which the class is computed. Entries
marked with an asterisk are classes which must be retained for the
ET step. Note that the rst row is the auxiliary integral step.
m (0) (1) (2) (3) (4)
s 1

2 3 4 5
p 6

7 8 9
d 10

11 12
f 13

14
g 15

4. Electron (angular momentum) transfer relation


The transferring of angular momentum from electron 1 to
electron 2 is achieved from the relation
[xs|(y + 1
i
)s] =
i
[xs|ys]

ab

cd
[(x + 1
i
)s|ys]
+
N
i
(x)
2
cd
[(x 1
i
)s|ys]
+
N
i
(y)
2
cd
[xs|(y 1
i
)s].
(45)
In order to reach the target [(a + b)s|(c + d)s] using the above
recursion relation, one must generate the intermediate results:
6
[ps|ps], [ds|ps], [f s|ps], , [(L
a
+ L
b
+ L
c
+ L
d
1)s|ps]
[ds|ds], [f s|ds], , [(L
a
+ L
b
+ L
c
+ L
d
2)s|ds]
[f s|f s], , [(L
a
+ L
b
+ L
c
+ L
d
3)s|f s]
.
.
.
[(a + b)s|(c + d)s]
Although all the intermediate quantities are required to satisfy
higher-order ET angular momentum transfers, not all are re-
quired to be stored in order to perform the HRR step(s). All
intermediates whose rst index is in the range
8
[L
a
, L
a
+ L
b
]
and whose third index is in the range [L
c
, L
c
+ L
d
] are needed
to preform the HRR. One can visualize the intermediates re-
quired for storage as a rectangular block of a matrix whose
rows represent bras ([xs|) and whose columns represent kets
(|ys]). If L
c
+ L
d
> L
a
, then the there are additional inter-
mediates that are required to perform the HRR step(s) which
are not encountered in the pattern described above, because
the pattern described above runs over the lower-half (includ-
ing diagonal) of the braket matrix of intermediates. In other
words, if L
c
+ L
d
> L
a
, then the rectangular block of required
HRR intermediates lies, in part, in the upper diagonal. [pp|pp]
is one such class (L
c
+L
d
> L
a
) and the ET step is described in
Table II. Note that [ps|ps], [ds|ps], and [ds|ds], and [ps|ds]
are required. In order to compute [ps|ds], one must either cre-
ate routines to treat cases where L
x
< L
y
, or swap indices a
and b with c and d and reuse a set of routines written for the
case L
x
L
y
to determine the missing intermediates.
TABLE II. The ET step carried out in the calculation of (pp|pp). The
array columns and rows run over classes of [xs|ys]. The numerical
entries are the order in which the class is computed. Entries marked
with an asterisk are classes which must be retained for the HRR step.
Italicized values result from re-performing the auxiliary and VRR
steps whilst swapping the 2 sets of Gaussian functions.
|ps] |ds]
[ps| 1

[ds| 2

[f s| 3
Upon calculation of the lower diagonal, HSERILib com-
putes the missing upper diagonal of the braket intermedi-
ate matrix. During this process, it reaches the nal target
[(a

+b

)s|(c

+d

)s] where L
a
= L
c
+L
d
L
b
+1, L
b
= L
b
1,
L
c
= L
a
, and L
d
= L
c
+ L
d
L
a
1. All intermediates in
the ranges [L
a
, L
a
+ L
b
] and [L
c
, L
c
+ L
d
] are stored and
the indices are back-transposed. Using the (pp|pp) exam-
ple, this upper-diagonal-procedure works to reach the target
[ds|ps] and it is the only intermediate which falls in the de-
sired ranges. It is then back-transposed to [ps|ds], which is
the italicized entry in Table II.
5. Contraction
The auxiliary, VRR, and ET steps are performed in the
4-index contraction loop. All required intermediate primitive
targets resulting from the ET step are computed, multiplied
by the contraction coecients, and added to the contracted
intermediate result.
(Xs|Ys) = 0.0_SP
DO a=1,Na
DO b=1,Nb
DO c=1,Nc
DO d=1,Nd
! Generate [ss|ss]{m}
! Generate [(X+Y)s|ss]
! Generate [Xs|Ys] intermediates
(Xs|Ys) = (Xs|Ys) + &
& Ca(a)*Cb(b)*Cc(c)*Cd(d) * [Xs|Ys]
END DO
END DO
END DO
END DO
! Perform HRR steps
6. Horizontal recurrence relation
The HRR transfers angular momentum between 2 Gaus-
sians of the same electron and is written
(w(x + 1
i
)|ys) = ((w + 1
i
)x|ys) + R
ab,i
(wx|ys) (46)
and
(wx|y(z + 1
i
)) = (wx|(y + 1
i
)z) + R
cd,i
(wx|yz). (47)
The FLOP count can be minimized by choosing the order of
operation to reduce the size of the intermediates; however,
HSERILib currently chooses a consistent order of operation to
ease programming. For a discussion on optimizing FLOP and
MOP (memory operations) and performance comparisons, see
Ref. 6 and references therein. The HRR order of operation for
the rst electron is (where we again assume L
a
L
b
, L
c
L
d
,
and L
a
+ L
b
L
c
+ L
d
)
7
(L
a
p|L
c
s) ((L
a
+ 1)p|L
c
s) ((L
a
+ 2)p|L
c
s) ((L
a
+ L
b
1)p|L
c
s)
(L
a
d|L
c
s) ((L
a
+ 1)d|L
c
s) ((L
a
+ L
b
2)d|L
c
s)
.
.
.
.
.
.
(L
a
L
b
|L
c
s)

(L
a
p|(L
c
+ 1)s) ((L
a
+ 1)p|(L
c
+ 1)s) ((L
a
+ 2)p|(L
c
+ 1)s) ((L
a
+ L
b
1)p|(L
c
+ 1)s)
(L
a
d|(L
c
+ 1)s) ((L
a
+ 1)d|(L
c
+ 1)s) ((L
a
+ L
b
2)d|(L
c
+ 1)s)
.
.
.
.
.
.
(L
a
L
b
|(L
c
+ 1)s)

.
.
.
.
.
.
(L
a
p|(L
c
+ L
d
)s) ((L
a
+ 1)p|(L
c
+ L
d
)s) ((L
a
+ 2)p|(L
c
+ L
d
)s) ((L
a
+ L
b
1)p|(L
c
+ L
d
)s)
(L
a
d|(L
c
+ L
d
)s) ((L
a
+ 1)d|(L
c
+ L
d
)s) ((L
a
+ L
b
2)d|(L
c
+ L
d
)s)
.
.
.
.
.
.
(L
a
L
b
|(L
c
+ L
d
)s)

In the above scheme, the order of operation moves left to right across each row, temporarily storing the entire row such that
the next row can be computed (upon calculation of the next row, the previous row is no longer needed). Those entries marked
with an asterisk are classes which need to be stored in order to fulll the remaining steps of the algorithm. In other words, every
(L
a
L
b
|xs) for which x [L
c
, L
c
+ L
d
] is a required intermediate in the HRR of the second electron. The order of operation for
the second electron is
(ab|L
c
p) (ab|(L
c
+ 1)p) (ab|(L
c
+ 2)p) (ab|(L
c
+ L
d
1)p)
(ab|L
c
d) (ab|(L
c
+ 1)d) (ab|(L
c
+ L
d
2)d)
.
.
.
.
.
.
(ab|L
c
L
d
)
Each of the above rows is an intermediate used for the
following row, where the intermediates saved from the HRR
of the rst electron are the intermediates required for the rst
row. Once (ab|cd) is obtained, a transformation from Carte-
sian to solid harmonic Gaussians can be applied. It is possi-
ble to perform the Cartesian-to-solid harmonic transformation
earlier; however, this is not how HSERILib is currently writ-
ten.
C. The 1-electron integrals
1. Electrostatic potential integrals
The electrostatic potential integrals [Eq. (6)] follow a pro-
cedure that is analogous to the ERI algorithm. The main dif-
ference occurs in the evaluation of the auxiliary integrals, the
reduction of a 4-index contraction to a 2-index contraction,
and the omission of the electron (angular momentum) transfer
step. If one redenes

=
ab
, i.e., /
ab
1 (48)
R

wp
= R
c
R
p
(49)
T

=
ab
|R

wp
|
2
(50)
[ss|ss]
(m)
=
2

ab
e

a
b

ab
|R
ab
|
2
F
m
(T

), (51)
then one can reuse the ERI routines without further modi-
cation. In other words, one would proceed as if the target
integral was (ab|ss).
2. Overlap and moment integrals
The overlap, kinetic energy, and multipole moment in-
tegrals are all related to the calculation of overlap integrals.
These three integrals are separable into x, y, and z compo-
nents, e.g.,
[a
(l
a
,m
a
,n
a
)
|c
(l
c
,m
c
,n
c
)
|b
(l
b
,m
b
,n
b
)
] =
_

ab
_ 3
2
e

a
b

ab
|R
ab
|
2

_
x
S
l
c
l
a
,l
b
_ _
y
S
m
c
m
a
,m
b
_ _
z
S
n
c
n
a
,n
b
_
(52)
8
where l
a
, m
a
, and n
a
are the integer exponents of Cartesian
Gaussian as polynomial. The indices subscripted with b are
for the second Gaussian function and those subscripted with
c refer to a Cartesian polynomial (not a Cartesian Gaussian).
When L
c
= 0, the above equation reduces to a simple over-
lap matrix. In other words, overlap integrals are special cases
of moment integrals. The lhs of Eq. (52) is a scalar quantity
for the specic combination of these 3 polynomials. The sub-
script (l
a
, m
a
, n
a
) is a particular ordered set of exponents in
the canonical order. It is written in scalar form instead of the
quartet-like notation used in the previous section because the
separation of the integral into a product of x, y, and z compo-
nents amends itself better to the polynomial description than
the canonical-index notation.
The overlap VRR is written
_
i
S
0
(a+1),0
_
= R
pa,i
_
i
S
0
a,0
_
+
a
2
ab
_
i
S
0
(a1),0
_
(53)
where the recursion starts from
_
i
S
0
0,0
_
= 1. (54)
Angular momentum can be shifted between the 2 Gaussians
using the overlap HRR,
_
i
S
c
a,(b+1)
_
= R
ab,i
_
i
S
c
a,b
_

_
i
S
c
(a+1),b
_
(55)
and a similar HRR exists for transferring angular momentum
to a 3rd center (which is not a Gaussian function)
_
i
S
(c+1)
a,b
_
=
_
i
S
c
(a+1),b
_
+ R
ac,i
_
i
S
c
a,b
_
(56)
The description of the moment integral algorithm follows.
1. Generate
_
i
S
0
x,0
_
, for all x [0, L
a
+L
b
+L
c
] and i [1, 3]
2. Transfer angular momentum to yield
_
i
S
z
x,0
_
for all i
[1, 3], x [0, L
a
+ L
b
+ L
c
z], and z [1, L
c
].
3. Perform the HRR resulting in
_
i
S
z
x,y
_
for all i [1, 3],
x [0, L
a
+ L
b
y], y [1, L
b
], and z [0, L
c
].
4. Perform the product in Eq. (52) for each combination
of polynomials in a, b, and c.
This algorithm is performed for each combination of primitive
functions and the contracted result is simply the contraction-
product weighted sum of the primitive results.
3. Kinetic energy integrals
The kinetic energy integrals are written

1
2
[a
(l
a
,m
a
,n
a
)
|
2
|b
(l
b
,m
b
,n
b
)
] =
1
2
_

ab
_ 3
2
e

a
b

ab
|R
ab
|
2
__
x
D
2
l
a
,l
b
_ _
y
S
0
m
a
,m
b
_ _
z
S
0
n
a
,n
b
_
+
_
x
S
0
l
a
,l
b
_ _
y
D
2
m
a
,m
b
_ _
z
S
0
n
a
,n
b
_
+
_
x
S
0
l
a
,l
b
_ _
y
S
0
m
a
,m
b
_ _
z
D
2
n
a
,n
b
__
(57)
where
_
i
D
2
a,b
_
= 4
2
a
_
i
S
0
(a+2),b
_
2
a
(2a + 1)
_
i
S
0
a,b
_
+ a(a 1)
_
i
S
0
(a2),b
_
. (58)
The procedure for computing the kinetic energy integrals is
Generate
_
i
S
0
x,0
_
, for all x [0, L
a
+L
b
+2] and i [1, 3]
Perform the HRR to yield
_
i
S
0
x,y
_
for all i [1, 3], x
[0, L
a
+ L
b
y], y [1, L
b
].
Perform the product in Eq. (57) for each combination
of polynomials in a and b [Eq. (58) depends explicitly
on the polynomial a and is, therefore, computed within
the loops over polynomials.]
Note that one necessarily computes the overlap integrals when
computing the kinetic energy integrals. Therefore, HSERILib
returns both quantities simultaneously.
A. THE GAMMA FUNCTION, DOUBLE FACTORIAL, AND BI-
NOMIAL COEFFICIENT
The double factorial is a factorial running over alternating
integers, i.e.,
n!! =
_

_
1 3 5 (n 2) n, if n is odd
1 2 4 (n 2) n, if n is even
1, if n = 0 or n = 1
(59)
and is related to the Gamma function through the relation

_
n +
1
2
_
= (2n 1)!!

2
n
. (60)
9
The double factorial is related to the factorial by
(2n 1)!! =
(2n)!
2
n
n!
. (61)
For completeness, note the relations
(2n + 1)!! = (2n 1)!!(2n + 1) (62)
and

_
n +
3
2
_
=
_
(n + 1) +
1
2
_
=(2n + 1)!!

2
n+1
=(2n 1)!!
(2n + 1)

2
n+1
,
(63)
which will arise in the calculation of normalization constants.
The binomial coecient is written
_
n
k
_
=
n!
(n k)!k!
(64)
and is encountered in the calculation of the Cartesian
polynomial-to-spherical harmonic transformation coe-
cients.
B. REAL SPHERICAL HARMONICS
The real spherical harmonics Y
l,
() are related to the
complex spherical harmonics Y
l,m
() by
Y
l,
() =
_

_
Y
l,m
(), if = 0

2(1)
m
Re
_
Y
i
l,m
()
_
if > 0

2(1)
|m|
Im
_
Y
i
l,|m|
()
_
if < 0,
(65)
where Re
_
f (x)
_
and Im
_
f (x)
_
are the real and imaginary com-
ponents of f (x) (the result of either operation is a real quan-
tity). Both the real and imaginary spherical harmonics obey
the L2normalization condition
_
Y
l,m
()Y
l

,m
()d =
l,l

m,m
, (66)
and all spherical harmonics written Y
l,m
() will be assumed
throughout this manuscript to be real unless specically noted
otherwise.
The real spherical harmonics can be computed eciently
from direction cosines, i.e., x, y, z, by rst computing the the
scaled regular solid harmonics R
l,m
( r) and then multiplying
by a constant. This is explained in my solid harmonic notes,
available at theory.chem.umn.edu/giese/notes.html.
C. CARTESIAN GAUSSIAN FUNCTIONS
A Cartesian Gaussian of angular momentum L = l +m+n
is generally written

i
(r) = N
LX
lmn
(x X
i
)
l
i
(y Y
i
)
m
i
(z Z
i
)
n
i
e

i
|rR|
2
(67)
where the normalization constant N
LX
lmn
depends on the type of
normalization. This appendix derives the normalization con-
stant used for L0, L1, and L2normalization conventions.
In Appendix F, it will be convenient to decompose N
LX
lmn
into
the product
N
LX
lmn
= N
LX
,lmn
N
LX
,lmn
, (68)
where N
LX
,lmn
depends on the exponent of the Gaussian and
total angular momentum and N
LX
,lmn
does not depend on the
exponent, but contains angular factors.
The un-normalized (L0normalized) Cartesian Gaussian
is trivially recovered when
N
L0
lmn
= 1 (69)
N
L0
,lmn
= 1 (70)
N
L0
,lmn
= 1. (71)
The dening property of L1normalization is reproduc-
tion of electrostatic moments. A L1normalized Cartesian
Gaussian has unit Cartesian moment, i.e.,
_
_
x
l
y
m
z
n
_ _
N
L1
lmn
x
l
y
m
z
n
e

i
(x
2
+y
2
+z
2
)
_
d
3
r = 1. (72)
Therefore,
N
L1
lmn
=
__
_
x
l
y
m
z
n
_ _
x
l
y
m
z
n
e

i
(x
2
+y
2
+z
2
)
_
d
3
r
_
1
. (73)
This 3-dimensional integral is separable into a product of 3
1-dimensional integrals, whose solutions are (shown for the
x-case)
_
x
2l
e

i
x
2
dx =
(l+
1
2
)
i
(l +
1
2
)
=
(2l 1)!!
(2
i
)
l
_

i
.
(74)
The resulting L1normalization constant is
N
L1
lmn
=
_

_ 3
2
(2
i
)
L
(2l 1)!!(2m 1)!!(2n 1)!!
. (75)
The decomposition into N
L1
,lmn
and N
L1
,lmn
is
N
L1
,lmn
=
_

_
3
2
(2
i
)
L
(76)
N
L1
,lmn
=
1
(2l 1)!!(2m 1)!!(2n 1)!!
(77)
The L2normalization constant is chosen such that the
self-overlap is unity, i.e.,
_
_
N
L2
lmn
x
l
y
m
z
n
e

i
(x
2
+y
2
+z
2
)
_
2
d
3
r = 1. (78)
Therefore,
N
L2
lmn
=
__
_
x
l
y
m
z
n
e

i
(x
2
+y
2
+z
2
)
_
2
d
3
r
_

1
2
. (79)
10
This integral is separable, each of the form (shown for the x-
case)
_
x
2l
e
2
i
x
2
dx = (2
i
)
(l+
1
2
)

_
l +
1
2
_
=

2
l
(2
i
)
(l+
1
2
)
(2l 1)!!
. (80)
The resulting L2normalization constant is written
N
L2
lmn
=
_
2
i

_ 3
4
(4
i
)
L
2

(2l 1)!!(2m 1)!!(2n 1)!!


(81)
and decomposes into
N
L2
,lmn
=
_
2
i

_ 3
4
(4
i
)
L
2
(82)
N
L2
,lmn
=
1

(2l 1)!!(2m 1)!!(2n 1)!!


. (83)
D. SOLID HARMONIC GAUSSIAN FUNCTIONS
The solid harmonic Gaussian function is written

i
(r) = N
LX
Lm
r
L
e

i
|r|
2
Y
Lm
(). (84)
As was done for Cartesian Gaussian functions, this section
derives the normalization constant N
LX
Lm
for L0, L1, and
L2normalization. As was done in Appendix C, the normal-
ization constants are decomposed according to Eq. (68).
The L0normalization, using the above dened Gaussian
is
N
L0
Lm
=
_
4
2L + 1
(85)
N
L0
,Lm
=
_
4
2L + 1
(86)
N
L0
,Lm
= 1. (87)
N
L0
Lm
cancels the spherical harmonic prefactor absorbed into
the symbol Y
Lm
() above.
The L1normalization is chosen to yield unit multipole
moment, i.e.,
_
_

_
_
4
2L + 1
r
L
Y
Lm
()
_

_
N
L1
Lm
r
L
e

i
|r|
2
Y
Lm
()
_
d
3
r = 1.
(88)
By orthonormality of the real spherical harmonics, the 3-
dimensional integral reduces to a radial integral, allowing one
to write
N
L1
Lm
=
_

_
_
4
2L + 1
_

0
r
2L
e

i
|r|
2
r
2
dr
_

_
1
=

2L + 1
L+
3
2
i

_
L +
3
2
_
=
2
L+1

L+
3
2
i

2L + 1(2L 1)!!
=
_
4
2L + 1
_

_
3
2
(2
i
)
L
(2L 1)!!
,
(89)
which decomposes into
N
L1
,Lm
=
_
4
2L + 1
_

_
3
2
(2
i
)
L
(90)
N
L1
,Lm
=
1
(2L 1)!!
. (91)
The L2normalization constant is chosen to yield unit
self-overlap,
_
_
N
L2
Lm
r
L
e

i
|r|
2
Y
Lm
()
_
2
d
3
r = 1. (92)
Upon integrating over and employing the normality of the
spherical harmonics, one nds
N
L2
Lm
=
__

0
r
2L
e
2
i
|r|
2
r
2
dr
_

1
2
=
__

_
L +
3
2
__

(L+
3
2
)
i
2
(L+
5
2
)
_

1
2
=
_

_
_
(2L + 1)!!
2
L+1
_
(2
i
)
L
4
_
2
3
i
_

1
2
=
_

_
1
8
_

2
3
i
(2L + 1)!!
(4
i
)
L
_

1
2
=
_
1
4
_

(2
i
)
3
(2L + 1)!!
(4
i
)
L
_

1
2
=
_

_
1
4
_

2
i
_ 3
2
(2L + 1)!!
(4
i
)
L
_

1
2
=
_

_
2L + 1
4
_

2
i
_ 3
2
(2L 1)!!
(4
i
)
L
_

1
2
=
_
4
2L + 1
_
2
i

_ 3
4
(4
i
)
L
2

(2L 1)!!
,
(93)
and is decomposed into
N
L2
,Lm
=
_
4
2L + 1
_
2
i

_ 3
4
(4
i
)
L
2
(94)
N
L2
,Lm
=
1

(2L 1)!!
. (95)
11
E. CARTESIAN-TO-SOLID HARMONIC TRANSFORMATION
Integrals over Cartesian moments can be transformed
to solid harmonic multipole moments using the linear
transformation
7
_
4
2L + 1
r
L
Y
LM
( r) =

lmn
c
LM
lmn
x
l
y
m
z
n
, (96)
where the summation runs over the canonical indices of the
shell L = l + m + n and c
LM
lmn
are projection coecients whose
form depend on the sign of M.
c
LM
lmn
=
_

L0
lmn
, if M = 0

LM
lmn
, if M > 0

L|M|
lmn
, if M < 0
(97)
The calculation of each of these forms are listed below.
Note that the forms listed here are opposite those listed in
Ref. 7, i.e., the M < 0 case listed here is the M > 0 case
listed in Ref. 7.

L0
lmn
=
int(L/2)

t=0
t

u=0

(1)
t
_
L t
t
__
L
t
__
t
u
_ _
1
2
_
2t
(98)
where

=
_

_
0, if 2t 2u l
0, if 2u m
0, if L 2t n
1, otherwise
. (99)
For the case M > 0,

LM
lmn
=
int((LM)/2)

t=0
t

u=0
int((M1)/2)

s=0

(1)
t+s

2(L + M)!(L M)!


L!

_
t
u
__
M
2s + 1
__
L t
M + t
__
L
t
_ _
1
2
_
M+2t
(100)
where

=
_

_
0, if M 2t 2u 2s 1 l
0, if 2u + 2s + 1 m
0, if L M 2t n
1, otherwise
. (101)
Finally, for the case M < 0,

L|M|
lmn
=
int((L|M|)/2)

t=0
t

u=0
int(|M|/2)

s=0

(1)
t+s

2(L + |M|)!(L |M|)!


L!

_
t
u
__
|M|
2s
__
L t
|M| + t
__
L
t
_ _
1
2
_
|M|+2t
(102)
where

=
_

_
0, if |M| 2t 2u 2s l
0, if 2u + 2s m
0, if L |M| 2t n
1, otherwise
. (103)
F. CARTESIAN GAUSSIAN-TO-SOLID HARMONIC GAUSSIAN
TRANSFORMATION
The transformation fromCartesian Gaussians to solid har-
monic Gaussians follows directly from the transformation de-
scribed in the previous section. Rearranging Eq. (96) yields,
r
L
Y
LM
() =

lmn
_
2L + 1
4
c
LM
lmn
x
l
y
m
z
n
(104)
N
LX
LM
r
L
Y
LM
()e

i
r
2
=

lmn
_
2L + 1
4
c
LM
lmn
N
LX
LM
_
x
l
y
m
z
n
e

i
r
2
_
(105)
N
LX
LM
r
L
e

i
r
2
Y
LM
() =

lmn
c
LM
lmn

_
N
LX
LM
N
LX
lmn
_
2L + 1
4
_

_
N
LX
lmn
x
l
y
m
z
n
e

i
r
2
_
.
(106)
Eq. (105) transforms an unnormalized Cartesian Gaussian
function to a normalized solid harmonic Gaussian, whereas
Eq. (106) transforms a normalized Cartesian Gaussian to a
normalized solid harmonic Gaussian.
Upon inserting the normalization constants for each nor-
malization convention, one nds
N
L0
LM
N
L0
lmn
_
2L + 1
4
= 1, (107)
N
L1
LM
N
L1
lmn
_
2L + 1
4
=
(2l 1)!!(2m 1)!!(2n 1)!!
(2L 1)!!
, (108)
and
N
L2
LM
N
L2
lmn
_
2L + 1
4
=
_
(2l 1)!!(2m 1)!!(2n 1)!!
(2L 1)!!
. (109)
Alternatively, if the Cartesian function is not fully nor-
12
malized, i.e., it has only been normalized with N
LX
,lmn
, then
N
LX
LM
r
L
e

i
r
2
Y
LM
() =

lmn
c
LM
lmn
N
LX
,LM
N
LX
,LM
N
LX
,lmn

_
2L + 1
4

_
N
LX
,lmn
x
l
y
m
z
n
e

i
r
2
_
=

lmn
c
LM
lmn
N
LX
,LM

_
N
LX
,lmn
x
l
y
m
z
n
e

i
r
2
_
(110)
where we have used the identity
N
LX
,LM
N
LX
,lmn
_
2L + 1
4
= 1. (111)
Eq. (110) is the working equation in HSERILib. The modules
L0TransMod, L1TransMod, and L2TransMod, contain the
coecients
_
c
LM
lmn
N
LX
,LM
_
and are normally accessed through
TransformMod.
1
T. P. Hamilton and H. F. Schaefer III, Chem. Phys. 150, 163 (1991).
2
S. Obara and A. Saika, J. Chem. Phys. 84, 3963 (1986).
3
T. Helgaker, P. Jrgensen, and J. Olsen, Molecular electronic-
structure theory (John Wiley &Sons, Hoboken, NewJersey, 2000).
4
H. Takashima, T. Amisaki, K. Kitamura, and U. Nagashima, Com-
put. Phys. Commun. 148, 182 (2002).
5
S. Yahiro and Y. Gondo, J. Comput. Chem. 13, 12 (1992).
6
M. Makowski, Int. J. Quantum Chem. 107, 30 (2006).
7
K. Ishida, J. Chem. Phys. 109, 881 (1998).
8
The square brackets represent ranges, not primitive classes

Das könnte Ihnen auch gefallen