Symbolic Expansion of Transcendental Functions: Stefan Weinzierl
Symbolic Expansion of Transcendental Functions: Stefan Weinzierl
Stefan Weinzierl
Abstract
Higher transcendental function occur frequently in the calculation of Feynman integrals
in quantum field theory. Their expansion in a small parameter is a non-trivial task. We
report on a computer program which allows the systematic expansion of certain classes of
functions. The algorithms are based on the Hopf algebra of nested sums. The program is
written in C++ and uses the GiNaC library.
PROGRAM SUMMARY
Title of program: nestedsums
Version: 1.0
Catalogue number:
Program obtained from: http://www.fis.unipr.it/˜stefanw/nestedsums
E-mail: [email protected]
License: GNU Public License
Computers: all
Operating system: all
Program language: C++
Memory required to execute: depending on the complexity of the problem, at least 64 MB RAM
recommended
Other programs called: GiNaC 0.8.3, a library for symbolic calculations in C++, is required. It
is available from http://www.ginac.de.
Optionally, the program can also be used interactively. In this case the program gTybalt, avail-
able from http://www.fis.unipr.it/˜stefanw/gtybalt.html is needed.
External files needed: none
Keywords: Multiple polylogarithms, Feynman integrals
Nature of the physical problem: Systematic expansion of higher transcendental functions in a
small parameter. These expansions occur for example in the calculation of loop integrals in
quantum field theory within dimensional regularization.
Method of solution: Algebraic manipulations of nested sums.
Restrictions on complexity of the problem: Usually limited only by the available memory.
Typical running time: Depending on the complexitiy of the problem, see also sect. 5 and 6.
2
LONG WRITE-UP
1 Introduction
Higher transcendental function, like hypergeometric functions or Appell functions, occur fre-
quently in the calculation of Feynman integrals in quantum field theory. Usually they appear
with a small parameter ε in some of their arguments. For example, within dimensional reg-
ularization [1], the small parameter ε is given by the deviation of D-dimensional space-time
from the four-dimensional value: D = 4 − 2ε. However, a solution in the form of transcen-
dental functions is not yet useful, since possible poles in ε have not been made explicit. What
is needed is a Laurent expansion in ε. In some cases this can be achieved with the help of an
integral representation [2]. However, this method is rather tedious and limited to cases where an
integral representation is known. Recently, algorithms have been developed for the systematic
expansion of certain classes of transcendental functions [3]. These algorithms are based on an
algebra of nested sums. In this paper we report on the implementation of these algorithms into
a computer library.
Although these algorithms allow in principle the expansion to any desired order, they grow
exponentially with the complexity of the problem. Therefore any implementation has to face
the fact, that at intermediate steps one possibly deals with very large expressions. Commercial
computer algebra systems are in these circumstances not always as reliable as one would like
them to be. Computer algebra systems like FORM [4] or GiNaC [5], which have been devel-
oped within the high-energy physics community, seem to be more appropriate. Here we report
on an implementation based on the GiNaC library.
GiNaC is a library written in C++, which allows the symbolic manipulation of expressions
within the programming language C++. There are several advantages to this approach: C++ is
a standardized programming language and supports object-oriented programming. The compi-
lation of the programs leads to efficiency in the performance. Furthermore, many development
tools like for the automatic generation of documentation are available. In addition the source
code is freely available.
The program library “nestedsums”, which we describe here, extends the capabilities of the
GiNaC library towards the expansion of transcendental functions. This is a domain, which up
to now is usually not available within commercial computer algebra systems.
The paper is organized as follows: In the next section the definitions of nested sums and their
main properties are briefly recalled. Section 3 gives an introduction to the design of the program
and aims at readers who wish to understand the source code. Section 4 is of a more practical
nature and describes how to install and use the program. Section 5 deals with checks that we
have performed and addresses issues like performance. Some simple examples are given in
section 6. Finally a summary is provided in section 7.
3
2 Theoretical Background
In this section we shortly review the algorithms for the systematic expansion of transcendental
functions. They are described in detail in [3]. They are based on a particular form of nested
sums, which we call Z-sums. Z-sums are defined by
i
xi11 xkk
Z(n; m1 , ..., mk ; x1 , ..., xk ) = ∑ m1 . . . i mk (1)
n≥i1 >i2 >...>ik >0 i1 k
and form a Hopf algebra. If the sums go to Infinity (n = ∞) the Z-sums are the multiple poly-
logarithms of Goncharov [6]:
For x1 = ... = xk = 1 the definition reduces to the Euler-Zagier sums [7, 8]:
The multiple polylogarithms of Goncharov contain as the notation already suggests as subsets
the classical polylogarithms Lin (x) [10], as well as Nielsen’s generalized polylogarithms [11]
and the two-dimensional harmonic polylogarithms introduced recently by Gehrmann and Remiddi
[13]. Euler-Zagier sums occur in the expansion of Gamma functions:
The usefulness of the Z-sums lies in the fact, that they interpolate between Goncharov’s multi-
ple polylogarithms and Euler-Zagier sums. In addition, the interpolation is compatible with the
algebra structure.
In addition to Z-sums, it is sometimes useful to introduce as well S-sums. S-sums are defined
by
xi11 xikk
S(n; m1 , ..., mk; x1 , ..., xk ) = ∑ m1 ...
i k mk
. (8)
n≥i1 ≥i2 ≥...≥ik ≥1 i1
4
The S-sums are closely related to the Z-sums, the difference being the upper summation bound-
ary for the nested sums: (i − 1) for Z-sums, i for S-sums. It is advantageous to introduce both
Z-sums and S-sums, since some properties are more naturally expressed in terms of Z-sums
while others are more naturally expressed in terms of S-sums. One can easily convert from the
notation with Z-sums to the notation with S-sums and vice versa.
Since the Z-sums form an algebra, any product of two Z-sums with the same upper summa-
tion bound n can always be reduced to a sum of single Z-sums. For example:
Z11 (n) · Z1(n) = Z21 (n) + Z12 (n) + 3 Z111 (n). (9)
The multiplication property is at the core of all our algorithms. In [3] we showed that four
generic types of sums can always be reduced to single Z-sums. These four types are:
Type A:
n
xi Γ(i + a1 + b1 ε) Γ(i + ak + bk ε)
∑ ... Z(i + o − 1, m1 , ..., ml , x1 , ..., xl ), (10)
i=1 (i + c) Γ(i + c1 + d1 ε) Γ(i + ck + dk ε)
m
Type B:
n−1
xi Γ(i + a1 + b1 ε) Γ(i + ak + bk ε)
∑ (i + c)m Γ(i + c1 + d1 ε) ... Γ(i + ck + dk ε) Z(i + o − 1, m1, ..., ml , x1, ..., xl )
i=1
yn−i Γ(n − i + a′1 + b′1 ε) Γ(n − i + a′k′ + b′k′ ε)
× ...
(n − i + c′ )m Γ(n − i + c′1 + d1′ ε) Γ(n − i + c′k′ + dk′ ′ ε)
′
Type C:
n
n xi Γ(i + a1 + b1 ε) Γ(i + ak + bk ε)
−∑ (−1)i ...
i=1
i (i + c)m Γ(i + c1 + d1 ε) Γ(i + ck + dk ε)
×S(i + o, m1, ..., ml , x1 , ..., xl ), (12)
Type D:
n−1
n xi Γ(i + a1 + b1 ε) Γ(i + ak + bk ε)
−∑ (−1)i ...
i=1
i (i + c)m Γ(i + c1 + d1 ε) Γ(i + ck + dk ε)
×S(i + o, m1, ..., ml , x1 , ..., xl )
yn−i Γ(n − i + a′1 + b′1 ε) Γ(n − i + a′k′ + b′k′ ε)
× ...
(n − i + c′ )m Γ(n − i + c′1 + d1′ ε) Γ(n − i + c′k′ + dk′ ′ ε)
′
Here, all a j , a′j , c j and c′j are integers, c, c′ , are nonnegative integers and o, o′ are integers.
For sums of type A the upper summation limit n may extend to Infinity. The program library
implements the algorithms for these four generic types of sums.
5
3 Design of the program
C++ allows for object-oriented programming. Wherever it was compatible with the required
efficiency, we tried to write the program according to this paradigm. In C++ objects are rep-
resented by classes together with methods, which operate on them. All our classes are derived
from the fundamental class basic, which GiNaC provides. In the following we describe shortly
the main classes of the program. The complete documentation is inserted as comments in the
source code and can easily be extracted and converted to latex or html format with tools like
“doxygen”.
3.1 Letters
Expressions of the form
xi
(14)
(i + c)m
occur quite often in the algorithms. They are represented by the specific class basic_letter
which has as data members a scale x, a summation index i, a degree m and an offset c. Two
instances of this class with the same index i can be multiplied, if they have the same offset or if
both degrees are integers, as for example in
xi yi (xy)i
= ,
(i + c)m1 (i + c)m2 (i + c)m1+m2
xi yi 1 xi 1 yi
= − . (15)
(i + c1 ) (i + c2 ) (c2 − c1 ) (i + c1 ) (c2 − c1 ) (i + c2 )
In the second line the multiplication reduces to partial fractioning. The multiplication operator
is overloaded and multiplications are performed whenever this is possible. This is illustrated in
the following code fragment:
// construct two basic_letters
ex l1 = basic_letter(x,m1,c,i);
ex l2 = basic_letter(y,m2,c,i);
// multiplication
ex l = l1 * l2 ;
// l is now basic_letter(x*y,m1+m2,c,i)
If the offset c equals zero, the object
xi
(16)
im
is represented by the derived class letter. We will later see that Z-sums are constructed from
these objects. Note that letter is derived from basic_letter and not vice versa. This is in
accordance with the general rule, that a derived class can be substituted everywhere, where the
base class is required. A further specialization occurs if the scale x is equal to one. The object
1
(17)
im
is represented by the class unit_letter, which is derived from letter. Fig. 1 summarizes
the inheritance relationships for letters.
6
basic
basic letter
letter
unit letter
Figure 1: The inheritance diagram for the class basic letter and its derived classes.
ex l1 = unit_letter((ex) 1);
ex Z1 = Zsum(n,lst(l1)); // Z1 is Z_{1}(n)
ex Z11 = Zsum(n,lst(l1,l1)); // Z11 is Z_{11}(n)
// multiplication
ex res = Z1 * Z11;
// res is now Z_{21}(n) + Z_{12}(n)+ 3*Z_{111}(n)
Γ(1 + b2 ε) Γ(i + a1 + b1 ε)
. (18)
Γ(1 + b1 ε) (i + a2 + b2 ε)
Z-sums
Nielsen polylogs
classical polylogs
b2, index and expansion_parameter this class has two integer data members, order and
flag_expand_status. The order-variable specifies to which order the object shall eventually
be expanded. The class is a “smart” class and expands itself into Euler-Zagier sums only if
flag_expand_status is set. The expansion is performed according to eq. 7.
In addition there is a class list_of_tgamma, which is a container for objects of the type
ratio_of_tgamma and represents a product of terms of the form as in eq. 18.
3.4 Algorithms
The classes transcendental_sum_type_A to transcendental_sum_type_D implement the
algorithms for the expansion of the sums given in eq. 10 to eq. 13. These classes do the hard
part of the work and are kept quite general. Since they are kept quite general, they are not
necessarily particular user-friendly. It is assumed that a user customizes these classes to his
own needs and writes his own interface. An example is provided by the interface classes in
the next subsection. We shortly discuss the class transcendental_sum_type_A. The other
three classes have a similar structure. The class transcendental_sum_type_A represents the
expression
Γ(1 + d1 ε) Γ(1 + dk ε)
...
Γ(1 + b1 ε) Γ(1 + bk ε)
n
xi Γ(i + a1 + b1 ε) Γ(i + ak + bk ε)
×∑ ... Z(i + o − 1, m1, ..., ml , x1 , ..., xl ). (19)
i=1 (i + c) Γ(i + c1 + d1 ε) Γ(i + ck + dk ε)
m
8
Apart from the prefactor Γ(1 + d1 ε)/Γ(1 + b1ε)...Γ(1 + dkε)/Γ(1 + bk ε) this class corresponds
exactly to eq. 10. The prefactor avoids that unnecessary terms involving Euler constants appear
in the expansion. The data members of this class are: n and index, representing the upper
summation limit and the summation index; letter, lst_of_gammas and subsum, representing
the expression xi /(i + c)m , the Gamma functions and the subsum, respectively. These members
are of type basic_letter, list_of_tgamma and Zsum, respectively. In addition there are the
data members expansion_parameter, order and flag_expand_status.
4.1 Installation
The program library can be obtained from
http://www.fis.unipr.it/˜stefanw/nestedsums
It requires the GiNaC library version 0.8.3 to be installed. After unpacking, the library for
nested sums is build by issuing the commands
./configure
make
make install
There are various options which can be passed to the configure script, an overview can be ob-
tained with ./configure --help.
After installation, the shell script nestedsums-config can be used to determine the compiler
and linker command line options required to compile and link a program with the nestedsums
library. For example, nestedsums-config --cppflags will give the path to the header files
of the library, whereas nestedsums-config --libs prints out the flags necesarry to link a
program against the library.
int main()
{
using namespace GiNaC;
symbol n("n");
ex l1 = unit_letter((ex) 1);
ex Z1 = Zsum(n,lst(l1));
ex Z11 = Zsum(n,lst(l1,l1));
// multiplication
10
ex res = Z1 * Z11;
After compilation and linking against the GiNaC library and the nestedsums library, one obtains
an executable, which will print out
3*EZ(n,1,1,1)+EZ(n,2,1)+EZ(n,1,2)
4.3 Documentation
The complete documentation of the program is inserted as comment lines in the source code.
The documentation can be extracted from the sources with the help of the documentation system
“doxygen” [14]. The program “doxygen” is freely available. Issuing in the top-level build
directory for the nestedsums library the commands
doxygen Doxyfile
will create a directory “reference” with the documentation in html and latex format.
./configure --with-nestedsums
http://www.fis.unipr.it/˜stefanw/gtybalt.html
This relation provides a check on the implementation of the conversion between Z- and S-
sums and on the multiplication of nested sums. A second class of checks is obtained for finite
sums by writing out the sums explicitly and to compare the result of a symbolic manipulation
11
with the result obtained from the explicit expression. Furthermore, identities obtained from
partial integration also yield useful relations which can be used for checks. In the class of
hypergeometric functions, Appell function and Kampé de Fériet functions we have for example
the relations:
For a given choice of the parameters, each term is expanded in ε independently and one verifies
that each relation yields zero up to the calculated order.
Table 1: CPU time in seconds for the multiplication of two harmonic sums on a 300 MHz
Pentium II with 64 MB RAM.
respectively. Our program allows us to obtain the result for arbitrary values for the ν j . For the
two specific cases we confirm the results of Gehrmann and Remiddi.
Although the program has been written carefully and many bugs have been eliminated dur-
ing the debugging phase, there is no guarantee that the program is bug-free. It should be clear,
that if the program is used to obtain results which are published in scientific journals, it is still
the responsibility of the user (and not of the author of the program) to make sure that these
results are correct.
We would like to give some indications on the efficiency of our algorithms. The inner parts
of the algorithms are based on the multiplication of nested sums and in this part efficiency is
mandatory. For the specific case of multiplication of harmonic sums there exists already a pro-
gram called “summer” which is written in FORM [18]. The comparison between the “summer”
program and our program for the multiplication of two harmonic sums
where each factor has k “one”’s in the index field is listed in table 5. As can be seen from
table 5, our program is almost a factor two faster. However, benchmarks tests should always be
taken with a certain care. Our program is fast, as long as all intermediate expressions fit into
the available RAM. No particular memory management facilities have been implemented. If
intermediate expressions exceed the available memory, the operating system resorts to swapping
pages, which slows down the execution time significantly.
6 Examples
In this section we give two example programs for the expansion of a hypergeometric function
and a Appell function, together with some indications on the CPU time required for the expan-
sion up to a specific order.
#include <iostream>
#include "ginac/ginac.h"
#include "nestedsums/nestedsums.h"
int main()
{
using namespace GiNaC;
13
order 1 2 3 4 5 6 7 8 9 10 11
2 F1 (aε, bε; 1 − cε; x) < 1 < 1 1 2 4 8 16 31 59 121 285
Table 2: CPU time in seconds for the expansion of a hypergeometric function on a 300 MHz
Pentium II with 64 MB RAM.
int order = 4;
// some polishing
F21 = convert_Zsums_to_standard_form(F21);
2 F1 (aε, bε; 1 − cε; x) = 1 + ab Li2 (x)ε2 + ab (c Li3 (x) + (a + b + c) S1,2 (x)) ε3 + O(ε4 ).
(28)
These sums are rather trivial and can be eliminated. It further collects the coefficients of each
Z-sum and brings the coefficients into a normal form. Table 6 shows the dependency of the
CPU time for the expansion of the hypergeometric function on the chosen order.
As a second example we give a short program, which expands the second Appell function
F2 (1, 1, ε; 1 + ε, 1 − ε; x, y) in ε:
#include <iostream>
#include "ginac/ginac.h"
#include "nestedsums/nestedsums.h"
14
order 1 2 3 4 5 6
F2 (1, 1, ε; 1 + ε, 1 − ε; x, y) < 1 < 1 2 9 49 279
Table 3: CPU time in seconds for the expansion of the second Appell function on a 300 MHz
Pentium II with 64 MB RAM.
int main()
{
using namespace GiNaC;
int order = 2;
// some polishing
F2 = convert_Zsums_to_standard_form(F2);
Table 6 shows the dependency of the CPU time for the expansion of the second Appell function
on the chosen order. The algorithm for the expansion of the Appell function is more complex
compared to the one for the hypergeometric function, a fact which is also reflected in the nec-
essary CPU time.
7 Summary
In this paper we have described the program library “nestedsums”. This library can be used
for the symbolic expansion of a certain class of transcendental functions and can be useful to
scientists in all fields. In particular these sort of expansions are required in the calculation of
higher order corrections to scattering processes in high energy physics. The library is written in
C++ and uses the GiNaC library.
15
Acknowledgements
I would like to thank Thomas Gehrmann for providing me with the program tdhpl [19].
References
[1] G. ’t Hooft and M. J. G. Veltman, Nucl. Phys. B44, 189 (1972);
C. G. Bollini and J. J. Giambiagi, Nuovo Cim. B12, 20 (1972);
G. M. Cicuta and E. Montaldi, Nuovo Cim. Lett. 4, 329 (1972).
[2] C. Anastasiou, E. W. N. Glover, and C. Oleari, Nucl. Phys. B572, 307 (2000), hep-
ph/9907494.
[5] C. Bauer, A. Frink, and R. Kreckel, J. Symbolic Computation 33, 1 (2002), cs.sc/0004015;
the GiNaC library is available at http://www.ginac.de.
[7] L. Euler, Novi Comm. Acad. Sci. Petropol. 20, 140 (1775).
[8] D. Zagier, First European Congress of Mathematics, Vol. II, Birkhauser, Boston , 497
(1994).
[10] L. Lewin, Polylogarithms and associated functions, (North Holland, Amsterdam, 1981).
[12] E. Remiddi and J. A. M. Vermaseren, Int. J. Mod. Phys. A15, 725 (2000), hep-ph/9905237.
[13] T. Gehrmann and E. Remiddi, Nucl. Phys. B601, 248 (2001), hep-ph/0008287.
16