CHEMICAL
Volume 35, numb& 4
EFFICIENT GENERATION Ross W. WETMORE
W
and Gerak
CONFIGUFUTION
LETTERS
INTERACTION
1 December 1975
MATRLX ELEMENTS
Ai SEGAL
Depar:ment of CGemirtry. Utliuersity of Southfm LAX Angeles,. Califomia 90007, USA
Received
PHYSlCS
Califorhia,
12 August 197.5
A method for the efficient generation of CI marris elements over spin eigenfunctions is presented. Practical application of the approach is iinited to configurations with about 10 open shells, but the algorithm results in the generation of more than 2200 mntris elementslsecond on nn Il3hi 370/158 computer including all overhead for a large matrix which contains 50% non-zero elements.
1. Introduction In carrying out any large scale configuraticn interaction calculation (CT), one of the most time consuming steps involves the evaluation of the hamiltonian matiix over the basis of anti-symmetrized functions included in the calculat!on. Since it is usually more convenient to use 3 basis set of particular spin sym. metry, the general basis functions, built for example from the MO’s i@] of a preceding SCF calculaiion and spin functions (CX,a), are most easily expressed as linear combinations of Slater determinants. These determinants {Aij are related one to another by permutations of the spin functions among the various singly occupied ivlO’s. If o indexes a linear combination of arrangements of open shell spin corresponding to a particular eigenfunction of 3’ and IV a corresponding vector of integers giving the occupations of the one electron functions (MO’s), then XI eigenfunction of s2 with total spin S and z-component m, may be denoted as: IS, msr W, )U > ~ C=j i
(S, ms. W) Ai(nz,,
w)_
(1)
In this basis the matrix element of any spin independent hamiltonian will depend so!e!y on the spin eigenfunction w and spatial occupation w.
The spin eigenfunctions of eq. (1) can be obtained by standard methods. The fund;imental problem lies in efficiently evaluating the matrix elements of (2). To evzIuate such expressions determinant by determinant is slow and involves much repetitive labour. After all, in the fina! analysis the matrix element is simply a weighted sum of one and two electron integrals ok-er the individual spatial MO’s_ The weighting coefficients are solely a function of the known pair of spin functions o, o’ and space occupations tv, IV’, so the most efficient method should be one which handles these weights directly. This has been accomplished by a number of workers, and general solukions of this approach now exist. Notable among these are the results of S&non and Ruedenberg [ 1] , of Cooper and IJcWeeny [2], znd, more recently, of Paldus [3,4]. All provide exp!icit formulae for the matrix elements of (2), but all require some computational labour to evaluate the coefficients and become relatively time consuming when used in large scaIe calculations. Once recognition is made of which integrals will contribute to 3 given matrix eiement - a problem much simplified when use is made of the results of a preceding SCF calculation - +_hey need only be multiplied by an appropriate precalculated weight rind collected as a sum. That these weights may be precalculated independently of the entire CI calculation, and that, for most practical purposes, their storage 2s a computer program library presents no undue cliffculty, is the subject of this note. Although the meth-
Volume
36, numbsr 4
CHEMICAL
PHYSICS
od is rendered impractical by large numbers of open. shells, ir is readily applicable to cases ranging up to 10 unpaired electrons. Most importantly, in the compact scheme presented below, a significant increase is found in computational efficiency mented meALhods.
over currently
1 December 1975
LETTERS
i~~,Ef:].=6,,5~-6..5$,
(6b)
[ii’, ii] = 0.
(6c)
In this form the hamiltonian becomes
imple-
and operators
[$] for spin 5?2,&, are
2. Theory
(8)
In second quantization notation, any operator despin fined on a single particle basis of orthonormal orbit& may be expressed in terms of the creation and annihilation operators (a;i5, aiT) where for convenience latin letters denote indices of the spatial MO’s and spin functions (cr,p)_ greek letters the corresponding These operators obey the usual anti-commutation relations. @a)
L&Y Qj.,]+ = %j$,Y [&,
@TTl+ = PjO, Qj,l+
= 0.
(3b)
Within this representation the occupation vectors w assume the simple form of an ordered set of integers {w;,} which may be either zero or one depending on whether the spin orbital is occupied or not. In these terms the spin independent hamiltonian may be written:
sz=; (;,“-$).
(9)
Since, as may quickly be shown from (6), (S)_and (9): the operators El! commute with 52, S=, both E; and
the hamiltonian conserve spin states as desired. The formalism automatically inciudes Fermi statistics throu,+ the anti-commutation relations, eq. (3). In this form the occupation vectors w refer to individual MO’s rather than to spin orbit&, thus the allowed occupation elements are 0, 1 and 2. When associated
with particular linear combinations
of the various pos-
sible permutations of spin amongst the open shells, the functions low) form the complete antisymmctrized basis states for the calculation. However in order that the phrase “linear combination of permutations” has meaning, a specific canonical ordering of the MO’s must be chosen and adhered to. It is important to note that within this formalism the action of operators f?: on eigenfunctions of S2and s, may only produce results of the same spin state. In all derivations which follow these results are implied and for clarity explicit notation to this effect has been
where
dropped. _ _ When E{ acts on a state Iwrv) it produces a new OCcupation vector, W’ which differs from \ir by a single hole-particle exlitation from $ to Qi. Since, in general, a number of poss’ible spin states of given (sl) are
It is convenient for what follows to define two new operators I!?{and gz which formally act only on the space or spin coordinates of a function.
overall result must, without loss of generahty, be expressible as a linear combination of these states. If the
allowed for any particular spatial occupation,
(5) Using (3) these may be shown tion relations
to obey the commutaCW
the
coefficients of such a combination are denoted 17,where v depends explicitly on the initial and final total functions g = 77(w, IV, w’, IV’), then: q
iWlV> =
,& w’
(cd’,IV’,w, w) Iw’IV’),
(10)
where the sum over w’ is a sum over the possible spin states for the given open shell case. As an example, for 479
Volume 36, number 4
CHEMICALPHYSICS
LETTERS
1
December 1975
:
a &g.let ivith (0,2,4 or 6) open shells there would be (1,1,2 or 5) such functions in the sum. The diagonal oprator .!$ has a particularly simple and, asmay be shown from the anti-commutation relations (31, is no more than the occupation number operator wi for the ith MO. Furthermore, in generating the expectation value of _!?lbetween any -i- IS Ei ‘i and two states, the hermitean conjugate ofi Ej one need only generate terms for i >i (raisir?.g operator) or i
&fJWI,+: =
‘1
(c2W”) = (+.&v,)+
(EL IO”W”))
(IY’,w, IV) - 11 (w’, cd”, w”).
(11)
T& use of eq. (1 I), with the treatment of two eiectron terms as an inner product, is clearly an effective way to handle the large number of two electron terms, since the reduction of a 4 index problem to two problems in 2 indice.; results in a considerable savings in space and Iabour. At this point it should be quite clear that the coefficients q in the linear conibination of eq. (IO) are no illore than the one electron matrix e!ement weighting factors we desire, and that they may be used in the conceptualIy simple form of a dot product to pro. Guct their two electron counterparts. It should also ‘be clear that there is no fundamentai difficuity in evaluating them 3nce and for all, independently of the actual CI calcuiation (as a pract&I matter they may be gen_erated by any standard CI computer program by setling all one electron integrals to unity and all two electron integrals to zero). In the next section we show how these coefficients may be used in the act&l matrix expressions before returning to the ciiscussion of techniques to reduce their number still fur-
ther and to facilitate referencing the individual elemerits...
3. Matrk ~xpressioas If,the h~iltonian ‘. ,480,._
(7) is written in terms of a ogle
electron Fock operator and the SCF energy for a particular parent configuration, any arbitrary matrix element may be expressed through its differences from “he SCF result. Letting \vi be the occupation number of the ith MO in-the parent con~~uration, the Fock operator, SCF base energy and hamihonian become: Fij = hfi + T
(Vfjkk
ESCF = cF,,iG,
- + ViJ+j)“k
5
(12)
(13)
- $ ~(Viii~-~~Vji,)~,~~,
Although eq. (14) may appear clumsy at first, Terms for the 3 possible cases of non-zero matrix elements (diagonal, one electron difference, two electron difference) may be read off by jnspection. If rv~_is taken to denote the occupation number of the Bh MO in the occupation vector W, where tv references the spatial part of the wa\rFfunction [WIV),then the esplicit expressions are: Case 1, diagonal H,,, : H,,,z = iwtv IHI WV> = ESm ~~
+ c
Fjj (Wf - Wi)
F(r:,d~j~~j)(~~j-:~j~(~~-~~)
f ; x vqiii fQ(w’.w,W) i&j + ~ ;r: Viiii (~
~Vi\Vj
-
’ Q (d,w,\%‘) ,Uj)
.
(15)
Y
Case 2, one electron differences ir,,, 0: w, W’differ by one hole-particle excitation between MO’s i andj, H ,,,*’= (‘$.WIH[ w’w’)
1 +kzjvikQ *ifw'WP4 -z.[Pjf~V",Q,~~ -~(W,~~t',W',1V1 7&3,W,W', (16) f4QiiiwI: $cd,w,w:w') +4 = Fii + ~(?& [
-; ?+J
(IV;;--ii&)
q (~~,~v,~‘,~u’)
~~~~(~v~-Zj~(w,w,w’,,o’).
Voluine
36, number 4
Case 3, two electron
CliEbf1C~L
by two hole-particle ~Mo’s i, j, k, I, ,In”
=
kN
IHI
LETTERS
1 December
1975
difr”erenccsH,,-:
W, w” differ
N
PHYSrCi
excitations
between
GJ”IV”)
= [ V[jJ_/ q (lV',W,lU) + Vijrc,-f)(W’,cJ,W)
l
l
q
(lV’,W”,w”)
rl (W’,w”,ru”)l
c (i,i.k
r>, (I 7)
where
c(i,j,k,I)=i
ifj=Iori=k =a ifj=iandi=k.
Comparison with the work of Salmon and Ruedenberg [l] shows that the n factors are essentially their permutation factors written, as previously pointed out, in inner product form.
i wz’r’) = ; (A, - A, - A4 + A,). An exalnination quickly
4. Operator
coefficients
In order to develop an efficient store and access technique to handle the operator coefticients q, it is useful at this point to consider by example several properties ofdetcnninantai spin functions. For any determinantal form, the spin functions (a, 0) are paired for doubly tilled MO’s whereas a degree of freedom exists for the singly filled MO’s because of the possibility of permutation among the CLor /I spins. However, once a choice has been made of a standard order and linear combinations of spin terms for the singly filled MO’s eigenfunctions of s2 are completely defined. Consider now the spatial occupation W= (2 1 1 1 10). For (Se> = Cl the six possible spin arrangements (of> among the open shells are (WY&~, c~fiaP, c&k, &K@, &Qcr, P@L)L) where only singiy filled MO spins are written and the.order of the MO’s has been fixed by convention. There will be two arbitrary but hnearly independent singlet eigenfunctions for this case. One such pair is WI =(12)-t’*
(3 u1 - a2 - o3 - c4 - o5 + 2u6),
02 = ; (02 --03-@~fCT5). If determinantal
notation
(18) is used:
reveals
that
(20)
of the determinant interchanging
expansion
the order
of doubly
filled (or nonexistent) MO with any other in the vector! where both LYand p components are moved but the order CYbefore /3 is preserved. does not alter the wavefunction. Interchange of any two singly fifled MO’s, however, causes sign changes within the determinant as well ;1s interc~~an~in~ the spin labels denoted by the chosen convention. The result is the same as applying a similarity transformation to the two singlets. Moreover, the weighting of the spins (a,@) in the doubly, filled (or nonetistent) MO’s is such that in all spin eigenfunctions built from normalized functions integration between two such equivalentiy occupied or “matched” MO’s over that coordinate will yield unity. In the recognition of patterns or classes of similar coefficients of, when evaluating terms of the form (w w @Iu’ WV’),we’may use the ability to permute MO’s .ivhich are doubly filled or vacant, and which are equivalently occupied in the initial and final vectors (w, w’), to a form where they are easiIy integrated out of the expression, In considering the possible vahres of the coefficients that may arise, it is clear that only the singly occupied or&tats, and those that are mismatched between the vectors are of importance. To this end we group the latter occupations, retaining the canonical order, into a simplified vector with the property that the expectation value between such a reduced pair is identical to that of the complete form. However, the patterns formed by comparing occupa-
Volume
CHEhIICAL
36, number 4
PHYSICS
tions between the simplified vectors ue common to a large number of different pairs of spatial arrangements. The MO’s theinselvcs are different giving rise to different spatial integrals but the relationship be-
tween their occupations is the same. Since the weighting coefficients are not dependent on spatial MO'sbut only on their occupations, it is this resul; which enables one to reduce effectiire storage dramatically. To determine the number of patterns for a particular combination of open shells is an elementary problem in statistics. Since ord:~ single differences in occupation vector arc,:produced by I?: there are two and only two.cases. E: may act on any given occupation vector to produce an equal number of open shells or the final vector may differ from the first by 2 open shells. For the former case, let the number of open Shells in on= occupation vector “II”: there will be ()+-I) matched and two mismatched occupations between the pair. De number of arrangements of the otherwise indistinguishable matches will be (II + l)!/(rr - l)! 2 ! = (f2 -I- 1)?2/2.
(21)
For a differing number of open shells, let there be “rz” in the lesser vector: there are then )I matched and two mismatched occupations for this case. The expression for the number of arrangements is: (n + 2)!/n ! .? ! = (n + 2) (7: + 1) /Q.
(22)
The above two expressions may be combined into
one formula equivalent tc eq. (21) If It is taken as one half the total number of open sheils in the combined pair of occupations. While matched MO’s must by this stage have singie occupations, the mismatched MO'smay be doubly
Cummulativc Iota1 number of cocfkicnts
as a function
of open shd
LETTERS
for doubly filled. At this stage we have all the information
One interesting
the following
2
5
6
7 9
10
a
4 56 731 9747
133227
is obtained
by a binary
examples.
2211110 221101! 110 lo=26
PATTERN26
2121101 1121111 01 1101=29
PATTERN29
and multiplicity
singlet
4
method
com-
parison of the occupation vectors where doubly filled and vacant orbitals are both taken as 0 or false. The two configurations are treated under the following rules and the result col!ected as a binary number. All matched single occupations are flagged true or 1. All mismatched occupations are flagged faIse or 0. All remaining occupations are ignored. This is of course the iogical AND of the simplified vector pair. The binary number formed is a unique index of pattern. Consider
doublet quvtet 1
needed
to identify a particular coefficient, namely the patterns formed between the two spatial occupations and accompanying possible sign change, and the spin functions (~,a’) which index a particular element within the remaining array of possibilities. .3mechanics of the operation may be handled by a ilumber of computational algorithms - the desired characteristics are of course simplicity and speed
Cummulative totals
3
1975
filled or vacant and there is in general a choice of which. Again it can be shown from inspection of de. terminantal properties that this will produce at most a change of sign. Specifically this occurs in the case of equi\ alent numbers of open shells, where the coefficients for vacant MO’s are of opposite sign to those
M~~imun wlmber of open shells singlet triplet
1 December
doublet 1 31 SO6 7464
108012
triplet 3 111 2217 37497
596397
qwtct 0 6 286 6950
134822
Volume 36, number 4
CHEMICAL
PHYSICS LETTERS
If one asks how many unique coef&ients are needed to carry out a calculation with a given number of open shelis, the answer is quickly obtained by lnultipl~ing the number of patterns generated for a particular combination of open shells by the number of coefficients in the w X w’ zrray of possible spinfunction products for that pair of patterns, and summing the result over all desired open shell possibilities up to the limit desired. This has been done in table 1 for several muItiplicjties to illustrate the feasibility of storing them as a program library. Certainly for 10 open shells this presetits little difficulty, and with suitable program logic, storage as an external disc fie could be used to extend the range still further. AS well, many of the coefficients will be either zero or of equal ma~itude, and proper techniques may be used to exploit this feature. The method we have outlined here takes advantage of the ~ac~orabiIity of the weighting coefficients for two electron integ:als into a pair of one electron coefficients (2 indices instead of 4) and the fact that it is the genera! arrangement of the occupation vectors (pattern), rather than the specific occupations that uniquely determines these coefficients. It is an extremefy practic3l approach to large s&e CI matrix eiement generation. In a program which implements the
I December
1975
algorithm cm 2n IBM 3701158 compu&r, we find a rate of generation of non-zero matrix elements over spin eigenfunctions of > .! 200/s. In the cause of the .&neratidn of CI matrices which contain 50% zero elements due to the inclusion of states which differ in more than two electron’s spatial coordinates, we achieve * 3200 matrix eIeme~~~~~second including all overhead. We also End the efficiency to be essentially independent of the number of ogen shells in the basis set pro-vided the 77 library can be stored in conlputer high speed core. While it is undoubtedly true that more efficient Fortran programs utilizing the method can be written, these rates are considerably faster than those obtained with other methods [S] and represent a real increase in the possible efficiency of large scale CI calculations.
References [ 1 f W.I. Salmon and K. Ruedenbcrg, J. Chem. Thys. 57 11972) 2776: [2] 1-L. Cooper and R. McWeeny, J. Chem. Phys. 45 (1966) 226. f3] I. Paldus, J. Chem. Phys. 61 (1974) 5321. 141 J. Paldus, Advan. Thewet. Chem., to bc published. IS] I. Shavitt, privsre communication.
: 483