8
< < Symbolic Algebra in Functional Derivative Potential Calculations ¨ U PATRICK JEMMER, PETER J. KNOWLES School of Chemistry, The University of Birmingham, Edgbaston, Birmingham, B15 2TT, United Kingdom Received 1 April 1997; accepted 28 August 1997 ABSTRACT: This article gives the details of the methodology used in constructing a symbolic algebra program designed for evaluating potentials as the functional derivatives of so-called functional generators in molecular density-functional theory. The derived formulae are used in illustrative examples involving partial functional integration, the comparison of the exchange potential arising from different mathematical representations of the electron density for a given functional generator, and the evaluation and comparison of the potential for different functional generators with a given density. Q 1998 John Wiley & Sons, Inc. J Comput Chem 19: 300 ] 307, 1998 Keywords: density functional theory; functional derivative; potential; symbolic algebra; chain-rule differentiation; variable transformation; second-derivative correction Methodology his article utilizes the previously published T Mathematica 1 symbolic functional derivative calculation protocol in illustrative examples drawn from density functional theory. 2 Consider first the general density functional for- mulation for the total electronic exchange energy. Ž The extension to other energy functional genera- * Present address: Physical and Theoretical Chemistry Labo- ratory, South Parks Road, Oxford OX1 3QZ, U.K. ¨ Correspondence to: P. Jemmer; e-mail: padz@physchem.ox. ac.uk . tors is straightforward. This is usually written as an integral over real space, 4r3 3 w Ž. x Ž. Ž. Ž. E r r s d r r r g r . 1 H x x In the local density approximation to the electronic energy, based on considerations of the uniform Ž. electron gas, the functional generator g r is a x constant. 3 In more realistic descriptions of atoms and molecules, the effects of inhomogeneities in the electron density are explicitly introduced into Ž. the exchange energy expression by allowing g r x Ž to depend on the density r , its gradient =r as in 4 . the work of Becke , and higher derivatives such 2 Ž . as = r as in refs. 5 and 6 . ( ) Journal of Computational Chemistry, Vol. 19, No. 3, 300 ]307 1998 Q 1998 John Wiley & Sons, Inc. CCC 0192-8651 / 98 / 030300-08

Symbolic algebra in functional derivative potential calculations

  • Upload
    peter-j

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

— —< <

Symbolic Algebra in FunctionalDerivative Potential Calculations

¨ UPATRICK JEMMER, PETER J. KNOWLESSchool of Chemistry, The University of Birmingham, Edgbaston, Birmingham, B15 2TT, UnitedKingdom

Received 1 April 1997; accepted 28 August 1997

ABSTRACT: This article gives the details of the methodology used inconstructing a symbolic algebra program designed for evaluating potentials asthe functional derivatives of so-called functional generators in moleculardensity-functional theory. The derived formulae are used in illustrative examplesinvolving partial functional integration, the comparison of the exchange potentialarising from different mathematical representations of the electron density for agiven functional generator, and the evaluation and comparison of the potentialfor different functional generators with a given density. Q 1998 John Wiley &Sons, Inc. J Comput Chem 19: 300]307, 1998

Keywords: density functional theory; functional derivative; potential; symbolicalgebra; chain-rule differentiation; variable transformation; second-derivativecorrection

Methodology

his article utilizes the previously publishedT Mathematica1 symbolic functional derivativecalculation protocol in illustrative examples drawnfrom density functional theory.2

Consider first the general density functional for-mulation for the total electronic exchange energy.ŽThe extension to other energy functional genera-

* Present address: Physical and Theoretical Chemistry Labo-ratory, South Parks Road, Oxford OX1 3QZ, U.K.

¨Correspondence to: P. Jemmer; e-mail: [email protected]

.tors is straightforward. This is usually written asan integral over real space,

4r33w Ž .x Ž . Ž . Ž .E r r s d r r r g r . 1Hx x

In the local density approximation to the electronicenergy, based on considerations of the uniform

Ž .electron gas, the functional generator g r is axconstant.3 In more realistic descriptions of atomsand molecules, the effects of inhomogeneities inthe electron density are explicitly introduced into

Ž .the exchange energy expression by allowing g rxŽto depend on the density r, its gradient =r as in

4.the work of Becke , and higher derivatives such2 Ž .as = r as in refs. 5 and 6 .

( )Journal of Computational Chemistry, Vol. 19, No. 3, 300]307 1998Q 1998 John Wiley & Sons, Inc. CCC 0192-8651 / 98 / 030300-08

SYMBOLIC ALGEBRA IN FUNCTIONAL DERIVATIVE POTENTIAL CALCULATIONS

In addition to determining the total energy, thedensity functional determines the forms of atomicand molecular orbitals, through the operation ofthe variational principle, that is, through theKohn-Sham equations.7 Each term in the func-tional gives rise to an effective potential experi-enced by the orbitals from which the density isbuilt. The potentials are constructed from the func-tionals as their functional derivatives, for example,

Ž .for the exchange potential, v r ,x

w Ž .xdE r rxŽ . Ž .v r s . 2x Ž .dr r

In this case, a simple relationship does not existbetween the initial functional generator and theform of the potential, as in the exact case of hydro-gen for which the exchange potential is

1 1H y2 rŽ . Ž .v r s e 1 q y . 3K ž /r r

For complex functional generators, which givereasonable approximations to the energy, it soonbecomes difficult to obtain the corresponding po-tentials ‘‘by hand.’’

FUNCTIONAL DERIVATIVES

Let us consider the manual calculation of apotential as would be used in density functionaltheory. An example of such a general functionalwould be

w Ž .x 3 w Ž . Ž . 2 Ž .x Ž .F r r s d r f r r , =r r , = r r . 4HThe exchange potential is obtained as the func-tional derivative of the exchange energy, using thecalculus of variations,3, 8

w Ž .xdF r r ­ f ­ f ­ f2 Ž .s y = ? q = . 52ž / ž /Ž .dr r ­r ­ = r ­ = r

w Ž .xFor example, consider the functional F r r , de-fined as,

2 Ž .= r r3w Ž .x Ž .F r r s d r . 6H 1r3Ž .r r

Ž .Through the simple application of eq. 5 , onereadily obtains the functional derivative,

w Ž .x < Ž . < 2 2 Ž .dF r r 4 =r r 2 = r rŽ .s y . 77r3 4r3Ž .dr r Ž . Ž .9r r 3r r

For more complicated functionals, however, this

manual procedure soon becomes unwieldy. Forthis reason, we generated automatic symbolic tech-niques for the evaluation of dFrdr. These tech-niques are implemented in the symbolic algebrasystem of Mathematica,1 and have been madeavailable to the scientific community.2 In this arti-cle we describe the operation of the techniques,and give illustrations of their use.

We first introduce tensor suffix notation, includ-ing a summation convention for repeated indices,for the derivatives of the density:

­rŽ .r s , 8i ­ ri

­ 2rŽ .r s . 9i j ­ r ­ ri j

Thus, for example, the Laplacian =2r is written asŽ 2 .r , and = = r as r .i i i i j j

For a large class of functionals, it is possible andconvenient to express the functional integrandŽ 2 .f r, =r, = r in terms of r and the two dimension-

Ž < <. Ž < < 2 .less parameters x r, =r and y r, =r , = r , de-fined as,

< <=r 1r2 y4r3Ž . Ž .x s s r r r , 10i i4r3r

r ri iyŽ5r3. 2 yŽ5r3. 2 Ž .y s r y r s x y r = r , 11i ir

where x is the dimensionless scalar density gradi-ent, and y is a convenient dimensionless formula-tion of the Laplacian of the density. Note that inthis application it is expedient to expand the gradi-

< < Ž .1r2ent of the density explicitly as =r s r r .i iWe examine the automatic functional differenti-

ation of such functionals in the remainder of thisarticle; more general functionals can be treatedusing exactly the same techniques, but these func-tionals serve as a good illustrative example.

SYMBOLIC CALCULATION

Ž .A typical exchange-correlation xc energy den-sity functional is given by

4r33w Ž .x Ž . Ž Ž . Ž .. Ž .E r r s d r r r g x r , y r . 12Hxc

For example, such functionals have been exploredas candidates for improved representation of ex-

JOURNAL OF COMPUTATIONAL CHEMISTRY 301

J̈EMMER AND KNOWLES

change in asymptotic regions far from the nuclei ofa molecule.5

Ž .The functional derivative given by eq. 5 can bewritten as

Ž .v s v y v q v , 13xc 0 1 2

where the terms are calculated by chain-rule dif-ferentiation as follows.

The first term is the straightforward partialderivative of the functional with respect to thedensity,

­ fŽ .v s . 140 ­r

The second term is the divergence of the partialderivative of the functional with respect to thegradient of the density,

­ fŽ .v s = . 151 i ­ri

This is rather more complex than the previousterm, because the functional is assumed to dependon the modulus of the gradient; therefore, an appli-cation of the chain rule is required,

< <­ ­ f ­ =rŽ .v s . 161 < <­ r ­ =r ­ri i

This is expanded to give the result

r ­ f r ­ ­ fi i iv s q1 < < < < < < < <=r ­ =r =r ­ r ­ =ri

< <r ­ f ­ =ri Ž .y , 172 < <­ =r ­ r< <=r i

which is then developed further using automaticsymbolic manipulation, expanding all derivativesin terms of the spatial derivatives of r, and the

< <derivatives of f or g with respect to =r or x asdesired.

The final term is the Laplacian of the partialderivative of the functional generator with respectto the Laplacian of the density, and this is devel-oped in exactly the same way towards an expres-sion involving derivatives of f or g with respectto x and y,

­ ­ ­ fŽ .v s . 182 ­ r ­ r ­ri i j j

Examples of FunctionalDerivative Calculations

TWO-PARAMETER FUNCTIONAL GENERATOR

For a general, two-parameter functional genera-Ž . Ž .tor g x, y for use in 12 , which introduces the

density, its gradient, and the Laplacian of theŽ .density, the potential given by eq. 2 , takes the

form,

3 Žmqn.­ g1r3 Ž .v s r A , m q n F 3, 19Ý m n m n­ x ­ ym , ns0

where the coefficients, A , are defined in Table I.m nFor the special case of an exponential density,

Ž .r s N exp yar , this may be analyzed entirely interms of x and y after eliminating N and a:

3 Žmqn.­ g1r3 Ž .v s r B , m q n F 3, 20Ý m n m n­ x ­ ym , ns0

TABLE I.( )General Coefficients in Eq. 19 .

m n Amn

40 0

324x

0 1 y9

0 2 8r r r + ri i j j ii j j2 214 x y 5y

4 2y4r r y 3 x y 2r y yii j j i j 9 36 2 20 3 x + 4x r r r + 2 x r r + 4r r ri i j j ii j j i i j jkk

20yr r r 10yr ri i j j ii j j+ +

3 32 2 425 x y 10x y

y4r r r r y r r y yi i j jk k i j j ikk 9 3r r r y 7xi i j j

1 0 + y3 x 3x2r r r r 2r r r rxy i i j jk k i i j j i j31 1 x + + y y33 3 x xx

22 xr r r 10yr r r 2r r ri i j j i i j j i i j jkk1 2 + +

3 3 x x5 3 4r r r r 8 xr r8 x 40 x y i i j jk k ii j jy y y y

3 9 x 32 r r r4x i i j j

2 0 y 23 x48r r r r r r r16 xi i j j i i j jk k

2 1 y y 23 9 x

VOL. 19, NO. 3302

SYMBOLIC ALGEBRA IN FUNCTIONAL DERIVATIVE POTENTIAL CALCULATIONS

TABLE II.( )Coefficients in Eq. 20 for Exponential Density.

m n Bmn

40 0

324x

0 1 y9

2 24x y 2y0 2 y

9 33 2 2 42y 4x y y

0 3 y y 23 9 4xy 4x

1 0 yx 3

3 2x xy y1 1 + y

3 3 2 x2 3xy 4x y

1 2 y3 9

2x2 0

34x

2 1 y9

where the coefficients, B , are defined in Table II.m nThis approach can be helpful in searching for uni-versal energy functionals having the same proper-ties for all densities of a given shape but differentscaling. Similarly, for a Gaussian density, r s M

Ž 2 .exp ybr , one obtains the potential,

3 Žmqn.­ g1r3 Ž .v s r C , m q n F 3, 21Ý m n m n­ x ­ ym , ns0

where the coefficients, C , are defined in Tablem nIII.

EXPLICIT FUNCTIONAL GENERATORS

Ž .The general expression, eq. 19 , can be testedby evaluating the functional derivatives of thefunctional generators g s ryŽ5 r3. =2r s x 2 y y,1

yŽ8 r3. < < 2 2and g s r =r s x ; that is,2

2 2= r = r3 4r3 3 Ž .E s d r r s d r , 22H H1 5r3 1r3r r

2 2< < < <=r =r3 4r3 3 Ž .E s d r r s d r . 23H H2 4r3 4r3r r

TABLE III.( )Coefficients in Eq. 21 for Gaussian Density.

m n Cmn

40 0

324x

0 1 y9

2 24x y 2y0 2 y

9 32 24x y

0 3 y9

2y 4x1 0 y

3 x 33 2x 5 xy 2y

1 1 + y3 9 9 x

2 34xy 4x y1 2 y y

9 92x y

2 0 +3 3

4 2 2x 2 x y y2 1 y y y

9 9 9

These are correctly evaluated and the values of thepotential arising from each are

< < 2 21 4 =r 2 = r 2 12 1r3v s v s y s y y x r ,1 2 7r3 4r3 ž /3 3 39r 3r

Ž .24

as is to be expected from partial integration of eq.Ž . Ž .22 . It should be noted that eq. 24 can be rewrit-ten in the form

2 5 ­ g ­ g1 11r3v s r 2 g y x y y1 1ž /3 6 ­ x ­ y

1 Ž iqj.­ g11r3 Ž .s r A , i q j F 1, 25Ý i j i j­ x ­ yijs0

where the coefficients are, A s 4r3, A s00 10Ž .y5xr9, and A s y2 yr3. Equation 25 is a11

specific case of the general form of the exchangepotential given above.

ONE-PARAMETER FUNCTIONAL GENERATOR

One can now simplify the analysis by using thesymbolic computational methods described above

Ž .to generate the potential given by eq. 2 for a

JOURNAL OF COMPUTATIONAL CHEMISTRY 303

J̈EMMER AND KNOWLES

Ž .general functional generator, g x of x alone,

2 md g1r3 Ž .v s r D , 26Ý m mdxms0

where the coefficients D are defined in Table IV.mThe same potential, with an exponential density

Ž .r s N exp yar , explicitly introduced is given by

4a 1 2 axX YŽ . Ž . Ž .v s g x q 2 a y g x q g x .x ž /3 x ar 3 3

Ž .27

The formulation of this exchange potential for ahydrogenic density with a s 2 is confirmed in thework of Gill and Pople.9

Utilizing the Derived Potentials

EFFECTS OF DENSITY APPROXIMATION

To investigate the computational method, theexchange potential using the Becke functional gen-erator4 was computed analytically for STO-2G,STO-3G, and STO-6G approximations to an expo-

TABLE IV.( )Coefficients in Eq. 26 .

m Dm

40

3r r r 4x ri i j j ii

1 y y3 3 xx2 r r r4x i i j j

2 y 23 x

nential density arising from a wave function witha s 2. The differences in each case were found tobe small, and the difference between the exactpotential and that involving the Gaussian approxi-mations to it are shown in Figures 1 and 2. In allcases, a shell-like structure is displayed at radialdistances of up to 1.5 bohr from the nucleus; atdistances greater than about 4 bohr, the differencein potential between the exact density and theGaussian approximations tends to zero for STO-3G,and to small residual positive and negative valuesfor STO-6G and STO-2G, respectively.

FIGURE 1. Difference between the Becke functional exchange potential with an exponential density and that( )calculated with various Gaussian approximations to the density for r close to the nucleus. —— The STO-2G potential

( ) ( )difference; - - - the STO-3G potential difference; and ]]] the STO-6G potential difference.

VOL. 19, NO. 3304

SYMBOLIC ALGEBRA IN FUNCTIONAL DERIVATIVE POTENTIAL CALCULATIONS

FIGURE 2. Difference between the Becke functional exchange potential with an exponential density and thatcalculated with various Gaussian approximations to the density for r far from the nucleus. The curve designations arethe same as in Figure 1.

FUNCTIONAL GENERATOR HIERARCHY

A series of increasingly complex functional gen-erators is listed in Table V. The exchange energydensities and potentials arising from some of theseare discussed below.

The potentials, evaluated as the functionalderivative of the tabulated functionals generatorsfor an exponential hydrogenic density together

Ž .with the exact potential, eq. 3 , are plotted inFigure 3 for values of r close to the nucleus, and inFigure 4 for values of r in the asymptotic tailregion of the density.

It can be seen that the different potentials showa very variable degree of success in recreating thetrue exchange potential for hydrogen, and this isreflected in their even greater variability in molec-

TABLE V.Features of Exchange Potential for Various Functionals.

Functional

Dirac Sham Becke xy

Designation Local Almost First gradient Second gradientdensity homogeneous correction correction

Reference 10 11 4 5( ) ( )Formulation yC yC y g yC y g b yC y g g gx x S x B x B xy

1/3 y13 3 7 2y

5 y 1/ 2 2 2 y 1( ) ( ) [ ( )]C = g = 81p x g b = bx 1 + 6bx arcsinh x g = 1 +x S B xy 2ž /4 p 144 xConstants b = 0.0042 g = 0.0586

( )lim v y0.85 y0.020 / r y0.040 / r y1.2r ª 0 x2( ) ( ) ( )lim v y0.85 exp y2 r / 3 0.0065 exp 2 r / 3 y1.25 / r y1.0 / rr ª` x

JOURNAL OF COMPUTATIONAL CHEMISTRY 305

J̈EMMER AND KNOWLES

( )FIGURE 3. Exchange potential obtained from the functionals in Table V for r close to the nucleus. —— The exact( ) ( ) ( ) ( )potential; ]]] the local density approximation potential; v the Sham potential; B the Becke potential; and ` the

xy potential.

FIGURE 4. Exchange potential obtained from the functionals in Table V, for values of r in the exponential tail of thedensity. The curve designations are the same as in Figure 3.

VOL. 19, NO. 3306

SYMBOLIC ALGEBRA IN FUNCTIONAL DERIVATIVE POTENTIAL CALCULATIONS

ular calculations. Both the Sham and Becke poten-tials diverge to y` as r tends to zero, and thelocal density approximation potential underesti-mates the exact potential value of y1 at r s 0. Asr becomes large, the local density potential decaysexponentially to zero, while the Sham potentialincreases exponentially and the Becke potential

y2 Ždecays as yk r where k s 5r4 is determined.by the hydrogen ionization potential , which is

faster than the yry1 behavior of the exact poten-Ž .tial. The T x, y functional, first introduced in refs.

5 and 6, is included for comparison. This formula-tion can be seen to be the best representation closeto the nucleus where it produces a value of y1.2for the potential and at long range, where it decaysas yry1.

Summary

A method has been devised to calculate symbol-ically, and for specific cases, the symbolic func-tional derivative of a functional of the electrondensity, its gradient, and Laplacian. This may eas-ily be extended to include higher derivatives, andthis method provides a useful tool for computa-tions that are difficult and tedious to do by hand.This method has further been implemented in afreely available program.2 It has been shown howthis method can be used extensively in the investi-gations of different formulations for the exchangepotential. The particular usefulness of this method-ology is shown in the generation of a new form-ulation involving the Laplacian of the electron

density, which accurately reproduces the exact hy-drogenic exchange energy density and potential atthe nucleus and asymptotically, which gives thecorrect uniform electron gas limit.5

Acknowledgments

Acknowledgments are due to the Universities ofSussex and Birmingham for the Bursaries that en-

¨abled P.J. to pursue this project and for the use ofcomputing facilities, and to EPSRC for furtherfunding.

References

1. S. Wolfram, Mathematica: A System for Doing Mathematics byComputer, Addison]Wesley, Reading, MA, 1992.

¨2. P. J. Knowles and P. Jemmer, Comput. Phys. Commun., 100,Ž .93 1997 .

3. R. G. Parr and W. Yang, Density Functional Theory of Atomsand Molecules, Oxford University Press, New York, 1989.

Ž .4. A. D. Becke, Phys. Rev. A, 38, 3098 1988 .¨ Ž .5. P. Jemmer and P. J. Knowles, Phys. Rev. A, 51 3571 1995 .¨6. P. Jemmer, Ph.D. thesis, The University of Birmingham,

Birmingham, U.K., 1996.Ž .7. W. Kohn and L. J. Sham, Phys. Rev., 140, A1133 1965 .

8. G. A. Korn and T. M. Korn, Mathematical Handbook forScientists and Engineers, McGraw]Hill, New York, 1961.

Ž .9. P. M. W. Gill and J. A. Pople, Phys. Rev. A, 47 2383 1993 .Ž .10. P. A. M. Dirac, Proc, Cambridge Phil. Soc., 26, 276 1930 .

11. L. J. Sham, In Computational Methods in Band Theory, P. M.Marcus, J. F. Janak, and A. R. Williams, Eds., Plenum, NewYork, 1971.

JOURNAL OF COMPUTATIONAL CHEMISTRY 307