Up | Next | Prev | PrevTail | Tail |
Authors: Harald Böing and Wolfram Koepf
\( \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.
Our package supports the input of the following elementary \(q\)-functions:
qpochhammer(a,q,infinity)\[ \qfac {a}{\infty }:= \prod _{j=0}^{\infty }{\left (1-a\,q^j\right )} \]
qpochhammer(a,q,k)\[ \qfac {a}{k}:= \left \{\begin {array}{ccc} \prod _{j=0}^{k-1}{\left (1-a\,q^j\right )} && \mbox {if $k>0$} \\ 1 && \mbox {if $k=0$} \\ \prod _{j=1}^{k}{\left (1-a\,q^{-j}\right )^{-1}} && \mbox {if $k<0$} \end {array}\right . \]
qbrackets(k,q)\[ {}[q,k]:=\frac {q^k-1}{q-1} \]
qfactorial(k,q)\[ {}[k]_q!:= \frac {\qfac {q}{k}}{(1-q)^k} \]
qbinomial(n,k,q)\[ \qbinomial {n}{k}:= \frac {\qfac {q}{n}}{\qfac {q}{k}\cdot \qfac {q}{n-k}} \]
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
qphihyperterm(a1,a2,...,a3,b1,b2,...,b3,q,z,k) and
qpsihyperterm(a1,a2,...,a3,b1,b2,...,b3,q,z,k)
respectively.
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} \]
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.
The qgosper operator is an implementation of the \(q\)-Gosper algorithm.
qgosper(a,q,k) determines a \(q\)-hypergeometric antidifference. (By default it returns a downward antidifference, which may be changed by the switch qgosper_down; see also § 20.43.8.) If it does not return a q-hypergeometric antidifference, then such an antidifference does not exist.
qgosper(a,q,k,m,n) determines a closed formula for the definite sum \(\sum \limits _{k=m}^n a_k\) using the \(q\)-analogue of Gosper’s algorithm. This is only successful if q-Gosper’s algorithm applies.
Examples: The following two examples can be found in [GR90] ((II.3) and (2.3.4)).
Here are some other simple examples:
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:
qsumrecursion(f,q,k,n), where f is a \(q\)-hypergeometric term wrt. k and n, k is the summation variable and n the recursion variable, q is a symbol.
qsumrecursion(upper,lower,q,z,n) is a shortcut for
qsumrecursion(qphihyperterm(upper,lower,q,z,k),
q,k,n)
qsumrecursion(f,upper,lower,q,z,n) is a similar shortcut for
qsumrecursion(f*qphihyperterm(upper,lower,q,z,k),
q,k,n),
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:
If for some reason the recursion order is known in advance you can specify it as an additional (optional ) argument at the very end of the parameter sequence. There are two ways. If you just specify a positive integer, qsumrecursion looks only for a recurrence equation of this order. You can also specify a range by a list of two positive integers, i. e. the first one specifying the lowest and the second one the highest order.
By default qsumrecursion will search for recurrences of order from 1 to 5. (The global variable qsumrecursion_recrange!* controls this behavior, see § 20.43.8.)
Usually qsumrecursion uses summ as a name for the \(\mathrm {summ}\)-function defined above. If you want to use another operator, say e. g. s, then the following syntax applies: qsumrecursion(f,q,k,s(n))
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:
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:
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}):
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.
The setting of qsum_nullspace (see [PR95] and § 20.43.8) results in a faster calculation of the recurrence equation for this example.
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:
up_qratio(f,k) or qratio(f,k) for
qsimpcomb(sub(k=k+1,f)/f) and
down_qratio(f,k) for qsimpcomp(f/sub(k=k-1,f)).
The following switches can be used in connection with the QSUM package:
qsum_trace, default setting is off. If it is turned on some intermediate results are printed.
qgosper_down, default setting is on. It determines whether qgosper returns a downward or an upward antidifference \(g_k\) for the input term \(a_k\), i. e. \(a_k=g_k-g_{k-1}\) or \(a_k=g_{k+1}-g_k\) respectively.
qsumrecursion_down, default setting is on. If it is switched on a downward recurrence equation will be returned by qsumrecursion. Switching it off leads to an upward recurrence equation.
qsum_nullspace, default setting is off. The antidifference \(\fcn {g}{k}\) is always a rational multiple (in \(q^k\)) of the input term \(\fcn {f}{k}\). qgosper and qsumrecursion determine this certificate, which requires solving a set of linear equations. If the switch qsum_nullspace is turned on a modified nullspace-algorithm will be used for solving those equations. In general this method is slower. However if the resulting recurrence equation is quite complicated it might help to switch on qsum_nullspace. See also [Knu81] and [PR95].
qgosper_specialsol, default setting is on. The antidifference \(\fcn {g}{k}\) which is determined by qgosper might not be unique. If this switch is turned on, just one special solution is returned. If you want to see all solutions, you should turn the switch off.
qsumrecursion_exp, default setting is off. This switch determines if the coefficients of the resulting recurrence equation should be factored. Turning it off might speed up the calculation (if factoring is complicated). Note that when turning on qsum_nullspace usually no speedup occurs by switching qsumrecursion_exp on.
qsumrecursion_certificate, default off. As Zeilberger’s algorithm delivers a recurrence equation for a \(q\)-hypergeometric term \(\mathrm {f}(n,k)\), see equation (\ref {eq:f_n_k-recursion}), this switch is used to get all necessary informations for proving this recurrence equation.
If it is set on, instead of simply returning the resulting recurrence equation (for the sum)—if one exists—calling qsumrecursion returns a list {rec,cert,f,k,dir} with five items: The first entry contains the recurrence equation, while the other items enable you to prove the recurrence a posteriori by rational arithmetic.
If we denote by r the recurrence rec where we substituted the
summ-function by the input term
textttf (with the corresponding shifts in n) then
the following equation is valid: \[ \texttt {r = cert*f - sub(k=k-1,cert*f)} \] if dir=downward_antidifference
or \[ \texttt {r = sub(k=k+1,cert*f) - cert*f} \] if dir=upward_antidifference.
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}.
The following messages may occur:
If your call to qgosper or qsumrecursion reveals some incorrect syntax, e. g. wrong number of arguments or wrong type you may receive the following messages:
***** Wrong number of arguments.
or
***** Wrong type of arguments.
If you call qgosper with a summand term that is free of the summation variable you get
WARNING: Summand is independent of summation variable. ***** No q-hypergeometric antidifference exists.
If qgosper finds no antidifference it returns:
***** No q-hypergeometric antidifference exists.
If qsumrecursion finds no recursion in the specified range it returns:
***** Found no recursion. Use higher order.
(If you do not pass a range as an argument to qsumrecursion the default range in qsumrecursion_recrange!* will be used.)
If the input term passed to qgosper (qsumrecursion) is not \(q\)-hypergeometric wrt. the summation variable — say \(k\) — (and the recursion variable) then you get
***** Input term is probably not q-hypergeometric.
With all the examples we tested, our procedures decided properly whether the input term was \(q\)-hypergeometric or not. However, we cannot guarantee in general that qsimpcombalways returns an expression that looks rational in \(q^k\) if it actually is.
If the global variable qsumrecursion_recrange!* was assigned an invalid value:
Global variable qsumrecursion_recrange!* must be a list of two positive integers: {lo,hi} with lo<=hi. ***** Invalid value of qsumrecursion_recrange!*
Up | Next | Prev | PrevTail | Front |