Molecular Physics, Vol. 103, No. 6–8, 20 March–20 April 2005, 719–747
The GAMESS-UK electronic structure package: algorithms, developments and applications
MARTYN F. GUESTy*, IAN J. BUSHy, HUUB J. J. VAN DAMy, PAUL SHERWOODy, JENS M. H. THOMASy, JOOP H. VAN LENTHEz, REMCO W. A. HAVENITHz and JOHN KENDRICK} yComputational Science and Engineering Department, CLRC Daresbury Laboratory, Daresbury, Warrington, Cheshire WA4 4AD, UK zTheoretical Chemistry Group, Debye Institute, Utrecht University, Utrecht, The Netherlands }QMolecular Ltd, 13 Castle Close, Middleton St George, Darlington DL2 1DE, UK
A description of the ab initio quantum chemistry package GAMESS-UK is presented. The package offers a wide range of quantum mechanical wavefunctions, capable of treating systems ranging from closed-shell molecules through to the species involved in complex reaction mechanisms. The availability of a wide variety of correlation methods provides the necessary functionality to tackle a number of chemically important tasks, ranging from geometry optimization and transition-state location to the treatment of solvation effects and the prediction of excited state spectra. With the availability of relativistic ECPs and the development of ZORA, such calculations may be performed on the entire Periodic Table, including the lanthanides. Emphasis is given to the DFT module, which has been extensively developed in recent years, and a number of other, novel features of the program. The parallelization strategy used in the program is outlined, and detailed speedup results are given. Applications of the code in the areas of enzyme and zeolite catalysis and in spectroscopy are described.
1. Introduction quantum chemistry, as well as key contributor to the improvement of functionals for chemical problems and The UK version of GAMESS (Generalised Atomic and the techniques for its efficient implementation. His Molecular Electronic Structure System) [1] has been influence was key to the decision to set up a CCP1 under development for nearly a quarter of a century and flagship project in this area, and the results of this this volume, in celebration of the contribution of project are now maintained and distributed as part of Nicholas Handy, presents an ideal opportunity to GAMESS-UK, as well as being available for use in describe the current status of the program. The code other projects. The DFT module in GAMESS-UK has represents the principal piece of software developed and been available since version 6.0 of the code, and is maintained under the auspices of Collaborative described in some detail in section 3 of this paper. Computational Project No. 1 (CCP1). Nicholas Handy The article is organized as follows. An overview of the has, over this period, played a leading role in many program is given in section 2, tracing the development of aspects of this project, and we, the GAMESS-UK the code and outlining the possible wavefunctions that developers, owe a sincere debt of thanks to Nicholas for GAMESS-UK can calculate and the types of runs that the support he has given to the concept of a freely can be performed. Section 3 describes the GAMESS- available, centrally supported UK-based quantum UK implementation of DFT. Section 4 focuses on the chemistry code. Many parts of the program, specifically implementation aspects for a number of the more in the areas of perturbation theory for electron popular, and the more novel, features available within correlation and analytic derivatives, can be traced to the code. These include the modules for (i) Geometry developments in the Cambridge group. More recently, Optimization, (ii) the treatment of Relativistic Effects Nicholas has been the leading UK proponent of Density and ZORA, (iii) Valence Bond, (iv) MRDCI, (v) RPA Functional Theory (DFT) in the field of molecular and MCLR treatments of Excited States, (vi) QM/ MM and the treatment of Large Systems and, finally, our recent work on graphical interfaces, also performed * Corresponding author. e-mail: [email protected] within the CCP1 programme. Details of the parallel
Molecular Physics ISSN 0026–8976 print/ISSN 1362–3028 online # 2005 Taylor & Francis Group Ltd http://www.tandf.co.uk/journals DOI: 10.1080/00268970512331340592 720 M. F. Guest et al. implementation of GAMESS-UK and the associated both CCSD [17, 18] and CCSD(T) [19, 20] coupled- performance attributes are given in section 5, while cluster calculations, although the latter remain limited section 6 considers the applications of the code in a to closed-shell systems [21]. A size-consistent variant of number of areas, including enzyme and zeolite catalysis multi-reference MP2 theory, popularized in its CASPT2 and spectroscopy. form by Roos et al. [22], is also available [23]. With no restriction to CAS wavefunctions, the module also provides MR-MP3 capabilities. One of the more recent 2. Overview of the program developments includes an implementation of the semi- direct table-driven MRDCI module [24, 25], providing The program is derived from the original GAMESS for more extensive capabilities in the treatment of code, obtained from Michel Dupuis in 1981 (then at electronic spectra and related phenomena. the National Resource for Computational Chemistry, The treatment of both excited and ionized states has NRCC), and has been extensively modified and long been a major requirement from users of the code. enhanced over the past two decades. The key driver in In addition to the MRD-CI treatments above, calcula- our adopting the code lay in the availability of gradient tions of electronic transition energies and corresponding capabilities, absent in the ATMOL suite of programs [2] oscillator strengths may be performed using either the that had been the main electronic structure code Random Phase Approximation (RPA) method or the supported under CCP1. Note that these developments Multiconfigurational Linear Response (MCLR) proce- have been conducted independently of the impressive dure [26]. The RPA calculations may be performed programme of extensions to the GAMESS code itself, either within the conventional approach where the conducted under the leadership of Mark Gordon and two-electron integrals are transformed or with a ‘direct’ Mike Schmidt at Iowa State University [3]. implementation. The direct calculation of molecular When first acquired, the code was essentially limited valence ionization energies may be performed through to HF/gradient functionality allowing for basis sets Green’s function techniques, using either the outer- involving s, p and d Cartesian Gaussian orbitals, with valence Green’s function (OVGF) [27] or the two- open- and closed-shell SCF treatments available within particle-hole Tamm–Dancoff method (2ph-TDA) [28]. both the RHF and UHF framework. Generalized While employing effectively the same integral and valence bond [4] treatments were also supported. The gradient technology, the program has been extended to program utilized Rotation [5] techniques to evaluate evaluate repulsion and the associated gradient integrals repulsion integrals over s and p Gaussians, and the Rys over f and g Gaussians. The original limitation to Polynomial [6] for integrals involving d Gaussians. SCF cartesian basis sets is lifted through the provision of convergence controls were provided through a hybrid spherical harmonic basis sets for all options within the scheme of level shifters and damping factors. The programme. SCF controls now use a hybrid scheme of analytic energy gradient was available for the above level shifters and the DIIS method [29, 30]. In addition, wavefunctions, with gradients for s and p Gaussians complete active space SCF [22, 31, 32] and more general evaluated using the algorithm due to Schlegel [7], MCSCF [33], and Møller Plesset (MP2 and MP3) [34, while gradients involving d Gaussians utilized the Rys 35] calculations may now be performed. Geometry Polynomial Method [8]. Force constants were evaluated optimization is conducted using a quasi-Newton rank- by numerical differentiation. Ab initio core potentials two update method, while transition state location is were provided in a semi-local [9–11] formalism for available through either a synchronous transit [36], trust performing valence-only molecular orbital treatments. region [37] or ‘hill-walking’ [38, 39] method. Force Many of the initial developments around the code constants may be evaluated analytically [40, 41], while focused on enriching the range of available post- coupled Hartree–Fock (CHF) calculations provide for a Hartree–Fock capabilities, with functionality originally range of molecular properties, including polarizabilities developed within the ATMOL suite of programmes and molecular hyperpolarizabilities [42] and, through integrated into the code. Thus conventional CI treat- the calculation of dipole moment and polarizability ments using the table-driven selection algorithms within derivatives, the computation of infra-red and Raman the framework of MR-DCI calculations [12–14] allowed intensities [43]. for the treatment of electronic spectra and related Many new ab initio core potentials have been phenomena, while large-scale CI calculations of both incorporated into the code which now includes both ground and first few excited states were provided by the semi-local and non-local [44] formalisms for Direct-CI [15] module. valence-only molecular orbital treatments. These initial correlation treatments have since been A wide variety of wavefunction analysis methods are extended through the incorporation of Full-CI [16], and available. These include population analysis, Natural GAMESS-UK electronic structure package 721
Bond Orbital (NBO) [45–47] and distributed multipole In the following sections we highlight a number of the analysis [48], localized orbitals, graphical analysis and implementation aspects of the more popular, and the calculation of one-electron properties. An interface to more novel, features available within the code. the AIMPAC code of Bader is provided [49]. Particular attention is focused on the developing DFT The treatment of solvation effects is based on the capabilities (section 3). DRF (Direct Reaction Field) model [50–52], an embed- ding technique enabling the computation of the interaction between a quantum-mechanically described 3. The GAMESS-UK implementation of molecule and its classically described surroundings. The Density Functional Theory classical surroundings may be modelled in a number of ways, (i) by point charges to model the electrostatic field 3.1. Background due to the surroundings, (ii) by polarizabilities to model Since Hohenberg and Kohn [54] laid down the founda- the (electronic) response of the surroundings, (iii) by an tions for a rigorous electronic theory requiring only the enveloping dielectric to model bulk response (both static electron density, density functional theory (DFT) has and electronic) of the surroundings, and (iv) by an enjoyed a steady increase in popularity. This popularity enveloping ionic solution, characterized by its Debye increased throughout the 1990s to such an extent screening length. that DFT has become a mainstream method for The treatment of relativistic effects is provided studying electronic structure problems in chemistry. within the ZORA scheme (Zeroth Order Regular The GAMESS-UK implementation originated with the Approximation [53]), a two-component alternative to CCP1 flagship project (1994–1997) which undertook to the full four-component Dirac equation. While much construct a DFT module to be built into a Hartree– cheaper than the latter, ZORA recovers a large part of Fock host code. This initial work, by Philip Young, has the relativistic effects. The scalar (one-component) form been extended continuously since the project ended. is now available, with the full two-component imple- mentation (including spin–orbit coupling) in progress. 3.2. Functionality The current implementation will allow all usual ab initio (and DFT) methods to be performed, incorporating the Currently the module supports the evaluation of the major relativistic effects. More details are presented in Kohn–Sham energy and matrix elements, plus the section 4.2. evaluation of the gradient of the energy with respect to The program structure is effectively open-ended in the nuclear coordinates. All terms can be evaluated for direct-SCF, -DFT and direct-MP2 mode, so that direct- GGA functionals. In all cases extensive use is made SCF calculations of up to 10 000 basis functions have of screening and pruning techniques to exploit the been performed. Such calculations make use of the local character of the density functionals. Finally, the extensive parallel capabilities, which are described in evaluation of all terms is driven by the same integrator detail in section 5. In addition to the functionality routine to ensure consistency of the quadrature outlined above, the program provides for Hybrid throughout. QM/MM calculations, through an interface to the The code supports Dunlap’s approximation to the ChemShell package and the CHARMM QM/MM Coulomb repulsion energy in which the charge density code (see section 4.7). can be fitted to an auxiliary basis [55, 56]: Arguably the most important of the recent additions ! X X X X to the code, available from Version 6.0 onwards, is pq ðrÞ¼ Dpq pq DpqCu jiu ¼ dujiu , a full-featured Density Functional Theory (DFT) pq u pq u module, with access to a wide variety of functionals ð1Þ (S-VWN, B-LYP, B-P86, B3-LYP, HCTH, B97, B97-1, B97-2, PBE, EDF1, FT97, etc.). This module is subject where the fitting coefficients C can be obtained from to on-going developments under the auspices of CCP1, and will be described in some detail in the sections Cpq ¼ V 1bpq: ð2Þ below. As with any ab initio electronic structure code, the In this equation Vuv are the electron repulsion pq areas of application of GAMESS-UK are numerous. integrals in the charge density basis and bt are the The code is designed to be a full-featured computational three-centre electron repulsion integrals between the chemistry package serving a broad user community. wavefunction basis set and the charge density basis. This As such, we have developed, or will be developing, a way the evaluation of four-centre two-electron integrals wide range of application modules for the package. can be circumvented using at most three-centre 722 M. F. Guest et al. two-electron integrals, clearly reducing the formal are that it is simple and can achieve high accuracy. The scaling of the computational cost from fourth order to downside is that the atom-like partitions will cover third order. We can reduce the computational cost overlapping volumes of space, so that each volume of further by implementing a mechanism to store the three- space will be integrated multiple times by the atomic centre two-electron integrals in main memory in a grid centred on different atoms, leading to higher distributed fashion on parallel computers. computational costs. Indeed, a Becke-type approach Second derivatives of the energy are computed [57] scales formally with at least the square of the number of according to the formulation given by Johnson and atoms, although this can be addressed by appropriate Frisch [58], and the coupled perturbed Kohn–Sham approximations while maintaining its advantages. (CPKS) equations can be solved for both external field For reference we briefly reiterate the important as well as geometrical perturbations. Terms in the CPKS components of the Becke quadrature. The starting equations can be evaluated either in the AO or MO basis point is the nuclear-weight function which has to satisfy dependent on what is most efficient for the size of system two main criteria. First, given a three-dimensional under consideration, and the quadrature weights are molecular integral, multiplying the integrand with the differentiated to ensure they are true derivatives of the nuclear-weight function of a particular atom has to energy expression. result in a suitably atom-like function called an atomic As GAMESS-UK is often used by non-experts some partition. Secondly, the nuclear-weight functions of all considerable effort has been invested in defining the atoms have to add up to one for all points in space, so predefined DFT quadratures and these are described in that the sum of all atomic partitions is equal to the full the next sections. molecular integrand. Each atomic partition can be integrated using straightforward polar coordinate grids which are simple Cartesian products of suitably 3.3. DFT quadrature chosen angular and radial coordinate grids. The Developing a quadrature for DFT calculations is nuclear-weight function is obtained simply by assigning challenging because of three particular features of a cell-function to every atom and calculating the molecular electronic densities. First of all there is a fraction its cell-function contributes to the total sum cusp at the position of every atom, second the density of cell-functions. Within these general principles a decays exponentially with increasing distance to the quadrature can be modified by making different atoms, and, third, in the inter-atomic region the density choices for the cell-functions, the angular grids and the is smooth but can have a number of extrema due to radial grids. contributions from various atoms. An adequate quad- To apply the above scheme to a particular molecule, a rature is one that can simultaneously address all three set of grid points needs to be generated. Ideally this features in reasonable fashion. generation would be adaptive so that any accuracy can Because quadrature development is so challenging it be obtained on demand. However the nuclear-weight has long remained an active area of research and various function makes the on-the-fly error analysis needed to general approaches have been proposed. There are two attribute a fraction of the overall error to specific grid main strategies to meet the challenge. The first is to parameters very hard. Alternatively, trying various grid devise a scheme to partition space into distinct volumes parameters for each atomic partition until a satisfactory and integrate each volume with a particular grid. result is obtained is very costly. Therefore, ‘predefined Space can either be partitioned into spheres with some grids’ which have been optimized to achieve certain special partitioning for the space remaining between accuracies on a chosen set of molecules remain the most the spheres [59, 60], or into cubes which are recursively practical way forward. partitioned in further cubes until a specific accuracy is Before describing the way we have chosen to achieved [61]. The advantage of these approaches is optimize the predefined grids for the DFT module, it that each volume element is integrated only once, is revealing to look briefly at a simple model analysis leading to favourable scaling behaviour. The disadvan- that illustrates where the errors in the integration tage is that either complex partitioning schemes or a originate. This highlights those aspects one needs to be large number of volume elements are needed to achieve wary of. þ high accuracy. Consider an H2 -like molecule, i.e. two atoms A and In contrast, Becke [62] proposed to partition the B, each of which is described exactly by a single integrand into a number of atom-like terms. Each term exponential function and the molecular wavefunction can then be integrated with an appropriately selected is simply the sum of the two atomic wavefunctions. In grid in polar coordinates. The advantages of this scheme the case under consideration here, we allow the two GAMESS-UK electronic structure package 723 exponents to differ as this highlights additional sources which would be ideally suited to polar coordinate of error that would arise in real molecules. Furthermore, quadratures. we limit our analysis to the line that connects the two In figure 1(a) we have plotted the atomic partitions of atoms and which is assumed to be the z axis. Within this the molecular density for atom A obtained with the approximation the atomic wavefunctions are chosen Becke nuclear-weight function and the Hirschfeld to be nuclear-weight function. The density of atom A and the molecular density are plotted for comparison. 3 3 At first sight the Hirschfeld partition looks more like ’ ðzÞ¼ exp jjZ z , ð3Þ A 2 4 A the exponentially decaying function expected for an atom-like function than the Becke partition, which goes ’BðzÞ¼expð jjÞZB z , ð4Þ to zero at the position of atom B. However, careful inspection reveals that there is a sudden change in ’ABðzÞ¼’AðzÞþ’BðzÞ, ð5Þ the Hirschfeld partition at the position of atom B. In figure 1(b), for each grid point of atom A, we have where ZA ¼ 1andZB ¼ 1. plotted the error this grid point makes in integrating the The integration of the ‘atomic density’ now boils atomic partition. down to a one-dimensional integration of an exponen- Once again this grid was chosen so as to integrate the tial function for which a grid can be defined which density of atom A exactly. In this figure there are four integrates this exactly. Each grid point accounts for a distinctive regions. First in the region for z smaller than particular section of the z axis. To obtain reference ZA we find that the error is small because the results each section can be integrated with multiple exponential decay differs slightly from that of atom A points as well. Having established these grids, we due to the presence of atom B. Secondly, for z between consider integrating the molecular density along the ZA and ZB there are significant errors due to the line using Becke-type quadratures. nuclear-weight function not being able to recover a truly First we consider the Becke nuclear-weight function, atom-like partition. Interestingly, the errors with the which is defined as Becke nuclear-weight function are actually larger than those from the Hirschfeld nuclear-weight function in jjZA z jjZB z this region. However, in the third region close to atom B ABðzÞ¼ , ð6Þ jjZA ZB the Becke partition has decayed to zero and so has the error associated with it. The Hirschfeld partition, 3 1 pð Þ¼ 3, ð7Þ however, still has a remainder of the cusp of atom B 2 2 which causes large errors in this region. In the fourth 1 and final region where z is larger than ZB the Becke w ðzÞ¼ ½1 pðpðpð ðzÞÞÞÞ : ð8Þ A 2 AB partition and its associated error remain zero. The Hirschfeld partition, however, has acquired a signi- Because the nuclear-weight function should partition ficant atom B character leading to a noticeable the integrand into atom-like partitions, the Hirschfeld systematic error for every grid point in this region. partitioning offers itself as an obvious contender to the The overall result is that using the Hirschfeld nuclear- Becke nuclear-weight function. Becke did mention weight function leads to a 50% larger error for this exponential nuclear-weight functions in his original example than using the Becke nuclear-weight function paper but did not elaborate on his reasons for rejecting despite having smaller errors per grid point in the them. The Hirschfeld nuclear-weight function [63] is inter-atomic region. This example clearly underlines defined as the importance of the nuclear-weight function for a given atom being zero at and behind all other atoms AðzÞ in the molecule. It shows also that when using a wAðzÞ¼ ð9Þ AðzÞþ BðzÞ Becke-type partitioning the largest errors tend to arise in the inter-atomic region. Furthermore, using the which simply gives the fraction of the total density cell-function as proposed by Becke, the error per that a particular atom contributes assuming that grid point changes sign where the curvature of the the total density is a simple sum of atomic densities. function changes sign leading to a partial cancellation Clearly if the molecular density is little different from of errors. the sum of atomic densities this nuclear-weight function In developing a set of predefined quadratures for would be expected to give very atom-like partitions the DFT module we first need to pick the basic 724 M. F. Guest et al.
Figure 1. (a) Atomic partitions for atom A obtained from the Becke (Becke density AB) and Hirschfeld (Hirschfeld density AB) nuclear-weight functions compared to the total molecular density (density AB) and the density of atom A (density A). (b) The errors the grid that integrates atom A exactly contributes per point to the total error when attempting to integrate the Becke and Hirschfeld partitions.
components. Keeping these fixed, the grid sizes can be Table 1. Grid names and their tolerances. optimized to meet precision tolerance targets. Initially Grid Target tolerated relative error we set out to optimize four predefined grids named after the relative precision they are supposed to Low 1.0e–4 achieve. However, we found that the tolerance target Medium 1.0e–6 of the ‘very high’ grid, being a relative error of less than High 1.0e–8 1.0e–10 for the total energy and the electron count, is not generally achievable. In particular, molecules invol- ving fluorine and row 5 or row 6 elements posed 3.3.1. The nuclear-weight functions implemented in numerical problems we could not resolve. Therefore, we GAMESS-UK. In choosing the nuclear-weight function limited ourselves to optimizing the grids for targets we limited ourselves to Becke-like options as they are listed in table 1. expected to give most accurate results as concluded from GAMESS-UK electronic structure package 725 the above error analysis. In particular, we implemented m ¼ 4 and a ¼ 0.6651 gives noticeably less accurate the Becke, SSF [64] and MHL [65] nuclear weights. results but is much cheaper to use than either Testing these nuclear-weight functions demonstrated MHL8SSF or the original MHL function. However, that although the SSF function had a low computational MHL4SSF still gives more accurate results than the cost it also gave the least accurate results, due to the original SSF function. Thus we recommend using nuclear-weight function of an atom being forced to zero MHL8SSF over MHL for accurate calculations because before another atom is reached. This has the advantage of its lower cost, and we recommend using MHL4SSF that there are easily identifiable regions where the for low accuracy calculations. nuclear-weight function equals one and regions where it equals zero. This can be exploited to save work but it 3.3.2. Selection of quadrature grids. We have imple- leads to larger errors near the point where the partition mented the Euler–MacLaurin [65] and the Mura– reaches zero. The MHL function was found to give the Knowles [66] radial grids. The Mura–Knowles transfor- most accurate result but it is also relatively expensive as mation tends to have a higher density of grid points it involves an 11-term polynomial. In a bid to combine close to the nucleus, resulting in a much larger fraction the lower cost of the SSF function with the high of the grid points being positioned in locations where accuracy of the MHL function two new functions were they make significant contributions. Thus for a given designed as follows. grid size the Mura–Knowles gives more accurate results In the SSF scheme the nuclear-weight function is than the Euler–MacLaurin grid [66], and we have defined as chosen this transformation as the default. We also chose to use the scaling parameters recommended by wAðz; aÞ¼ 1, ABðzÞ a, Mura et al. However, we extrapolated the table to cover
¼ pSSFð ABðzÞ; aÞ, a <