qsum.rlg 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. Sun Aug 18 18:24:31 2002 run on Windows
  2. % Test file for the REDUCE package QSUM
  3. %
  4. % Copyright (c) Wolfram Koepf, Harald Boeing, Konrad-Zuse-Zentrum Berlin, 1997
  5. %
  6. % Implementation of the q-Gosper and q-Zeilberger algorithms
  7. %
  8. % Reference:
  9. %
  10. % Koornwinder, T. H.:
  11. % On Zeilberger's algorithm and its q-analogue: a rigorous description.
  12. % J. of Comput. and Appl. Math. 48, 1993, 91-111.
  13. %
  14. % Some examples are from
  15. %
  16. % Koekoek, R. and Swarttouw, R.F.:
  17. % The Askey-scheme of Hypergeometric Orthogonal Polynomials and its q-analogue.
  18. % Report 94-05, Technische Universiteit Delft, Faculty of Technical Mathematics
  19. % and Informatics, Delft, 1994.
  20. %
  21. % Gasper, G. and Rahman, M.:
  22. % Basic Hypergeometric Series.
  23. % Encyclopedia of Mathematics and its Applications 35.
  24. % Ed. by G.-C. Rota, Cambridge University Press, London and New York, 1990.
  25. % Results of manual qsum.tex
  26. %
  27. load qsum;
  28. qgosper(qpochhammer(a,q,k)*q^k/qpochhammer(q,q,k),q,k);
  29. k
  30. (q *a - 1)*qpochhammer(a,q,k)
  31. -------------------------------
  32. (a - 1)*qpochhammer(q,q,k)
  33. qgosper(qpochhammer(a,q,k)*qpochhammer(a*q^2,q^2,k)*
  34. qpochhammer(q^(-n),q,k)*q^(n*k)/(qpochhammer(a,q^2,k)*
  35. qpochhammer(a*q^(n+1),q,k)*qpochhammer(q,q,k)),q,k);
  36. k*n k k n 1 2 2
  37. ( - q *(q *a - 1)*(q - q )*qpochhammer(----,q,k)*qpochhammer(a*q ,q ,k)
  38. n
  39. q
  40. 2*k n n
  41. *qpochhammer(a,q,k))/((q *a - 1)*(q - 1)*qpochhammer(q *a*q,q,k)
  42. 2
  43. *qpochhammer(a,q ,k)*qpochhammer(q,q,k))
  44. qgosper(qpochhammer(q^(-n),q,k)*z^k/qpochhammer(q,q,k)*z^n,q,k);
  45. ***** No q-hypergeometric antidifference exists.
  46. off qgosper_down;
  47. qgosper(q^k*qbrackets(k,q),q,k);
  48. k k
  49. - q *(q + 1 - q )*qbrackets(k,q)
  50. -----------------------------------
  51. k
  52. (q - 1)*(q + 1)*(q - 1)
  53. on qgosper_down;
  54. qgosper(q^k,q,k,0,n);
  55. n
  56. q *q - 1
  57. ----------
  58. q - 1
  59. qsumrecursion(qpochhammer(q^(-n),q,k)*z^k/qpochhammer(q,q,k),q,k,n);
  60. n n
  61. - ((q - z)*summ(n - 1) - q *summ(n))
  62. on qsumrecursion_certificate;
  63. proof:=qsumrecursion(qpochhammer(q^(-n),q,k)*z^k/qpochhammer(q,q,k),q,k,n);
  64. n n
  65. proof := { - ((q - z)*summ(n - 1) - q *summ(n)),
  66. k n
  67. - (q - q )*z
  68. ----------------,
  69. n
  70. q - 1
  71. k 1
  72. z *qpochhammer(----,q,k)
  73. n
  74. q
  75. --------------------------,
  76. qpochhammer(q,q,k)
  77. k,
  78. downward_antidifference}
  79. off qsumrecursion_certificate;
  80. % proof of statement
  81. lhside:= qsimpcomb(sub(summ(n)=part(proof,3),
  82. summ(n-1)=sub(n=n-1,part(proof,3)),part(proof,1)));
  83. k k n n 1
  84. z *(q *(q - z) + q *(z - 1))*qpochhammer(----,q,k)
  85. n
  86. q
  87. lhside := -----------------------------------------------------
  88. n
  89. (q - 1)*qpochhammer(q,q,k)
  90. rhside:= qsimpcomb((part(proof,2)*part(proof,3)-
  91. sub(k=k-1,part(proof,2)*part(proof,3))));
  92. k k n n k 1
  93. - z *((q - q )*z - q *(q - 1))*qpochhammer(----,q,k)
  94. n
  95. q
  96. rhside := ---------------------------------------------------------
  97. n
  98. (q - 1)*qpochhammer(q,q,k)
  99. qsimpcomb((rhside-lhside)/part(proof,3));
  100. 0
  101. % proof done
  102. operator qlaguerre, qcharlier;
  103. % q-Laguerre polynomials, Koekoek, Swarttouw (3.21)
  104. qsumrecursion(qpochhammer(q^(alpha+1),q,n)/qpochhammer(q,q,n),
  105. {q^(-n)}, {q^(alpha+1)}, q, -x*q^(n+alpha+1), qlaguerre(n));
  106. n alpha + n n
  107. ((q + 1 - q )*q - q *(q *x + q))*qlaguerre(n - 1)
  108. alpha + n n
  109. + ((q - q)*qlaguerre(n - 2) + (q - 1)*qlaguerre(n))*q
  110. % q-Charlier polynomials, Koekoek, Swarttouw (3.23)
  111. qsumrecursion({q^(-n),q^(-x)},{0},q,-q^(n+1)/a,qcharlier(n));
  112. x n n 2*n
  113. - ((q *((q + 1 - q )*a + q )*q - q )*qcharlier(n - 1)
  114. x n n
  115. + q *((q + a*q)*(q - q)*qcharlier(n - 2) - qcharlier(n)*a*q))
  116. % continuous q-Jacobi polynomials, Koekoek, Swarttouw (3.10)
  117. %% on qsum_nullspace;
  118. %% term:= qpochhammer(q^(alpha+1),q,n)/qpochhammer(q,q,n)*
  119. %% qphihyperterm({q^(-n),q^(n+alpha+beta+1),
  120. %% q^(alpha/2+1/4)*exp(I*theta), q^(alpha/2+1/4)*exp(-I*theta)},
  121. %% {q^(alpha+1), -q^((alpha+beta+1)/2), -q^((alpha+beta+2)/2)},
  122. %% q, q, k)$
  123. %% qsumrecursion(term,q,k,n,2);
  124. %% off qsum_nullspace;
  125. % Some more qgosper results with proof
  126. %
  127. % Gasper, Rahman (2.3.4)
  128. term:=qpochhammer(a,q,k)*qpochhammer(a*q^2,q^2,k)*qpochhammer(q^(-n),q,k)*
  129. q^(n*k)/(qpochhammer(a,q^2,k)*qpochhammer(a*q^(n+1),q,k)*qpochhammer(q,q,k));
  130. k*n 1 2 2
  131. q *qpochhammer(----,q,k)*qpochhammer(a*q ,q ,k)*qpochhammer(a,q,k)
  132. n
  133. q
  134. term := ----------------------------------------------------------------------
  135. n 2
  136. qpochhammer(q *a*q,q,k)*qpochhammer(a,q ,k)*qpochhammer(q,q,k)
  137. result:=qgosper(qpochhammer(a,q,k)*qpochhammer(a*q^2,q^2,k)*
  138. qpochhammer(q^(-n),q,k)*q^(n*k)/
  139. (qpochhammer(a,q^2,k)*qpochhammer(a*q^(n+1),q,k)*qpochhammer(q,q,k)),q,k);
  140. k*n k k n 1
  141. result := ( - q *(q *a - 1)*(q - q )*qpochhammer(----,q,k)
  142. n
  143. q
  144. 2 2 2*k n
  145. *qpochhammer(a*q ,q ,k)*qpochhammer(a,q,k))/((q *a - 1)*(q - 1)
  146. n 2
  147. *qpochhammer(q *a*q,q,k)*qpochhammer(a,q ,k)*qpochhammer(q,q,k))
  148. qsimpcomb(result-sub(k=k-1,result)-term);
  149. 0
  150. % Gasper, Rahman (3.8.16)
  151. term:=(1-a*c*q^(4*k))*(1-b/c*q^(-2*k))*qpochhammer(a,q,k)*qpochhammer(b,q,k)*
  152. qpochhammer(q^(-3*n),q^3,k)*qpochhammer(a*c^2/b*q^(3*n),q^3,k)*q^(3*k)/
  153. ((1-a*c)*(1-b/c)*qpochhammer(c*q^3,q^3,k)*qpochhammer(a*c/b*q^3,q^3,k)*
  154. qpochhammer(a*c*q^(3*n+1),q,k)*qpochhammer(b/c*q^(1-3*n),q,k));
  155. 3*n 2
  156. k q *a*c 3 1 3
  157. term := (q *qpochhammer(-----------,q ,k)*qpochhammer(------,q ,k)
  158. b 3*n
  159. q
  160. *qpochhammer(a,q,k)*qpochhammer(b,q,k)
  161. 3
  162. 6*k 2 4*k 2*k a*c*q 3
  163. *( - q *a*c + q *a*b*c + q *c - b))/(qpochhammer(--------,q ,k)
  164. b
  165. b*q 3*n
  166. *qpochhammer(--------,q,k)*qpochhammer(q *a*c*q,q,k)
  167. 3*n
  168. q *c
  169. 3 3 2
  170. *qpochhammer(c*q ,q ,k)*(a*b*c - a*c - b + c))
  171. result:=qgosper((1-a*c*q^(4*k))*(1-b/c*q^(-2*k))*qpochhammer(a,q,k)*
  172. qpochhammer(b,q,k)*qpochhammer(q^(-3*n),q^3,k)*qpochhammer(a*c^2/
  173. b*q^(3*n),q^3,k)*q^(3*k)/((1-a*c)*(1-b/c)*qpochhammer(c*q^3,q^3,k)*
  174. qpochhammer(a*c/b*q^3,q^3,k)*qpochhammer(a*c*q^(3*n+1),q,k)*
  175. qpochhammer(b/c*q^(1-3*n),q,k)),q,k);
  176. 3*k + 3*n 2 2*k k + n 2*n k k
  177. result := ( - (q *a*c - b)*(q + q + q )*(q *a - 1)*(q *b - 1)
  178. 3*n 2
  179. k n q *a*c 3 1 3
  180. *(q - q )*qpochhammer(-----------,q ,k)*qpochhammer(------,q ,k)
  181. b 3*n
  182. q
  183. 3*n
  184. *qpochhammer(a,q,k)*qpochhammer(b,q,k)*c)/((q *a*c - b)
  185. 3
  186. 3*n a*c*q 3
  187. *(q *c - 1)*(a*c - 1)*(b - c)*qpochhammer(--------,q ,k)
  188. b
  189. b*q 3*n
  190. *qpochhammer(--------,q,k)*qpochhammer(q *a*c*q,q,k)
  191. 3*n
  192. q *c
  193. 3 3
  194. *qpochhammer(c*q ,q ,k))
  195. qsimpcomb(result-sub(k=k-1,result)-term);
  196. 0
  197. end;
  198. Time for test: 19807 ms, plus GC time: 290 ms