I am looking for a way to express the q-Pochhammer symbol (a; q)_n which is explained on wikipedia as follow:
q-Pochhammer symbol (Wikipedia: https://en.wikipedia.org/wiki/Q-Pochhammer_symbol)Wikipedia
What I am not looking for is a way to evaluate to q-Pochhammer symbol (a; q)_n for given numerical values a, q, n as the function q_poch in q_analogues.py https://github.com/sagemath/sage/blob/develop/src/sage/combinat/q_analogues.py#L557 or the function qp in mpmath.py https://mpmath.org/doc/current/functions/qfunctions.html does.
My aim by expressing the q-Pochhammer symbol (a; q)_n and using it symbolically is to simplify a complex expressions like f = q**(n*k) * q_pochhammer(q**(-n-1), q**(-1), k) * q_pochhammer(q**(-n+1), q, k) by using simplify(f) and fractionise it then by numerator / denumerator = fraction(f). in order to yield the numerator and denumerator
Overall it is about transforming a complex expression containing one or more q-Pochhammer symbols into a rational expression f = numerator/denumerator.
Any ideas?
import sympy as sp
from sympy import *
#from mpmath import *
n, k, q = sp.symbols('n,k,q')
def fun_rational(fun, variables=[]):
fun = fun.simplify()
num, denum = fraction(fun)
print(num)
print(denum)
print(type(num))
print(type(denum))
fun_rational(factorial(n)/factorial(n - 3))
fun_rational(q**(n*k) * q_pochhammer(q**(-n-1), q**(-1), k) * q_pochhammer(q**(-n+1), q, k))
Piscina is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.