Journal of Computational Physics 321 (2016) 927–931
Contents lists available at ScienceDirect
Journal of Computational Physics www.elsevier.com/locate/jcp
Short note
Improvements on the minimax algorithm for the Laplace transformation of orbital energy denominators Benjamin Helmich-Paris ∗ , Lucas Visscher Section of Theoretical Chemistry, VU University Amsterdam, De Boelelaan 1083, 1081 HV Amsterdam, The Netherlands
a r t i c l e
i n f o
a b s t r a c t
Article history: Received 28 October 2015 Received in revised form 18 March 2016 Accepted 7 June 2016 Available online 9 June 2016
We present a robust and non-heuristic algorithm that finds all extremum points of the error distribution function of numerically Laplace-transformed orbital energy denominators. The extremum point search is one of the two key steps for finding the minimax approximation. If pre-tabulation of initial guesses is supposed to be avoided, strategies for a sufficiently robust algorithm have not been discussed so far. We compare our nonheuristic approach with a bracketing and bisection algorithm and demonstrate that 3 times less function evaluations are required altogether when applying it to typical non-relativistic and relativistic quantum chemical systems. © 2016 Elsevier Inc. All rights reserved.
Keywords: Laplace transformation Møller–Plesset perturbation theory Remez algorithm Newton–Maehly algorithm Deflation
The numerical Laplace transformation (LT) of the orbital energy denominator (OED) was introduced by Almlöf [1] in 1991 to design fast algorithms for Møller–Plesset (MP) perturbation theory methods [2]. Since then it was shown by many authors that scaling of the operational count can be reduced for all those quantum chemistry methods that involve OEDs
1
εa − εi + εb − ε j
=
1
(1)
x
in their time-determining computational step [3–11]. Initially, Häser and Almlöf [2,12] obtained the parameters of the numerical quadrature for LT
1 x
∞ =
dt exp(−xt ) ≈ 0
k
ω¯ ν exp(−α¯ ν x)
(2)
ν =1
by least-squares (LS) minimization of the error distribution function (EDF)
ηk (x; {ω¯ ν }, {α¯ ν }) =
k
ω¯ ν exp(−α¯ ν x) −
ν =1
1 x
(3)
¯ ν } and {α¯ ν } are the k Laplace weights and exponents, respectively. For a better in the interval [xmin , xmax ], where {ω comparison and re-use of quadrature parameters for different OEDs, the quadrature interval is constrained by [1, R ] with R = xmax /xmin . The quadrature parameters for the original interval [xmin , xmax ] are then obtained by scaling
*
Corresponding author. E-mail addresses:
[email protected] (B. Helmich-Paris),
[email protected] (L. Visscher).
http://dx.doi.org/10.1016/j.jcp.2016.06.011 0021-9991/© 2016 Elsevier Inc. All rights reserved.
928
B. Helmich-Paris, L. Visscher / Journal of Computational Physics 321 (2016) 927–931
ω¯ ν = ων /xmin ,
(4)
α¯ ν = αν /xmin .
(5)
The unscaled quadrature parameters above are determined by the optimization procedure; the scaled parameters are employed in the subsequent quantum chemical calculation. It was shown by Takatsuka et al. [13] that when employing the minimax approximation (MA) errors of the numerical quadrature are very similar to those obtained from LS minimization. However, quadrature parameters are computed with a much smaller effort when the MA algorithm rather than LS minimization is chosen. In the present note we discuss solution strategies for one of the two key steps, which we believe are useful to report as they lead to improvements in the robustness and make the MA less dependent on pre-tabulated parameters. The key points of Ref. [13] are recalled in the following to sketch the algorithm. The solution of the MA is obtained by minimizing the maximum (Chebyshev) norm
δk,[1, R ] ({ων }, {αν }) = max |ηk (x; {ων }, {αν })| x∈[1, R ]
(6)
of the EDF with respect to quadrature parameters, which gives the parameters {ων∗ } and {αν∗ } of the best possible approximation with
δk,[1, R ] ({ων∗ }, {αν∗ }) ≤ δk,[1, R ] ({ων }, {αν }).
(7)
When applying the MA the EDF has the following properties:
• • • •
The EDF has 2k roots or nodal points (NP) {x0i }. The EDF has 2k + 1 extremum points (EP) {xi } with 1 = x0 < x1 < · · · < x2k = R.
Each of the 2k − 1 initially unknown EPs {xi } is confined by the interval [x0i , x0i +1 ]. At all 2k + 1 EPs {xi } the EDF is equal to the maximum norm
ηk (xi ; {ων∗ }, {αν∗ }) = (−1)i δk,[1, R ] ({ων∗ }, {αν∗ }).
(8)
The MA for the numerical quadrature for the LT is obtained by applying the Remez algorithm (RA), which repeats the two following steps until self-consistency is reached: 1. Determine the 2k − 1 unknown EPs of ηk (x; {ων }, {αν }) with the current set of quadrature parameters {ων } and {αν }. 2. Optimize the 2k + 1 parameters {ων }, {αν }, and δk,[1, R ] ({ων }, {αν }) by solving the 2k + 1 non-linear equations (8). Each of the two steps above is non-trivial. In the first step, all 2k − 1 unknown EPs {xi } of the EDF in the interval [1, R ] must be found. To tackle this problem, Takatsuka et al. proposed to determine the 2k roots {x0i } prior to the EPs. Then the EPs can be found easily by the Newton–Raphson (NR) algorithm when initializing each xi with the midpoint of the interval [x0i , x0i +1 ]. In this manner, instead of finding all 2k − 1 unknown EPs, all 2k roots {x0i } must be determined, which constitutes the same problem. No strategy to solve this issue was presented in Ref. [13], thus we assume that NPs were pre-tabulated — but not published — for different R by the authors and used as initial guesses for {x0i }. Concerning the second step, Eqs. (8) have one solution that can be obtained with the NR algorithm. But especially in the first iteration of the RA, NR will fail if the initial quadrature parameters are not close to solution. As shown by Takatsuka et al., this issue can be circumvented if one chooses pre-tabulated quadrature parameters {ων } and {αν }, which are published on a web page [14]. We have employed this strategy in the present work as well. How to find all NPs and EPs of ηk without pre-tabulation in a non-heuristic and robust way has not been discussed yet. We propose that the determination of all NPs of the EDF is not necessary. The EPs {xi } can be obtained directly from the first derivative of the EDF:
ηk (xi ) = −
k
αν ων exp(−αν xi ) +
ν =1
1
(xi )2
= 0.
(9)
Thus, bracketing the EPs by the neighboring roots becomes a redundant task at the optimization stage. If desirable, NPs can be obtained after Eq. (8) is solved to verify satisfaction of the alternation theorem. By a Taylor expansion of the exponential function, the equation above can be reformulated to give a polynomial of infinite order
0=1+
k
ν =1
ων
∞ 1 l =0
l!
(−1)l+1 ανl+1 (xi )l+2 .
(10)
All roots of an arbitrary polynomial P (x) can be computed back-to-back in a robust and non-heuristic way. Once the first root x01 is determined, the next root x02 is computed from the deflated polynomial P [1] (x) with P (x) = (x − x01 ) P [1] (x). Following those lines, a modified version of the Newton algorithm that finds all root of a polynomial subsequently by
B. Helmich-Paris, L. Visscher / Journal of Computational Physics 321 (2016) 927–931
Fig. 1. EDF ηk=2 (x) of the minimax solution in the interval [1, 10] together with first derivative function deflated versions.
929
[1] [2] ηk =2 (x) and its one- ηk = (x) and twofold ηk = (x) 2 2
applying deflation was proposed by Maehly [15,16]. The Newton–Maehly (NM) algorithm uses deflation implicitly, which avoids serious error accumulation from previous roots [17]. A new guess for an EP xi that fulfills Eq. (9) is computed with the NM algorithm according to
xi = xi −
ηk (xi ) ηk (xi ) − ηk (xi )
i −1
j =1 ( x i
− xj )−1
(11)
,
where {xj } with j = 1, . . . , i − 1 are the previously determined EPs.
To illustrate the EP search, the EDF ηk=2 (x) with R = 10.0 is shown in Fig. 1. The first derivative of the EDF depicted in Fig. 1 together with its one- and twofold deflated versions:
η2 (x) = (x − x1 ) η2 [1] (x),
η2 (x) is (12)
[2 ]
η2 (x) = (x − x1 ) (x − x2 ) η2 (x).
(13) [ j]
As it can be seen from Fig. 1, the roots of η2 (x) coincide with those of η2 (x) with j = 1, . . . , 2k − 2. The previous observations allow us to propose the following procedure for the first step of the RA: 1. Set the leftmost EP x1 to 1.0. 2. Initialize x2 with x1 and determine the next EP x2 from 3. For all further unknown EPs xi i
ηk (x) with the NR algorithm.
= 3, . . . , 2k, initialize xi with xi −1 (1 + δ) and find the leftmost root of − = 10 4 to avoid divisions by zero in Eq. (11).
ηk [i−2] (x) with
the NM algorithm. We set δ 4. Set the rightmost EP x2k+1 to R.
An alternative to applying the NM algorithm directly for searching EPs is to search for 2k NPs of the EDF by a bracketing and bisection algorithm. Since the number of roots is known in advance, one can probe for sign changes on a one-dimensional grid iteratively. First, the quadrature interval is partitioned into two sections with a grid point in the middle of each section. If all sign changes between two subsequent grid points are detected, the algorithm stops, otherwise the scanning is repeated with twice as many grid points (sections). Once the NPs are roughly located, the NR algorithm can be applied for refinement. The efficiency of such a bracketing and bisection (BB) algorithm depends strongly on the distribution of EDF’s NPs. Such an algorithm performs well if the NPs are spread uniformly over [1, R ], but it becomes extremely inefficient if they are clustered in one or more regions of [1, R ]. As shown in Fig. 2, the NPs are only spread uniformly over the search interval on the logarithmic scale. On the (natural) logarithmic scale the two smallest and the two largest NPs are separated approximately by 0.049 and 0.11, respectively. The application of such a BB procedure on the logarithmic scale is favorable but relies upon the fact that the NPs are distributed almost uniformly. To our knowledge there is no proof for this assumption and we call this BB procedure heuristic in contrast to the NM algorithm. The performance of both procedures for locating EPs is investigated for two typical though simple molecular systems with high relevance for non-relativistic and relativistic quantum chemistry, i.e. the adenine molecule (structure from Ref. [18]) and mercury dimer (a0 = 4.0 Å). For adenine and Hg2 the aug-cc-pVTZ [19] and relativistic double zeta [20] basis sets were employed, respectively. For those two molecules the upper bound of the quadrature interval is R = 110.9 and R = 7.0 × 106 . Start values for {ων } and {αν } were taken from Ref. [14]. In Table 1 the number of ηk or ηk evaluations, which are the time-determining for both strategies, are presented for adenine and Hg2 with k = 8 and k = 19, respectively. For adenine results for OEDs where the 1s occupied orbital is kept frozen (R = 67.5) are shown Table 1 as well. As it can be seen from Table 1, the total number function evaluations for the NM approach is factor of 3 less than for the BB approach.
930
B. Helmich-Paris, L. Visscher / Journal of Computational Physics 321 (2016) 927–931
Fig. 2. EDF
ηk=16 (x) of the minimax solution in the interval [1, 1000] displayed in logarithmic and normal scale.
Table 1 Number of function evaluations for tasks of the Remez algorithm for all-electron (AE) and frozen-core (FC) calculation with adenine using the aug-cc-pVTZ (ATZ) basis set and for Hg2 using the relativistic double zeta basis set (RDZ). Task
Root finding Extremum points Total
Adenine ATZ (AE)
Adenine ATZ (FC)
Hg2 RDZ (AE)
BB
NM
BB
NM
BB
NM
2771 364 3135
0 1007 1007
2758 326 3084
0 941 941
8616 659 9275
0 3454 3454
We conclude that to find the minimax approximation for the numerical quadrature of the Laplace transformation from Ref. [13], the Remez algorithm is applied. This involves determining all extremum points of the error distribution function. In the present work, the extremum points are searched directly without obtaining roots beforehand and without relying on pre-tabulated guesses for the nodal and/or extremum point search. All extremum points of the error distribution function are found back-to-back in a robust and non-heuristic way by applying the Newton–Maehly algorithm. A heuristic bracketing and bisection algorithm that determines nodal points additionally needs roughly three times more function evaluations for two typical orbital energy denominators appearing in non-relativistic and relativistic quantum chemical calculations. 1. Note The Fortran 90 routines to compute the minimax approximation on numerically Laplace-transformed orbital energy denominators are published as open source, freely available on GitHub [21]. Acknowledgements Financial support of the Deutsche Forschungsgemeinschaft (DFG) through grant number HE 7427/1-1 is gratefully acknowledged. References [1] J. Almlöf, Elimination of energy denominators in Møller–Plesset perturbation theory by a Laplace transform approach, Chem. Phys. Lett. 181 (4) (1991) 319–320. [2] M. Häser, J. Almlöf, Laplace transform techniques in Møller–Plesset perturbation theory, J. Chem. Phys. 96 (1) (1992) 489–494. [3] Y. Jung, R.C. Lochan, A.D. Dutoi, M. Head-Gordon, Scaled opposite-spin second order Møller–Plesset correlation energy: An economical electronic structure method, J. Chem. Phys. 121 (2004) 9793–9802. [4] B. Doser, D. Lambrecht, J. Kussmann, C. Ochsenfeld, Linear-scaling atomic orbital-based second-order Møller–Plesset perturbation theory by rigorous integral screening criteria, J. Chem. Phys. 130 (6) (2009) 064107. [5] D. Kats, M. Schütz, A multistate local coupled cluster CC2 response method based on the Laplace transform, J. Chem. Phys. 131 (12) (2009) 124117. [6] B. Helmich, C. Hättig, A pair natural orbital implementation of the coupled cluster model CC2 for excitation energies, J. Chem. Phys. 139 (8) (2013) 084114.
B. Helmich-Paris, L. Visscher / Journal of Computational Physics 321 (2016) 927–931
931
[7] M. Ben Del, J. Hutter, J. VandeVondele, Electron correlation in the condensed phase from a resolution of identity approach based on the Gaussian and plane waves scheme, J. Chem. Theory Comput. 9 (6) (2013) 2654–2671. [8] M. Kaltak, J. Klimeš, G. Kresse, Low scaling algorithms for the random phase approximation: Imaginary time and Laplace transformations, J. Chem. Theory Comput. 10 (6) (2014) 2498–2507. [9] D. Kats, D. Usvyat, M. Schütz, On the use of the Laplace transform in local correlation methods, Phys. Chem. Chem. Phys. 10 (2008) 3430–3439. [10] G. Schmitz, B. Helmich, C. Hättig, A O ( N 3 ) scaling PNO-MP2 method using a hybrid OSV-PNO approach with an iterative direct generation of OSVs, Mol. Phys. 111 (16–17) (2013) 2463–2476. [11] S.A. Maurer, J. Kussmann, C. Ochsenfeld, Communication: A reduced scaling J-engine based reformulation of SOS-MP2 using graphics processing units, J. Chem. Phys. 141 (5) (2014) 051106. [12] M. Häser, Møller–Plesset (MP2) perturbation theory for large molecules, Theor. Chem. Acc. 87 (1993) 147–173. [13] A. Takatsuka, S. Ten-no, W. Hackbusch, Minimax approximation for the decomposition of energy denominators in Laplace-transformed Møller–Plesset perturbation theories, J. Chem. Phys. 129 (4) (2008) 044112. [14] W. Hackbusch, Pre-tabulated Laplace exponents and weights from http://www.mis.mpg.de/scicomp/EXP_SUM/1_x/, April 2007. [15] H.J. Maehly, Zur iterativen Auflösung algebraischer Gleichungen, Z. Angew. Math. Phys. 5 (3) (1954) 260–263. [16] F.L. Bauer, J. Stoer, Algorithm 105: Newton Maehly, Commun. ACM 5 (7) (1962) 387–388. [17] W.H. Press, S.A. Teukolsky, W.T. Vetterling, B.P. Flannery, Numerical Recipes in Fortran 77, 2nd edition, Cambridge University Press, 1992, pp. 371–372 (Ch. Roots of polynomials). [18] M. Schreiber, M.R. Silva-Junior, S.P.A. Sauer, W. Thiel, Benchmarks for electronically excited states: CASPT2, CC2, CCSD, and CC3, J. Chem. Phys. 128 (13) (2008) 134110. [19] R.A. Kendall, T.H. Dunning, R.J. Harrison, Electron-affinities of the 1st-row atoms revisited – systematic basis-sets and wave-functions, J. Chem. Phys. 96 (1992) 6796–6806. [20] K.G. Dyall, A.S.P. Gomes, Revised relativistic basis sets for the 5d elements Hf – Hg, Theor. Chem. Acc. 125 (1–2) (2010) 97–100. [21] Source code available on https://github.com/bhelmichparis/laplace-minimax.git, June 2016.