REDUCE

20.43 QSUM: Indefinite and Definite Summation of q-Hypergeometric Terms

Authors: Harald Böing and Wolfram Koepf

20.43.1 Introduction

\( \newcommand {\qphihyp }[5]{{}_{#1}\phi _{#2}\left .\left [\begin {array}{c} #3 \\ #4 \end {array}\right |q,#5\right ]} \newcommand {\qpsihyp }[5]{{}_{#1}\psi _{#2}\left .\left [\begin {array}{c} #3 \\ #4 \end {array}\right |q,#5\right ]} \newcommand {\hyp }[5]{{}_{#1}F_{#2}\left .\left [\begin {array}{c} #3 \\ #4 \end {array}\right |#5\right ]} \newcommand {\fcn }[2]{{\mathrm #1}(#2)} \newcommand {\ifcn }[3]{{\mathrm #1}_{#2}(#3)} \newcommand {\qfac }[2]{\left (#1;\,q\right )_{#2}} \newcommand {\qbinomial }[2]{{\binom {#1}{#2}\!}_q} \)This package is an implementation of the \(q\)-analogues of Gosper’s and Zeilberger’s42 algorithm for indefinite, and definite summation of \(q\)-hypergeometric terms, respectively.

An expression \(a_k\) is called a \(q\)-hypergeometric term, if \(a_{k}/a_{k-1}\) is a rational function with respect to \(q^k\). Most \(q\)-terms are based on the \(q\)-shifted factorial or qpochhammer. Other typical \(q\)-hypergeometric terms are ratios of products of powers, \(q\)-factorials, \(q\)-binomial coefficients, and \(q\)-shifted factorials that are integer-linear in their arguments.

20.43.2 Elementary q-Functions

Our package supports the input of the following elementary \(q\)-functions:

Furthermore it is possible to use an abbreviation for the generalized \(q\)-hypergeometric series (basic generalized hypergeometric series, see e. g. [GR90], Chapter 1) which is defined as: \begin {multline} \qphihyp {r}{s}{a_1,a_2,\ldots ,a_r}{b_1,b_2,\ldots ,b_s}{z}:=\\ \sum _{k=0}^{\infty }{\frac {\qfac {a_1,a_2,\ldots ,a_r}{k}} {\qfac {b_1,b_2,\ldots ,b_s}{k}} \,\frac {z^k}{\qfac {q}{k}}\,\left [(-1)^k\, q^{\binom {k}{2}}\right ]^{1+s-r}} \end {multline} where \(\qfac {a_1,a_2,\ldots ,a_r}{k}\) is a short form to write the product \(\prod _{j=1}^r{\qfac {a_j}{k}}\). An \({}_r\phi _s\) series terminates if one of its numerator parameters is of the form \(q^{-n}\) with \(n\in \mathbb {N}\). The additional factor \(\left [(-1)^k\,q^{\binom {k}{2}}\right ]^{1+s-r}\) (which does not occur in the corresponding definition of the generalized hypergeometric function) is due to a confluence process. With this factor one gets the simple formula: \[ \lim _{a_r\rightarrow \infty }{\qphihyp {r}{s}{a_1,a_2,\ldots ,a_r} {b_1,b_2,\ldots ,b_s}{z}} = {\qphihyp {r-1}{s}{a_1,a_2,\ldots ,a_{r-1}}{b_1,b_2,\ldots ,b_s}{z}}. \] Another variation is the bilateral basic hypergeometric series (see e. g. [GR90], Chapter 5) that is defined as \[ \qpsihyp {r}{s}{a_1,a_2,\ldots ,a_r}{b_1,b_2,\ldots ,b_s}{z}:= \sum _{k=-\infty }^{\infty }{\frac {\qfac {a_1,a_2,\ldots ,a_r}{k}} {\qfac {b_1,b_2,\ldots ,b_s}{k}}\,z^k\, \left [(-1)^k\,q^{\binom {k}{2}}\right ]^{s-r}}. \] The summands of those generalized \(q\)-hypergeometric series may be entered by

respectively.

20.43.3 q-Gosper Algorithm

The \(q\)-Gosper algorithm[Koo93] is a decision procedure, that decides by algebraic calculations whether or not a given \(q\)-hypergeometric term \(a_k\) has a \(q\)-hypergeometric term antidifference \(g_k\), i. e. \(a_k=g_{k}-g_{k-1}\) with \(g_{k}/g_{k-1}\) rational in \(q^k\). The ratio \(g_k/a_k\) is also rational in \(q^k\) — an important fact which makes the rational certification (see § 20.43.4) of Zeilberger’s algorithm possible. If the procedure is successful it returns \(g_k\), in which case we call \(a_k\) \(q\)-Gosper-summable. Otherwise no \(q\)-hypergeometric antidifference exists. Therefore if the \(q\)-Gosper algorithm does not return a \(q\)-hypergeometric antidifference, it has proved that no such solution exists, an information that may be quite useful and important.

Any antidifference is uniquely determined up to a constant, and is denoted by \[ g_k=\sum a_k\,\delta _k \;. \] Finding \(g_k\) given \(a_k\) is called indefinite summation. The antidifference operator \(\Sigma \) is the inverse of the downward difference operator \(\nabla a_k=a_{k}-a_{k-1}\). There is an analogous summation theory corresponding to the upward difference operator \(\Delta a_k=a_{k+1}-a_k\).

In case, an antidifference \(g_k\) of \(a_k\) is known, any sum \(\sum _{k=m}^n{a_k}\) can be easily calculated by an evaluation of \(g\) at the boundary points like in the integration case: \[ \sum _{k=m}^{n}{a_k} = g_{n}-g_{m-1} \]

20.43.4 q-Zeilberger Algorithm

The \(q\)-Zeilberger algorithm [Koo93] deals with the definite summation of \(q\)-hypergeometric terms \(\fcn {f}{n,k}\) wrt. \(n\) and \(k\): \[ \fcn {s}{n}:= \sum _{k=-\infty }^\infty {\fcn {f}{n,k}} \] Zeilberger’s idea is to use Gosper’s algorithm to find an inhomogeneous recurrence equation with polynomial coefficients for \(\fcn {f}{n,k}\) of the form \begin {equation} \label {eq:f_n_k-recursion} \sum _{j=0}^J{\ifcn {\sigma }{j}{n}\cdot \fcn {f}{n+j,k}} = \fcn {g}{k}-\fcn {g}{k-1}, \end {equation} where \(\fcn {g}{k}/\fcn {f}{k}\) is rational in \(q^k\) and \(q^n\). Assuming finite support of \(\fcn {f}{n,k}\) wrt. \(k\) (i. e. \(\fcn {f}{n,k}=0\) for any \(n\) and all sufficiently large \(k\)) we can sum equation (\ref {eq:f_n_k-recursion}) over all \(k\in \mathbb {Z}\). Thus we receive a homogeneous recurrence equation with polynomial coefficients (called holonomic equation) for \(\fcn {s}{n}\): \begin {equation} \label {holonomic_recurrence} \sum _{j=0}^J{\ifcn {\sigma }{j}{n}\cdot \fcn {s}{n+j}} = 0 \end {equation} At this stage the implementation assumes that the summation bounds are infinite and the input term has finite support wrt. \(k\). If those input requirements are not fulfilled the resulting recursion is probably not valid. Thus we strongly advise the user to check those requirements.

Despite this restriction you may still be able to get valuable information by the program: On request it returns the left hand side of the recurrence equation (\ref {holonomic_recurrence}) and the antidifference \(\fcn {g}{k}\) of equation (\ref {eq:f_n_k-recursion}).

Once you have the certificate \(\fcn {g}{k}\) it is trivial (at least theoretically) to prove equation (\ref {holonomic_recurrence}) as long as the input requirements are fulfilled. Let’s assume somone gives us equation (\ref {eq:f_n_k-recursion}). If we divide it by \(\fcn {f}{n,k}\) we get a rational identity (in \(q^n\) and \(q^k\)) —due to the fact that \(\fcn {g}{k}/\fcn {f}{n,k}\) is rational in \(q^n\) and \(q^k\). Once we confirmed this identity we sum equation (\ref {eq:f_n_k-recursion}) over \(k\in \mathbb {Z}\): \begin {equation} \sum _{k\in \mathbb {Z}}\sum _{j=0}^J{\ifcn {\sigma }{j}{n}\cdot \fcn {f}{n+j,k}} = \sum _{k\in \mathbb {Z}}{\left (\fcn {g}{k}-\fcn {g}{k-1}\right )}, \end {equation} Again we exploit the fact that \(\fcn {g}{k}\) is a rational multiple of \(\fcn {f}{n,k}\) and thus \(\fcn {g}{k}\) has finite support which makes the telescoping sum on the right hand side vanish. If we exchange the order of summation we get equation (\ref {holonomic_recurrence}) which finishes the proof.

Note that we may relax the requirements for \(\fcn {f}{n,k}\): An infinite support is possible as long as \(\lim \limits _{k\rightarrow \infty }{\fcn {g}{k}}=0\). (This is certainly true if \(\lim \limits _{k\rightarrow \infty }{\fcn {p}{k}\,\fcn {f}{k}}=0\) for all polynomials \(\fcn {p}{k}\).)

For a quite general class of \(q\)-hypergeometric terms (proper q-hypergeometric terms) the \(q\)-Zeilberger algorithm always finds a recurrence equation, not necessarily of lowest order though. Unlike Zeilberger’s original algorithm its \(q\)-analogue more often fails to determine the recursion of lowest possible order, however (see [PR95]).

If the resulting recurrence equation is of first order \[ \fcn {a}{n}\,\fcn {s}{n-1}+\fcn {b}{n}\,\fcn {s}{n}=0 \;, \] \(\fcn {s}{n}\) turns out to be a \(q\)-hypergeometric term (as a and b are polynomials in \(q^n\)), and a \(q\)-hypergeometric solution can be easily established using a suitable initial value.

If the resulting recurrence equation has order larger than one, this information can be used for identification purposes: Any other expression satisfying the same recurrence equation, and the same initial values, represents the same function.

Our implementation is mainly based on [Koo93] and on the hypergeometric analogue described in [Koe95a]. More examples can be found in [GR90], [Gas95], some of which are contained in the test file qsum.tst.

20.43.5 REDUCE operator qgosper

The qgosper operator is an implementation of the \(q\)-Gosper algorithm.

Examples: The following two examples can be found in [GR90] ((II.3) and (2.3.4)).


1: qgosper(qpochhammer(a,q,k)*q^k/qpochhammer(q,q,k),q,k);

   k
 (q *a - 1)*qpochhammer(a,q,k)
-------------------------------
  (a - 1)*qpochhammer(q,q,k)

2: qgosper(qpochhammer(a,q,k)*qpochhammer(a*q^2,q^2,k)*
   qpochhammer(q^(-n),q,k)*q^(n*k)/(qpochhammer(a,q^2,k)*
   qpochhammer(a*q^(n+1),q,k)*qpochhammer(q,q,k)),q,k);

    k*n   k          k    n
( - q   *(q *a - 1)*(q  - q )

               1                       2  2
 *qpochhammer(----,q,k)*qpochhammer(a*q ,q ,k)
                n
               q

                         2*k          n
 *qpochhammer(a,q,k))/((q   *a - 1)*(q  - 1)

                 n                         2
   *qpochhammer(q *a*q,q,k)*qpochhammer(a,q ,k)

   *qpochhammer(q,q,k))

Here are some other simple examples:


3: qgosper(qpochhammer(q^(-n),q,k)*z^k
                    /qpochhammer(q,q,k),q,k);

***** No q-hypergeometric antidifference exists.

4: off qgosper_down;

5: qgosper(q^k*qbrackets(k,q),q,k);

     k           k
  - q *(q + 1 - q )*qbrackets(k,q)
-----------------------------------
       k
     (q  - 1)*(q + 1)*(q - 1)

6: on qgosper_down;

7: qgosper(q^k,q,k,0,n);

  n
 q *q - 1
----------
  q - 1

20.43.6 REDUCE operator qsumrecursion

The qsumrecursion operator is an implementation of the \(q\)-Zeilberger algorithm. It tries to determine a homogeneous recurrence equation for \(\fcn {summ}{n}\) wrt. \(n\) with polynomial coefficients (in \(n\)), where \[ \fcn {summ}{n}:= \sum _{k=-\infty }^{\infty }{\fcn {f}{n,k}}. \] If successful the left hand side of the recurrence equation (\ref {holonomic_recurrence}) is returned.

There are three different ways to pass a summand \(\fcn {f}{n,k}\) to qsumrecursion:

i. e. upper and lower are lists of upper and lower parameters of the generalized \(q\)-hypergeometric function. The third form is handy if you have any additional factors.

For all three instances the following variations are allowed:

As a first example we want to consider the q-binomial theorem: \[ \sum _{k=0}^\infty {\frac {\qfac {a}{k}}{\qfac {q}{k}}z^k} = \frac {\qfac {a\,z}{\infty }}{\qfac {z}{\infty }}, \] provided that \(|z|,|q|<1\). It is the \(q\)-analogue of the binomial theorem in the sense that \[ \lim _{q\rightarrow {}1^-}\;{\sum _{k=0}^\infty { \frac {\qfac {q^a}{k}}{\qfac {q}{k}}z^k}} \;\;=\;\; \sum _{k=0}^\infty {\frac {(a)_k}{k!}z^k} \;\;=\;\; (1-z)^{-a}\;. \] For \(a:=q^{-n}\) with \(n\in \mathbb {N}\) our implementation gets:


8: qsumrecursion(qpochhammer(q^(-n),q,k)*z^k/
   qpochhammer(q,q,k),q,k,n);

      n                     n
 - ((q  - z)*summ(n - 1) - q *summ(n))

Notice that the input requirements are fulfilled. For \(n\in \mathbb {N}\) the summand is zero for all \(k>n\) as \(\qfac {q^{-n}}{k}=0\) and the \(\qfac {q}{k}\)-term in the denominator makes the summand vanish for all \(k<0\).

With the switch qsumrecursion_certificate it is possible to get the antidifference \(g_k\) described above. When switched on, qsumrecursion returns a list with five entries, see § 20.43.8. For the last example we get:


9: on qsumrecursion_certificate;

10: proof:= qsumrecursion(qpochhammer(q^(-n),q,k)*z^k/
    qpochhammer(q,q,k),q,k,n);

                n                     n
proof :=  - ((q  - z)*summ(n - 1) - q *summ(n)),

                k    n
            - (q  - q )*z
          ----------------,
                n
               q  - 1

            k              1
           z *qpochhammer(----,q,k)
                            n
                           q
          --------------------------,
              qpochhammer(q,q,k)

          k,

          downward_antidifference

11: off qsumrecursion_certificate;

Let’s define the list entries as {rec,cert,f,k,dir}. If you substitute \(\fcn {summ}{n+j}\) by \(\fcn {f}{n+j,k}\) in rec then you obtain the left hand side of equation (\ref {eq:f_n_k-recursion}), where f is the input summand. The function \(\fcn {g}{k}:=\texttt {f*cert}\) is the corresponding antidifference, where dir states which sort of antidifference was calculated downward_antidifference or upward_antidifference, see also § 20.43.8. Those informations enable you to prove the recurrence equation for the sum or supply you with the necessary informations to determine an inhomogeneous recurrence equation for a sum with nonnatural bounds.

For our last example we can now calculate both sides of equation (\ref {eq:f_n_k-recursion}):


12: lhside:= qsimpcomb(sub(summ(n)=part(proof,3),
    summ(n-1)=sub(n=n-1,part(proof,3)),part(proof,1)));

            k   k   n         n
lhside := (z *(q *(q  - z) + q *(z - 1))

                         1            n
           *qpochhammer(----,q,k))/((q  - 1)
                          n
                         q

             *qpochhammer(q,q,k))

13: rhside:= qsimpcomb((part(proof,2)*part(proof,3)-
    sub(k=k-1,part(proof,2)*part(proof,3))));

               k    k    n       n   k
rhside := ( - z *((q  - q )*z - q *(q  - 1))

                         1            n
           *qpochhammer(----,q,k))/((q  - 1)
                          n
                         q

             *qpochhammer(q,q,k))

14: qsimpcomb((rhside-lhside)/part(proof,3));

0

Thus we have proved the validity of the recurrence equation.

As some other examples we want to consider some generalizations of orthogonal polynomials from the Askey–Wilson–scheme [KS94]: The \(q\)-Laguerre (3.21), \(q\)-Charlier (3.23) and the continuous \(q\)-Jacobi (3.10) polynomials.


15: operator qlaguerre,qcharlier;

16: qsumrecursion(qpochhammer(q^(alpha+1),q,n)/
           qpochhammer(q,q,n),
           {q^(-n)}, {q^(alpha+1)}, q, -x*q^(n+alpha+1),
           qlaguerre(n));

           n       alpha + n   n
((q + 1 - q )*q - q         *(q *x + q))

*qlaguerre(n - 1) + (

     alpha + n
   (q          - q)*qlaguerre(n - 2)

        n
    + (q  - 1)*qlaguerre(n))*q

17: qsumrecursion({q^(-n),q^(-x)},{0},q,-q^(n+1)/a,
           qcharlier(n));

      x            n       n       2*n
 - ((q *((q + 1 - q )*a + q )*q - q   )

                         x
    *qcharlier(n - 1) + q *(

         n          n
       (q  + a*q)*(q  - q)*qcharlier(n - 2)

        - qcharlier(n)*a*q))

18: on qsum_nullspace;

19: term:= qpochhammer(q^(alpha+1),q,n)/qpochhammer(q,q,n)*
       qphihyperterm({q^(-n),q^(n+alpha+beta+1),
                      q^(alpha/2+1/4)*exp(I*theta),
                      q^(alpha/2+1/4)*exp(-I*theta)},
                    {q^(alpha+1),
                     -q^((alpha+beta+1)/2),
                     -q^((alpha+beta+2)/2)},
       q,q,k)$

20: qsumrecursion(term,q,k,n,2);



      n  i*theta   alpha   beta   n
 - ((q *e       *(q     *(q    *(q *(q + 1) - q)

                   alpha + beta + n


                      n    beta + n
           *(q + 1 - q  - q        )) -

         (alpha + beta)/2   alpha   n
        q                *(q     *(q *(q + 1) - q

                  beta + n           n
               + q        *(q + 1 - q ))

                2*alpha + beta + 2*n
            - (q                     + q)))

                       (2*alpha + 1)/4
     *(sqrt(q) + q) + q

        2*i*theta        alpha + beta + 2*n    2
     *(e          + 1)*(q                   - q )

        alpha + beta + 2*n
     *(q                   - 1))

       alpha + beta + 2*n
    *(q                   - q)*summ(n - 1) -

     i*theta    (alpha + beta + 2*n)/2
    e       *((q

                  (alpha + beta + 2*n)/2
               *(q                       + q)

                  (alpha + beta + 2*n)/2
               *(q                       - q)

               *(sqrt(q) + q) + (

                   (2*alpha + 2*beta + 4*n + 1)/2
                  q

                          alpha + beta + 2*n    2
                   + q)*(q                   - q )

                   alpha + beta + n        n
               )*(q                 - 1)*(q  - 1)

                           alpha
              *summ(n) + (q     *(sqrt(q)*q

                        alpha + beta + 2*n
                     + q                  ) +

                  (3*alpha + beta + 2*n)/2
                 q

                 *(sqrt(q) + q))

                 alpha + beta + 2*n
              *(q                   - 1)

                 alpha + n        beta + n
              *(q          - q)*(q         - q)

              *summ(n - 2)))

21: off qsum_nullspace;

The setting of qsum_nullspace (see [PR95] and § 20.43.8) results in a faster calculation of the recurrence equation for this example.

20.43.7 Simplification Operators

An essential step in the algorithms introduced above is to decide whether a term \(a_k\) is \(q\)-hypergeometric, i. e. if the ratio \(a_{k}/a_{k-1}\) is rational in \(q^k\).

The procedure qsimpcomb provides this facility. It tries to simplify all exponential expressions in the given term and applies some transformation rules to the known elementary \(q\)-functions as qpochhammer, qbrackets, qbinomial and qfactorial. Note that the procedure may fail to completely simplify some expressions. This is due to the fact that the procedure was designed to simplify ratios of \(q\)-hypergeometric terms in the form \(\fcn {f}{k}/\fcn {f}{k-1}\) and not arbitrary \(q\)-hypergeometric terms.

E. g. an expression like \(\qfac {a}{-n}\cdot \qfac {a/q^n}{n}\) is not recognized as 1, despite the transformation formula \[ \qfac {a}{-n} \;=\; \frac {1}{\qfac {a/q^n}{n}},\] which is valid for \(n\in \mathbb {N}\).

Note that due to necessary simplification of powers, the switch precise is (locally) turned off in qsimpcomb. This might produce wrong results if the input term contains e. g. complex variables.

The following synomyms may be used:

20.43.8 Global Variables and Switches

The following switches can be used in connection with the QSUM package:

The global variable qsumrecursion_recrange!* controls for which recursion orders the procedure qsumrecursion looks. It has to be a list with two entries, the first one representing the lowest and the second one the highest order of a recursion to search for. By default it is set to {1,5}.

20.43.9 Messages

The following messages may occur:


Hosted by Download REDUCE Powered by MathJax