def q_expansion(self,n=20): r""" Give the q-expansion of the quotient. """ var('q') et = qexp_eta(ZZ[['q']],n) etA= et.subs(q=q**self._arg_num).power_series(ZZ[['q']]) etB= et.subs(q=q**self._arg_den).power_series(ZZ[['q']]) res = etA**(self._exp_num)/etB**(self._exp_den) return res
def q_expansion(self,n=20): r""" Give the q-expansion of the quotient. """ eta = qexp_eta(ZZ[['q']],n) R = eta.parent() q = R.gens()[0] res = R(1) prefak = 0 for i in range(len(self._arguments)): res = res*eta.subs({q:q**self._arguments[i]})**self._exponents[i] prefak = prefak+self._arguments[i]*self._exponents[i] if prefak % 24 == 0: return res*q**(prefak/24) else: return res,prefak/24