####################################################### ## make-win-package qseries ## Sat, Jun 13, 2020 3:29:58 PM ####################################################### ####################################################### printf("BEGIN qseries package\n"); printf("THIS VERSION DATED Sat, Jun 13, 2020 3:29:58 PM \n"); qseries:=table(); qseries[aqprod]:=proc() #11/25/99: added else bit when n not an integer # (existed in an earlier version but got lost somehow) #09.07.14: can handle negative n #04.14.20: nargs version local x,i,n1,m1,x1,a,q,n: ############################################################################# if nargs=0 then printf("---------------------------------------------------------\n"); printf(" aqprod(a,q,n) \n"); printf(" (1-a)(1-aq)...(1-aq^(n-1)) when n is a nonnegative integer,\n"); printf(" ((1-aq^(-1))...(1-aq^n))^(-1) when n is negative integer. \n"); printf(" else returns a symbolic form. \n"); printf(" \n"); printf(" EXAMPLE: \n"); printf(" aqprod(a,q,n) \n"); printf(" aqprod(a,q,0) \n"); printf(" aqprod(a,q,5) \n"); printf(" aqprod(a,q,-5) \n"); printf(" \n"); printf("--------------------------------------------------------\n"); else if nargs=3 then a:=args[1]: q:=args[2]: n:=args[3]: if type(n,integer) then if n >=0 then x:=1: for i from 1 to n do x := x * (1-a*q^(i-1)): od: else n1:=-n: m1:=mul(1-q^(j+1)/a,j=0..n1-1): x1:=(-q/a)^n1*q^(n1*(n1-1)/2): RETURN(x1/m1): fi: else x:=``(a,q)[n]; fi: RETURN(x): else ERROR("nargs = 0 or 3"); fi: fi: end: qseries[briefqshelp]:=proc() local briefqshelpTAB,funcsL,tmp,a,qsprocname: qsprocname:=args[1]: funcsL:=qsfunctions(): if member(qsprocname,funcsL) then briefqshelpTAB:=table([ aqprod=[ " n-1 ", "FUNCTION : qseries[aqprod] - the product (1-a)(1-aq)..(1-aq ) ", " ", "CALLING SEQUENCE : aqprod(a,q,n); ", " ", "PARAMETERS : a,q - names ", " n - integer ", " ", " "],briefqshelp=[ "FUNCTION : qseries[briefqshelp] - brief help for a qseries function ", " ", "CALLING SEQUENCE : briefqshelp(funcname) ", " ", "PARAMETERS : funcname - name of qseries function ", " ", " "],qschanges=[ "FUNCTION : qseries[qschanges] - print out list of recent qschanges to ", " qseries package ", " ", " ", "CALLING SEQUENCE : qschanges() ", " ", " ", "PARAMETERS : none ", " ", " ", "GLOBAL VARIABLES : none ", " ", " "],checkmult=[ "FUNCTION : qseries[checkmult] - determine whether coefficients are multiplicative ", " ", " ", "CALLING SEQUENCE : checkmult() ", " checkmult(QS,T) ", " checkmult(QS,T,yes) ", " ", " ", "PARAMETERS : QS - q-series ", " T - positive integer ", " arg3 - yes/no ", " ", "GLOBAL VARIABLES : none ", " ", " "],checkprod=[ "FUNCTION : qseries[checkprod] - Check if q-series is a probable nice product ", " ", "CALLING SEQUENCE : checkprod(f,M,Q) ", " ", "PARAMETERS : f - q-series ", " M - positive integer ", " Q - positive integer ", " ", "GLOBAL VARIABLES : none ", " ", " "],dilatejaclist=[ "FUNCTION : qseries[dilatejaclist] - changes q to q^r in jaclist ", " ", "CALLING SEQUENCE : dilatejaclist() ", " dilatejaclist(jaclist,r) ", " ", " ", "PARAMETERS : jaclist - list ", " r - postive integer ", " ", " ", "GLOBAL VARIABLES : none ", " ", " "],dilateJterm=[ "FUNCTION : qseries[dilateJterm] - changes q to q^r in J-term ", " ", "CALLING SEQUENCE : dilateJterm() ", " dilatejaclist(jterm,r) ", " ", " ", "PARAMETERS : jterm - a product in J-notation ", " r - postive integer ", " ", " ", "GLOBAL VARIABLES : none ", " ", " "],etamake=[ "FUNCTION : qseries[etamake] - Convert a q-series into an eta-product expansion ", " ", "CALLING SEQUENCE : etamake(f,q,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", " "],etamakebeta=[ "FUNCTION : qseries[etamakebeta] - Convert a q-series into an eta-product expansion ", " ", "CALLING SEQUENCE : etamakebeta(f,q,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", " "],etaq=[ " ", "FUNCTION : qseries[etaq] - Dedekind eta product ", " ", "CALLING SEQUENCE : etaq(q,a,T) ", " ", "PARAMETERS : q - variable ", " a,T - positive integers ", " ", " "],findcong=[ "FUNCTION : qseries[findcong] - Find linear congruence ", " ", "VERSION: October 20, 2014: ", "PREVIOUS VERSION: June 17, 2010 ", "HELP UPDATE: April 23, 2020 ", " ", "CALLING SEQUENCE : findcong(QS,T) ", " findcong(QS,T,LM) ", " findcong(QS,T,LM,XSET) ", " ", "PARAMETERS : QS - q-series ", " T,LM - positive integers ", " XSET - set of positive integers ", " ", "GLOBAL VARIABLES : xprint ", " ", " "],findcongbeta=[ "FUNCTION : qseries[findcongbeta] - Find linear congruence ", " This is a beta version of findcong ", "VERSION: 09/09/2013 ", "PREVIOUS VERSION: 07/25/2012 ", " ", " ", "CALLING SEQUENCE : findcong(QS,T) ", " findcong(QS,T,LM) ", " findcong(QS,T,LM,XSET) ", " findcongbeta(QS,T,LM,XSET,xxTLIM) ", " ", "PARAMETERS : QS - q-series ", " T,LM - positive integers ", " XSET - set of positive integers ", " xxTLIM - positive integer ", " ", "GLOBAL VARIABLES : xprint ", " ", " "],findhom=[ "FUNCTION : qseries[findhom] - finds a set of potential homogeneous ", " relations among a list of q-series. ", " ", "CALLING SEQUENCE : findhom(L,q,n,topshift) ", " ", "PARAMETERS : L - list of q-series ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLE : X ", " ", " "],findhomcombo=[ "FUNCTION : qseries[findhomcombo] - tries to express a q-series as a ", " homogeneous polynomial of degree n of ", " a given list of q-series. ", " ", "CALLING SEQUENCE : findhomcombo(L,q,n,topshift,etaoption) ", " ", "PARAMETERS : L - list of q-series ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " etaoption - yes, no ", " ", "GLOBAL VARIABLE : X ", " ", " "],findhomcombomodp=[ "FUNCTION : qseries[findhomcombomodp] - tries to express a q-series as a ", " homogeneous polynomial of degree n of ", " a given list of q-series modulo p ", " ", " ", " ", "CALLING SEQUENCE : findhomcombomodp(f,L,p,q,n,topshift,etaoption) ", " ", " ", "PARAMETERS : L - list of q-series ", " p - prime ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " etaoption - yes, no ", " ", "GLOBAL VARIABLE : X ", " ", " "],findhommodp=[ "FUNCTION : qseries[findhommodp] - finds a set of potential homogeneous ", " relations modp among a list of q-series. ", " ", "CALLING SEQUENCE : findhommodp(L,p,q,n,topshift) ", " ", "PARAMETERS : L - list of q-series ", " p - prime ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLE : X ", " ", " "],findlincombo=[ "FUNCTION : qseries[findlincombo] - tries to express a q-series as a ", " linear combination of ", " a given list of q-series. ", " ", "CALLING SEQUENCE : findlincombo(f,L,SL,q,topshift) ", " ", " ", "PARAMETERS : L - list of q-series ", " SL - list of names ", " q - variable ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLES : ct, gooo ", " ", " "],findlincombomodp=[ "FUNCTION : qseries[findlincombomodp] - tries to express a q-series as a ", " linear combination mod p of ", " a given list of q-series. ", " ", "CALLING SEQUENCE : findlincombomodp(f,L,SL,p,q,topshift) ", " ", " ", "PARAMETERS : L - list of q-series ", " SL - list of names ", " p - prime ", " q - variable ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLES : ct, gooo ", " ", " "],findmaxind=[ "FUNCTION : qseries[findmaxind] - Find a maximal linearly independent subset of ", " q-series ", " ", "VERSION: November, 2017 ", "PREVIOUS VERSION: November, 2015 ", " ", "CALLING SEQUENCE : findmaxind() ", " findmaxind(XFL,T) ", " ", "PARAMETERS : XFL - list of q-polynomials ", " T - positive integers ", " ", " "],findnonhom=[ "FUNCTION : qseries[findhom] - finds a set of potential non-homogeneous ", " relations among a list of q-series. ", " ", "CALLING SEQUENCE : findnonhom(L,q,n,topshift) ", " ", "PARAMETERS : L - list of q-series ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLE : X ", " ", " "],findnonhomcombo=[ "FUNCTION : qseries[findnonhomcombo] - tries to express a q-series as ", " a polynomial of degree n of a ", " given list of q-series. ", " ", "CALLING SEQUENCE : findnonhomcombo(L,q,n,topshift,etaoption) ", " findnonhomcombo(L,q,n,topshift) ", " findnonhomcombo(L,q,n,etaoption) ", " findnonhomcombo(L,q,n) ", " ", "PARAMETERS : L - list of q-series ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " etaoption - yes, no ", " ", "GLOBAL VARIABLE : X ", " ", " "],findpoly=[ "FUNCTION : qseries[findpoly] - tries to find a polynomial relation between ", " two given q-series with degrees specified. ", " ", "CALLING SEQUENCE : findpoly(x,y,q,deg1,deg2,check) ", " findpoly(x,y,q,deg1,deg2) ", " ", "PARAMETERS : x,y - q-series ", " q - variable ", " deg1,deg2 - positive integers ", " check - positive integer ", " ", "GLOBAL VARIABLES : X, Y ", " ", " "],findprod=[ "FUNCTION : qseries[findprod] - ", " ", " ", "CALLING SEQUENCE : findprod(FL,T,M,Q) ", "qseries[findprod]:=proc(FL,T,M,Q) ## find z-linear combination of the ", " COMBS:=[]: ## functions in FL which is a prob.product ", " nfl:=nops(FL): ## T=max(abs) of coeffs in z-lin.combo ", " S:=[seq(j,j=-T..T)]: ## M=max(abs(multiplicity))) in prod ", " BS:=[seq(S,k=1..nfl)]:## Q is highest power of q ", " ", " ", "PARAMETERS : FL - list of q-series ", " T, M, Q - positive integers ", " ", "GLOBAL VARIABLES : none ", " ", " "],J2jaclist=[ "FUNCTION : qseries[J2jaclist] - convert jacprod to jac list ", " ", "VERSION: November, 2017 ", "PREVIOUS VERSION: November, 2015 ", " ", "CALLING SEQUENCE : J2jaclist() ", " J2jaclist(Jprod) ", " ", "PARAMETERS : Jprod - quotient of theta-functions encoded ", " in terms of J[b,a], J[b] ", "GLOBAL VAR: Jprod ", " ", " "],jac2J=[ "FUNCTION : qseries[jac2J] - a variant of jac2J ", " ", "CALLING SEQUENCE : jac2J() ", " jac2J(JEXP) ", " ", "PARAMETERS : Jprod - quotient of JAC-functions ", " ", " "],jac2prod=[ " ", "FUNCTION : jac2prod - converts a product of theta functions into ", " q-product form. ", " ", "CALLING SEQUENCE : jac2prod(jacexpr) ", " ", "PARAMETERS : jacexpr - product of JAC(i,j, infinity) ", " where i,j are integers ", " and 0 < i < j. ", " = ", " "],jac2series=[ " ", "FUNCTION : jac2series - converts a product of theta functions into ", " a product of q-series. ", " ", "CALLING SEQUENCE : jac2series(jacexpr,T) ", " ", "PARAMETERS : jacexpr - product of JAC(i,j, infinity) ", " where i,j are integers ", " and 0 < i < j. ", " = ", " "],jaclist2JACPROD=[ "FUNCTION : qseries[jaclist2JACPROD] - convert jaclist to JAC-notation ", " ", "CALLING SEQUENCE : jaclist2JACPROD(); ", " jaclist2JACPROD(jaclist) ", " ", "PARAMETERS : jaclist - list of terms [b,a,c] or [b,c] ", " ", " "],jaclist2J=[ "FUNCTION : qseries[jaclist2J] - convert jaclist to J-notation ", " ", "CALLING SEQUENCE : jaclist2J(); ", " jaclist2J(jaclist) ", " ", "PARAMETERS : jaclist - list of terms [b,a,c] or [b,c] ", " ", " "],jacprod=[ "FUNCTION : qseries[jacprod] - Jacobi-type infinite product ", " ", "CALLING SEQUENCE : jacprod(a,b,q,T) ", " ", "PARAMETERS : a,b positive integers ", " q variable ", " T - positive integer ", " ", " "],jacprodmake=[ "FUNCTION : qseries[jacprodmake] - Convert a q-series into a product of ", " theta functions if possible ", "VERSION: May 4, 2010 ", " ", "CALLING SEQUENCE : jacprodmake(f,q,T) ", " jacprodmake(f,q,T,P) ", " ", "PARAMETERS : f - q-series ", " T,P - positive integers ", " ", "GLOBAL VARIABLES : xprint,ft0,fixjacp: ", " ", " "],Jetamake=[ "FUNCTION : qseries[Jetamake] - convert q-series to a product of eta-functions ", " using J[m] notation ", " ", "CALLING SEQUENCE : Jetamake(f,q,T) ", " ", " ", "PARAMETERS : f - q-series ", " T - positive integer ", " ", " "],Jterm2JACPROD=[ "FUNCTION : qseries[Jterm2JACPROD] - a variant of Jterm2JACPROD ", " ", "CALLING SEQUENCE : Jterm2JACPROD() ", " Jterm2JACPROD(jterm) ", " Jterm2JACPROD(jterm,dilfactor) ", " ", "PARAMETERS : jterm - quotient of theta-functions in J-notation ", " ", " "],lqdegree=[ "FUNCTION : qseries[lqdegree] - lowest q-degree in sum of q-monomials ", " ", "CALLING SEQUENCE : lqdegree() ", " lqdegree(qexp) ", " ", "PARAMETERS : qexp - sum of q-mononials ", " ", " "],lqdegree0=[ "FUNCTION : qseries[lqdegree0] - lowest q-degree in q-monomial ", " ", "CALLING SEQUENCE : lqdegree0() ", " lqdegree0(qexp) ", " ", "PARAMETERS : qexp - a q-mononial ", " ", " "],mprodmake=[ "FUNCTION : qseries[mprodmake] - Convert a q-series into an infinite product ", " of the form (1+q^n1)*(1+q^n2)*... ", " ", "CALLING SEQUENCE : mprodmake(f,q,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", " "],oldsift=[ "FUNCTION : qseries[oldsift] - Pick out the terms of a q-series in which the exponent ", " belongs to a fixed residue class mod p ", " ", "CALLING SEQUENCE : oldsift(s,q,n,k,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", " "],qspackageversion=[ "FUNCTION : qseries[packageversion] - package version ", " ", " ", "CALLING SEQUENCE : packageversion() ", " ", " ", "PARAMETERS : none ", " ", " "],qsfunctions=[ "FUNCTION : qseries[qsfunctions] - list functions in the qseries package ", " ", "CALLING SEQUENCE : qsfunctions() ", " ", "PARAMETERS : none ", " ", " "],qshelp=[ "FUNCTION : qseries[qshelp] - help for a qseries function ", " ", "CALLING SEQUENCE : qshelp(funcname) ", " ", "PARAMETERS : funcname - name of qseries function ", " ", " "],prodmake=[ "FUNCTION : qseries[prodmake] - Convert a q-series into an infinite product ", " ", "CALLING SEQUENCE : prodmake(f,q,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", " "],qbin=[ "FUNCTION : qseries[qbin] - the q-binomial coefficient ", " (aka the Gaussian polynomial) ", " ", "CALLING SEQUENCE : qbin(q,m,n); ", " ", "PARAMETERS : q - variable ", " m,n - positive integers ", " ", " "],qdegree=[ "FUNCTION : qseries[qdegree] - Degree in q ", " ", "VERSION: February 15, 2011 ", " ", "CALLING SEQUENCE : qdegree(QS) ", " ", "PARAMETERS : QS - q-series ", " ", " ", " "],qetamake=[ "FUNCTION : qseries[qetamake] - convert q-series to a product of eta-functions ", " (variant of etamake) ", " ", "CALLING SEQUENCE : qetamake(f,q,T) ", " ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", " "],qfactor=[ "FUNCTION : qseries[qfactor] - factor into terms (1-q^i) ", " ", "CALLING SEQUENCE : qfactor(f,T) ", " ", "PARAMETERS : f - qseries or ratpoly ", " T - positive integer (optional) ", " ", " "],qs2jaccombo=[ "FUNCTION : qseries[qs2jaccombo] - convert a sum of q-series to a sum ", " of jacprods ", " ", "VERSION: May 6, 2010 ", " ", "CALLING SEQUENCE : qs2jaccombo(f,q,T) ", " qs2jaccombo(f,q,T,P) ", " ", "PARAMETERS : f - a sum of q-series ", " T,P - positive integers ", " ", " ", " "],quinprod=[ " ", "FUNCTION : qseries[quinprod] - Watson's quintuple product ", " ", "CALLING SEQUENCE : quinprod(a,b,q,T) ", " ", "PARAMETERS : a,b,q - names ", " T - positive integer ", " or one of the names prodid or seriesid ", " ", " "],sift=[ "FUNCTION : qseries[sift] - Pick out the terms of a q-series in which the exponent ", " belongs to a fixed residue class mod p ", " ", "CALLING SEQUENCE : sift(s,q,n,k,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", " "],theta=[ "FUNCTION : qseries[theta] - theta function ", " ", "CALLING SEQUENCE : theta(z,q,T) ", " ", "PARAMETERS : z - variable ", " q - variable ", " T - positive integer ", " ", " "],theta2=[ "FUNCTION : qseries[theta2] - the theta function theta (q) ", " 2 ", "CALLING SEQUENCE : theta2(q,T) ", " ", "PARAMETERS : q - variable ", " T - positive integer ", " ", " "],theta3=[ "FUNCTION : qseries[theta3] - the theta function theta (q) ", " 3 ", "CALLING SEQUENCE : theta3(q,T) ", " ", "PARAMETERS : q - variable ", " T - positive integer ", " ", " "],theta4=[ "FUNCTION : qseries[theta4] - the theta function theta (q) ", " 4 ", "CALLING SEQUENCE : theta4(q,T) ", " ", "PARAMETERS : q - variable ", " T - positive integer ", " ", " "],tripleprod=[ " ", "FUNCTION : qseries[tripleprod] - q-series expansion of Jacobi's triple product ", " ", "CALLING SEQUENCE : tripleprod(z,q,T) ", " ", "PARAMETERS : z,q - names ", " T - positive integer ", " ", " "],winquist=[ " ", "FUNCTION : qseries[winquist] - q-series of Winquist's product ", " ", "CALLING SEQUENCE : winquist(a,b,q,T) ", " ", "PARAMETERS : a,b,q - names ", " T - positive integer ", " ", " "],zqfactor=[ "FUNCTION : qseries[zqfactor] - Convert (z,q)-series into (z,q)-product ", " ", " ", "CALLING SEQUENCE : zqfactor(F,z,q) ", " zqfactor(F,z,N) ", " ", " ", "PARAMETERS : F - q-series with coeffients that are polynomials in z ", " z - variable (name) ", " N - positive integer (optional, default=1000) ", " ", "GLOBAL VARIABLES : ", " ", "SYNOPSIS : ", " ", " zqfactor(F,z,q) tries to convert F into a product of terms ", " (1 - a[i,j] z^i q^j) where each a[i,j] is an integer. ", " Here N is the max number of terms (default is 1000 but can be assigned). ", " ", " WARNING: This function does not work all the time. ", " Sometimes it finds the correct (z,q)-product - see example below. ", " But at times it will fail to find a reasonable product even ", " though one may exist. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> L1:=tripleprod(-z^2*q^3,q^4,20): ", "> L2:=tripleprod(-z^2*q,q^4,20): ", "> g:=L1-L2/z: ", "> zqfactor(g,z,q,10); ", " / 2 \ ", " 2 2 | q | 3 3 ", "(1 - 1/z) (1 - z q) (1 - q) (1 - q/z) (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) (1 - q ) ", " \ z / ", " ", " / 3 \ / 4 \ / 5 \ ", " | q | 4 4 | q | 5 5 | q | 6 ", " |1 - ----| (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) ", " \ z / \ z / \ z / ", " ", " / 6 \ / 7 \ / 8 \ ", " 6 | q | 7 7 | q | 8 8 | q | ", " (1 - q ) |1 - ----| (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) (1 - q ) |1 - ----| ", " \ z / \ z / \ z / ", " ", " / 9 \ / 10\ ", " 9 9 | q | 10 10 | q | ", " (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) (1 - q ) |1 - ---| ", " \ z / \ z / ", " ", "DISCUSSION : ", " ", "SEE ALSO : qfactor ", " ", " "]]): tmp:=briefqshelpTAB[qsprocname]: for a in tmp do printf(cat(a,"\n"));od; RETURN(): else error "%1 is not a qseries function",qsprocname; fi: end: qseries[qschanges]:=proc() printf("**************************************************************\n"); printf("*\n"); printf("*\n"); printf("* qseries package version 1.1 - Mon Jul 16 15:24:26 EDT 2012\n"); printf("* qseries package version 1.2 - Thu Dec 20 11:52:01 EST 2012\n"); printf("* qseries package version 1.3 - Fri Aug 12 15:07:08 EDT 2016\n"); printf("* qseries package version 1.3a - Tue Nov 28 13:48:19 EST 2017\n"); printf("* qseries package version 1.3b - Wed, Mar 6, 2019 8:15:20 PM\n"); printf("* qseries package version 1.3c - Wed, Jul 17, 2019 9:41:24 AM\n"); printf("* qseries package version 1.3d - Sat, Oct 19, 2019 9:58:53 AM\n"); printf("* qseries package version 1.3e - Fri, Jan 24, 2020 11:06:28 PM\n"); printf("* qseries package version 1.3f - Sat, Feb 8, 2020 10:33:00 PM\n"); printf("* qseries package version 1.3g - Fri, Apr 17, 2020 8:11:55 PM\n"); printf("* qseries package version 1.3h - Wed, May 13, 2020 10:19:52 PM\n"); printf("* qseries package version 1.3i - Wed, Jun 10, 2020 3:34:21 PM\n"); printf("* qseries package version 1.3j - Sat, Jun 13, 2020 3:10:39 PM\n"); printf("*\n"); printf("* This version tested on MAPLE 2020\n"); printf("*\n"); printf("* Changes since version 1.3\n"); printf("*\n"); printf("* * New function qspversion (short form of qspackageversion)\n"); printf("*\n"); printf("* * Updated findlincombo (with nargs=0 option and xprint \n"); printf("*\n"); printf("* * Corrected typo in quinprod (seriesid option fixed) \n"); printf("*\n"); printf("* * Corrected help for aqprod, checkmult, etaq \n"); printf("*\n"); printf("* * Fixed bug in Jterm2JACPROD\n"); #Thu, May 21, 2020 8:58:20 PM printf("* * Jterm2JACPROD also now takes 0,1,2 args\n"); printf("* * When nargs=1 dilfactor=1.\n"); printf("*\n"); printf("* * Fixed bug in findnonhomcombo \n"); printf("*\n"); printf("* * Updated qseries TUTORIAL.\n"); printf("*\n"); printf("* * Fixed bug in findnonhomcombo \n"); printf("* Changed n (args[4]) to nL which is now list of degrees\n"); printf("* instead of single integer. \n"); printf("*\n"); printf("* * New function qshelp \n"); printf("* Prints help for qseries function. \n"); printf("*\n"); printf("* * New function qsfunctions() \n"); printf("* This lists function in the package. \n"); printf("*\n"); printf("* * Change function names: \n"); printf("* packageversion -> qspackageversion \n"); printf("* changes -> qschanges \n"); printf("*\n"); printf("* * nargs version of the following functions: \n"); printf("* aqprod, checkprod \n"); printf("*\n"); printf("* * New function J2jaclist \n"); printf("* Takes 0 or 1 args. Converts theta-quotient in J-notation \n"); printf("* to a jaclist. J[b,a]^c and J[b]^c correspond to \n"); printf("* [b,a,c] or [b,c] in the list. \n"); printf("*\n"); printf("* * New function jaclist2JACPROD \n"); printf("* Takes 0 or 2 args.Converts theta-quotient as a jaclist to\n"); printf("* JAC-notation. \n"); printf("*\n"); printf("* * New function dilatejaclist \n"); printf("* Takes 0 or 2 args.\n"); printf(" Does q -> q^r in jacprod corresponding to\n"); printf("* a jaclist. It is used by Jterm2JACPRPOD. \n"); printf("*\n"); printf("* * New function Jterm2JACPROD \n"); printf("* Takes 0 or 2 args.Converts jterm to JACPROD and also \n"); printf("* does q -> q^r using dilatejaclist. \n"); printf("* * New function jac2J\n"); printf("* This functions takes 0 or 3 args. \n"); printf("* This is just a variant of etamake (or qetamake) \n"); printf("* which returns J[m] instead of eta(m*tau) etc.\n"); printf("*\n"); printf("* * New function Jetamake\n"); printf("* This functions takes 0 or 3 args. \n"); printf("* This is just a variant of etamake (or qetamake) \n"); printf("* which returns J[m] instead of eta(m*tau) etc.\n"); printf("*\n"); printf("* * Testing new function version findcongbeta\n"); printf("* Now takes up to 5 args try findcongbeta() for help\n"); printf("*\n"); printf("* * Removed print from findprod \n"); printf("*\n"); printf("* * Fixed small bug in findmaxind \n"); printf("*\n"); printf("* * Fixed bug in findhom (coeffs now computed from constant\n"); printf("* term instead of from q^1) \n"); printf("*\n"); printf("* * Added global var _xprint to findhomcombo\n"); printf("*\n"); printf("*\n"); printf("* Changes since version 1.2\n"); printf("*\n"); printf("* * Added global vars _etalisttop, _etalistbot, \n"); printf("* _etaconst to etamake (used by latex progs in \n"); printf("* new ramarobinsids package)\n"); printf("*\n"); printf("* * New function findmaxind \n"); printf("*\n"); printf("* * Changed taylor to series in both findhom and findhommodp\n"); printf("* so they can handle negative powers of q. \n"); printf("*\n"); printf("* * New version of sift can now handle negative exponents\n"); printf("* See oldsift for old version. The new sift needs the\n"); printf("* functions lqdegree and lqdegree0 from thetaids package.\n"); printf("* So these have also been added to qseries package.\n"); printf("*\n"); printf("* * Added xprint option to findhom to avoid extra printing in large loops\n"); printf("* Default is xprint=false (no extra printing) \n"); printf("*\n"); printf("* * jac2series can now handle JAC(a,b,infinity) when \n"); printf("* a<0 or a>b. \n"); printf("*\n"); printf("* * fixed major bug in findcong\n"); printf("* The old version missed some congruences.\n"); printf("*\n"); printf("* * findhom works correctly when nops(L)=1\n"); printf("*\n"); printf("* * added new function checkmult\n"); printf("* This function checks with a give qseries has multiplicative coefficients.\n"); printf(" USAGE: \n"); printf(" checkmult() \n"); printf(" checkmult(QS,T) \n"); printf(" checkmult(QS,T,yes) \n"); printf("*\n"); printf("* * aqprod(a,q,n) can now handle negative n\n"); printf("*\n"); printf("* * added new function checkprod\n"); printf("* This function checks a qseries has a nice product.\n"); printf(" USAGE: \n"); printf(" checkprod(f,M,Q) \n"); printf("*\n"); printf("* * added new function findprod\n"); printf("* This function searches for Z-linear combinations of \n"); printf("* the functions in FL which are probable products. \n"); printf("* This function also uses checkprod. \n"); printf(" USAGE: \n"); printf(" findprod(FL,T,M,Q) \n"); printf("*\n"); printf("* * aqprod(a,q,n) can now handle negative n\n"); printf("*\n"); printf("* Changes since version 1.1\n"); printf("*\n"); printf("* * Added global var jacp to jacmake.\n"); printf("*\n"); printf("* * In jacprodmake change failure from ERROR to WARNING:\n"); printf(" In jacprodmake changed handling of half-integer exponents.\n"); printf("*\n"); printf("* * In etamake added var ebase (to be used by jacprodmake\n"); printf("* when converting an etaprod to a jacprod.\n"); printf("*\n"); printf("*\n"); printf("* Changes since version 1.0\n"); printf("*\n"); printf("* * Added new function qdegree\n"); printf("* qdegree(QS) returns degree in q.\n"); printf("*\n"); printf("* * Added new function findcong\n"); printf(" This function finds congruences c(A*n+B) == 0 mod C\n"); printf(" for a give qseries f=add(c(n)*q^n).\n"); printf("*\n"); printf("* * Added new function qs2jaccombo\n"); printf(" This function converts a sum of q-series to a sum\n"); printf(" of jacprods if possible. \n"); printf("*\n"); printf("* * Local vars added to procs where necessary\n"); printf("*\n"); printf("* * jacprodmake now takes 3 or 4 args\n"); printf("* jacprodmake(f,q,T) works as before.\n"); printf("* jacprodmake(f,q,T,P) returns a jacprod (if it exists) on\n"); printf(" base q^b where b is a divisor of P. ERROR is returned \n"); printf(" if f is not a jacprod.\n"); printf(" This new version also handles the case where the coeff \n"); printf(" of q^0 is not 1.\n"); printf(" PLEASE report any bugs.\n"); printf("*\n"); printf("* * New hidden function periodfind2 added. \n"); printf(" This is used by jacprodmake to find period assuming it\n"); printf(" is a divisor of a given integer.\n"); printf("*\n"); printf("* * New hidden function jacmake now takes 2 or 3 args.\n"); printf("* It is used by jacprodmake.\n"); printf("*\n"); printf("* * Added instructions for windows installation\n"); printf("* Tested with Maple 11\n"); printf("*\n"); printf("* * Corrected email and homepage listed below\n"); printf("* New email: fgarvan@ufl.edu\n"); printf("* New homepage: http://www.math.ufl.edu/~fgarvan\n"); printf("*\n"); printf("* Changes since version 0.9\n"); printf("*\n"); printf("* * Updated packageversion with new email address and homepage.\n"); printf("*\n"); printf("* * qbin accepts q=root of unity etc (Suggested by Michael Somos)\n"); printf("*\n"); printf("* * Added function findlincombomodp\n"); printf("*\n"); printf("* * Fixed bug in findlincombo\n"); printf("*\n"); printf("* * Local username changed from frank to fgarvan\n"); printf("* New email: fgarvan@ufl.edu\n"); printf("* New homepage: http://www.math.ufl.edu/~fgarvan\n"); printf("*\n"); printf("* * Corrected typo in online help for findlincombo\n"); printf("*\n"); printf("* Changes since version 0.8\n"); printf("*\n"); printf("* * Added online FUNCTIONS page:\n"); printf("* http://www.math.ufl.edu/~fgarvan/qmaple/functions/\n"); printf("*\n"); printf("* * Added gooo to global list in findhomcombo\n"); printf("* * Added new function findlincombo\n"); printf("*\n"); printf("* * Fixed bugs in findhomcombo and modp version\n"); printf("* There was unnecessary etamake comp when etaopt=no\n"); printf("*\n"); printf("* * updated prodmake so it can have symbolic exponents\n"); printf("* Used series instead of taylor\n"); printf("*\n"); printf("* * new function findhomcombomodp\n"); printf("* This is a modp version of findhomcombo\n"); printf("* Useage: findhomcombomodp(f,L,p,q,n,topshift,etaoption))\n"); printf("*\n"); printf("* * Fixed a bug in findhomcombo when nops(L)=1\n"); printf("*\n"); printf("* * Fixed bug in findpoly \n"); printf("*\n"); printf("* * In qetamake change E(q) to _E(q) \n"); printf("*\n"); printf("* * Fixed minor bug in sift \n"); printf("*\n"); printf("* Changes since version 0.7\n"); printf("*\n"); printf("* * changed name of function version to packageversion\n"); printf("* since version is maple builtin function\n"); printf("* Useage: packageversion()\n"); printf("*\n"); printf("* * new function findhommodp\n"); printf("* This is a modp version of findhom\n"); printf("* Useage: findhommodp(L,p,q,n,topshift)\n"); printf("*\n"); printf("* * new function mprodmake\n"); printf("* Finds product expansion (1+q^n1)*(1+q^n2)*...\n"); printf("* Useage: mprodmake(f,q,last)\n"); printf("*\n"); printf("* * fixed bug in qetamake \n"); printf("*\n"); printf("* Changes since version 0.6 (Nov 2002):\n"); printf("*\n"); printf("* * new function qetamake \n"); printf("* This is just a variant of etamake which returns E(q^m)\n"); printf("* instead of eta(m*tau).\n"); printf("*\n"); printf("* * fixed bug in jac2series \n"); printf("*\n"); printf("* Changes since version 0.5:\n"); printf("*\n"); printf("* * new function zqfactor \n"); printf("* Takes 4 or 5 args: \n"); printf("* zqfactor(F,z,q,N,buglim) \n"); printf("* zqfactor(F,z,q,N) \n"); printf("* factors F into a product of terms \n"); printf("* of the form (1 - a[i,j] z^i q^j).\n"); printf("* Factor F into a product of terms (1 - a[i,j] z^i q^j)\n"); printf("* N = largest j \n"); printf("* buglim = max number of terms (default is 1000).\n"); printf("*\n"); printf("* Changes since version 0.4:\n"); printf("*\n"); printf("* * prodmake now takes 3 or 4 args.\n"); printf("* prodmake(f,q,t) returns a q-product.\n"); printf("* prodmake(f,q,t,list) returns a q-product as a list of exponents.\n"); printf("* * new function changes() - returns changes since previous release.\n"); printf("*\n"); printf("* Please report any problems to fgarvan@ufl.edu\n"); printf("* See \n"); printf("* http://www.math.ufl.edu/~fgarvan/qmaple/qmaple.html \n"); printf("* for documentation and help.\n"); printf("*\n"); printf("**************************************************************\n"); RETURN(): end: qseries[checkmult]:=proc() local NICE,m,n,c1,c2,c3,QS,T: NICE:=1: if not member(nargs,{0,2,3}) then ERROR("checkmult takes 0, 2, or 3 args"); fi: if nargs=0 then printf("---------------------------------------------------------\n"); printf(" checkmult(QS,T) \n"); printf(" checkmult(QS,T,yes) \n"); printf(" Returns 1 if QS up to Q^T is multiplicative \n"); printf(" If nargs=3 and arg3=yes then m,n where QS fails to \n"); printf(" be multiplicative are printed. \n"); printf(" Otherwise only the first instance of failure is \n"); printf(" printed. \n"); printf("---------------------------------------------------------\n"); else QS:=args[1]: T:=args[2]: if nargs=2 then for n from 2 to trunc(T/2) do for m from 2 to trunc(T/2) do if igcd(m,n)=1 and m*n<=T then c1:=coeff(QS,q,m): c2:=coeff(QS,q,n): c3:=coeff(QS,q,m*n): if c3<>c1*c2 then lprint("NOT MULTIPLICATIVE"); lprint("failure at m=",m,"and n=",n); RETURN(0): fi: fi: od: od: lprint(" MULTIPLICATIVE"); RETURN(1): else for n from 2 to trunc(T/2) do for m from 2 to trunc(T/2) do if igcd(m,n)=1 and m*n<=T then c1:=coeff(QS,q,m): c2:=coeff(QS,q,n): c3:=coeff(QS,q,m*n): if c3<>c1*c2 then lprint("NOT MULTIPLICATIVE"); lprint("failure at m=",m,"and n=",n); NICE:=0: fi: fi: od: od: if NICE=1 then lprint(" MULTIPLICATIVE"); fi: RETURN(NICE): fi: fi: end: qseries[checkprod]:=proc() local ss,ssp,LL,nss,c0,cb0,nss1,xx,mx,f,M,Q: ############################################################################# if not member(nargs,{0,3}) then ERROR("checkmult takes 0, or 3 args"); fi: if nargs=0 then printf("---------------------------------------------------------\n"); printf("checkprod() \n"); printf("checkprod(f,M,Q) \n"); printf(" Checks whether f is a nice formal product. It returns [a,1] \n"); printf(" if max of abs of exponents is < M. Here f = c1*q^a + ... \n"); printf(" \n"); printf("EXAMPLE: \n"); printf(" TH1:=add(q^(n^2),n=-10..10): \n"); printf(" checkprod(TH1,1,20); \n"); printf(" checkprod(TH1,4,99); \n"); printf(" \n"); printf("--------------------------------------------------------\n"); else f:=args[1]: M:=args[2]: Q:=args[3]: ss:=series(f,q,Q+1): ssp:=convert(ss,polynom): LL:=ldegree(ssp,q): nss:=expand(ssp/q^LL): c0:=coeff(nss,q,0): cb0:=abs(c0): ##if coeff(nss,q,0)=1 then if ssp<>0 then nss1:=expand(nss/c0): if modp(ssp,cb0)=0 then xx:=qseries[prodmake](nss1,q,Q-LL,list): mx:=max(op(map(abs,xx))): if mxq^r in the jacprod corresponding to ## jaclist. ## > jlist:=[[25, 5, -1], [25, 10, 1], [25, 1], [50, 5, 1]]; ## > jaclist2JACPROD(jlist); ## JAC(10, 25, infinity) JAC(0, 25, infinity) JAC(5, 50, infinity) ## --------------------------------------------------------------- ## JAC(5, 25, infinity) ## > jlist2:=dilatejaclist(jlist,1/5); ## jlist2 := [[5, 1, -1], [5, 2, 1], [5, 1], [10, 1, 1]] ## > jaclist2JACPROD(jlist2); ## JAC(2, 5, infinity) JAC(0, 5, infinity) JAC(1, 10, infinity) ## ------------------------------------------------------------ ## JAC(1, 5, infinity) ############################################################################# if nargs=0 then printf("---------------------------------------------------------\n"); printf(" dilatejaclist(jaclist,r) \n"); printf(" Does q -> q^r in the jacprod corresponding to jaclist.\n"); printf(" \n"); printf(" EXAMPLE: \n"); printf(" jlist:=[[25, 5, -1], [25, 10, 1], [25, 1], [50, 5, 1]];\n"); printf(" jlist2:=dilatejaclist(jlist,1/5); \n"); printf("--------------------------------------------------------\n"); else if nargs=2 then njaclist:=[]: jaclist:=args[1]: r:=args[2]: for L in jaclist do if nops(L)=2 then njaclist:=[op(njaclist),[L[1]*r,L[2]]]: else njaclist:=[op(njaclist),[L[1]*r,r*L[2],L[3]]]: fi: od: RETURN(njaclist): else ERROR("nargs = 0 or 2"); fi: fi: end: qseries[dilateJterm]:=proc() local LJT,jterm2,JL,JP,jterm,dilfactor,conterm,qterm,selcon: local qjterm,qpow: ############################################################################# ## > y1:=2*J[25, 5]*J[25]*J[50, 15]/J[25, 10]; ## 2 J[25, 5] J[25] J[50, 15] ## y1 := -------------------------- ## J[25, 10] ## ## > Jterm2JACPROD(y1,1); ## 2 JAC(5, 25, infinity) JAC(0, 25, infinity) JAC(15, 50, infinity) ## ----------------------------------------------------------------- ## JAC(10, 25, infinity) ## ## > Jterm2JACPROD(y1,1/5); ## 2 JAC(1, 5, infinity) JAC(0, 5, infinity) JAC(3, 10, infinity) ## -------------------------------------------------------------- ## JAC(2, 5, infinity) ############################################################################# # Thu, May 21, 2020 8:58:20 PM --- fixed bug by adding conterm if nargs=0 then printf("---------------------------------------------------------\n"); printf("dilateJterm(jterm,dilfactor) \n"); printf(" Applies q -> q^dilfactor to jterm\n"); printf(" \n"); printf(" EXAMPLE: \n"); printf(" y1:=2*J[25, 5]*J[25]*J[50, 15]/J[25, 10];\n"); printf(" dilateJterm(y1,1);\n"); printf(" dilateJterm(y1,1/5);\n"); printf("---------------------------------------------------------\n"); else if nargs=2 then jterm:=args[1]: dilfactor:=args[2]: if type(jterm,`*`) or type(jterm,indexed) then if type(jterm,`*`) then LJT:=[op(jterm)]: else LJT:=[jterm]: fi: # remove non J-stuff jterm2:=select(has,jterm,J): conterm:=simplify(jterm/jterm2): JL:=dilatejaclist(J2jaclist(jterm2),dilfactor): JP:=subs(q=q^dilfactor,conterm)*jaclist2J(JL): RETURN(JP): else RETURN(jterm): fi: else ERROR("nargs = 0 or 2 "); fi: fi: end: qseries[etamake]:=proc() # #VERSION: 01/30/10 # Use series(`leadterm`(expr),q) to get leadterm instead of tc etc. # This is handle BBG c(q) function #This procedure computes an eta-product expansion #of the series f to order O(q^last). #12/20/12: added global var ebase (to be used by jacprodmake when # converting an etaprod to a jacprod local fp,tc,exq,g,aa,ld,h,hh,i,cf,etaprod,alast,sf,f,q,T,last: global ebase,_etalisttop,_etalistbot,_etaconst: #07/11/16: added global vars _etalisttop, _etalistbot #04.17.20: nargs version ############################################################################# if not member(nargs,{0,3}) then ERROR("checkmult takes 0, or 3 args"); fi: if nargs=0 then printf("---------------------------------------------------------\n"); printf(" etamake() \n"); printf(" etamake(f,q,T) \n"); printf(" converts the q-series f into an eta-product expansion \n"); printf(" that agrees with f to O(q^T). \n"); printf(" \n"); printf("EXAMPLES : \n"); printf(" T3:=tripleprod(q,q^3,10); \n"); printf(" etamake(T3,q,20); \n"); printf(" T2:=add((-1)^n*q^(n*n),n=-10..10); \n"); printf(" etamake(T2,q,50); \n"); printf(" \n"); printf("--------------------------------------------------------\n"); else f:=args[1]: q:=args[2]: last:=args[3]: ebase:=1: _etalisttop:=[]: _etalistbot:=[]: sf:=series(f,q,last+10): fp:=convert(sf,polynom): tc:=tcoeff(fp,q): _etaconst:=tc: exq:=ldegree(fp,q): g:=normal(fp/tc/q^exq): aa:=tc: ld:=1: alast:=last-exq: while ld>0 do h:=series(g-1,q=0,alast+1): hh:=0: for i from 1 to alast do hh:=hh+coeff(h,q,i)*q^i: od: h:=hh: ## ##08/20/99: bug fix ldegree(0,q) returns infinity ## in maple V release 5 if h=0 then ld:=0: else ld:=ldegree(h,q): fi: cf:=coeff(h,q,ld): if ld>0 then exq:=exq+(ld*cf)/24: aa:=eta(ld*tau)^(-cf)*aa: g:=g*etaq(q,ld,alast)^cf: ebase:=ilcm(ld,ebase): if cf<0 then _etalisttop:=[op(_etalisttop),[ld,-cf]] else _etalistbot:=[op(_etalistbot),[ld,cf]] fi: fi: od: etaprod:=q^(exq)*aa: RETURN(etaprod): fi: end: qseries[etamakebeta]:=proc() # #VERSION: 01/30/10 # Use series(`leadterm`(expr),q) to get leadterm instead of tc etc. # This is handle BBG c(q) function #This procedure computes an eta-product expansion #of the series f to order O(q^last). #12/20/12: added global var ebase (to be used by jacprodmake when # converting an etaprod to a jacprod local fp,tc,exq,g,aa,ld,h,hh,i,cf,etaprod,alast,sf,f,q,T,last,sf1,slt: global ebase,_etalisttop,_etalistbot,_etaconst: #07/11/16: added global vars _etalisttop, _etalistbot #04.17.20: nargs version ############################################################################# if not member(nargs,{0,3}) then ERROR("checkmult takes 0, or 3 args"); fi: if nargs=0 then printf("---------------------------------------------------------\n"); printf(" etamakebeta() \n"); printf(" etamakebeta(f,q,T) \n"); printf(" converts the q-series f into an eta-product expansion \n"); printf(" that agrees with f to O(q^T). \n"); printf(" \n"); printf("EXAMPLES : \n"); printf(" T3:=tripleprod(q,q^3,10); \n"); printf(" etamake(T3,q,20); \n"); printf(" T2:=add((-1)^n*q^(n*n),n=-10..10); \n"); printf(" etamake(T2,q,50); \n"); printf(" \n"); printf("--------------------------------------------------------\n"); else f:=args[1]: q:=args[2]: last:=args[3]: ebase:=1: _etalisttop:=[]: _etalistbot:=[]: sf1:=series(f,q,last+10): # Use series(`leadterm`(expr),q) to get leadterm instead of tc etc. slt:=series(`leadterm`(sf1),q): tc:=subs(q=1,slt): sf:=series(f/slt,q,last+10): fp:=convert(sf,polynom): _etaconst:=tc: exq:=ldegree(fp,q): g:=normal(fp): aa:=1: ld:=1: alast:=last-exq: while ld>0 do h:=series(g-1,q=0,alast+1): hh:=0: for i from 1 to alast do hh:=hh+coeff(h,q,i)*q^i: od: h:=hh: ## ##08/20/99: bug fix ldegree(0,q) returns infinity ## in maple V release 5 if h=0 then ld:=0: else ld:=ldegree(h,q): fi: cf:=coeff(h,q,ld): if ld>0 then exq:=exq+(ld*cf)/24: aa:=eta(ld*tau)^(-cf)*aa: g:=g*etaq(q,ld,alast)^cf: ebase:=ilcm(ld,ebase): if cf<0 then _etalisttop:=[op(_etalisttop),[ld,-cf]] else _etalistbot:=[op(_etalistbot),[ld,cf]] fi: fi: od: etaprod:=slt*aa*q^(exq): RETURN(etaprod): fi: end: qseries[etaq]:=proc(q,i,trunk) # This proc returns (q^i:q^i)_inf up to q^trunk local k,x,z1,z,w: z1:=(i + sqrt( i*i + 24*trunk*i ) )/(6*i): z:=1+trunc( evalf(z1) ): x:=0: for k from -z to z do w:=i*k*(3*k-1)/2: if w<=trunk then x:=x+ q^( w )*(-1)^k: fi: od: RETURN(x): end: qseries[findcong]:=proc() local s,j,c,S,p,r,QS2,S1,QS,T,LM,LM1,M,xxT,xxT1,CFS1,IGCD1,CFS,IGCD,f,IFX,HH,h,P,R,m,L,ra,Ma,pa,XSET,fH; global xprint: ## VERSION: 09/09/2013 ## PREVIOUS VERSION: 07/25/2012 ## findcong(QS,T) ## findcong(QS,T,LM) ## findcong(QS,T,LM,XSET) ## find linear congruences for q-series QS up to q^T ## EXAMPLE: ## P:=series(1/etaq(q,1,1001),q,1001): ## > findcong(P,1000); ## [4, 5, 5] ## [5, 7, 7] ## [6, 11, 11] ## [24, 25, 25] ## {[5, 7, 7], [4, 5, 5], [24, 25, 25], [6, 11, 11]} ## NOTE: XSET set of moduli to exclude if nargs>4 or nargs<2 then ERROR(`findcong takes 2, 3 or 4 args.`); fi: if not(type(xprint,boolean)) then xprint:=false: fi: QS:=args[1]: T:=args[2]: LM1:=2: XSET:={}: if nargs=2 then LM:=trunc(sqrt(T)): else LM:=args[3]: fi: if nargs=4 then XSET:=args[4]: fi: S:={}: #### ##"xxT1=", 11, "CFS1=", [660, 91740, 3593480, 76836100, 1128188020, ## 12733555780, 117951349040, 935191373080, 6532841375940, 41057165666720, ## 235820387905900, 1253017582965800] ##"M=", 40, "r=", 27, "IGCD1=", 20 #### for M from LM1 to LM do for r from 0 to M-1 do xxT:=trunc((T-r)/M): xxT1:=min(xxT,100): CFS1:=[seq(coeff(QS,q,M*n+r),n=0..xxT1)]: if xprint then lprint("xxT1=",xxT1,"CFS1=",CFS1); fi: IGCD1:=igcd(op(CFS1)); if xprint then lprint("M=",M,"r=",r,"IGCD1=",IGCD1); fi: #next line fixed 09/09/2013 if IGCD1<>1 and not member(IGCD1,XSET) then CFS:=[seq(coeff(QS,q,M*n+r),n=0..trunc((T-r)/M))]: IGCD:=igcd(op(CFS)); if IGCD<>1 and not member(IGCD,XSET) then # new one? f:=0: IFX:=ifactors(IGCD): HH:=IFX[2]: if xprint then lprint("IGCD=",IGCD,"HH=",HH); fi: for h from 1 to nops(HH) do P:=HH[h][1]: R:=HH[h][2]: #BUG FIX 10.20.214 (In the old version the variable fH was # called f and did not appear here but was outside # this loop and hence some congruences were missed) fH:=1: for m from 1 to nops(S) do L:=S[m]: ra:=L[1]: Ma:=L[2]: pa:=L[3]: if modp(r,Ma)=ra and pa=P^R and modp(M,Ma)=0 then fH:=0: fi: od: if fH=1 then # next line added 7/27/13 if not member(P^R,XSET) then S1:= S union {[r,M,P^R]}: if nops(S1) > nops(S) then print([r,M,P^R]); S:=S1: fi: fi: fi: od: fi: fi: od:od: RETURN(S); end: #++++++++++++++++++++++++++++++++++++++++++++++++++++ qseries[findcongbeta]:=proc() local s,j,c,S,p,r,QS2,S1,QS,T,LM,LM1,M,xxT,xxT1,CFS1,IGCD1,CFS,IGCD,f,IFX,HH,h,P,R,m,L,ra,Ma,pa,XSET,fH,xxTLIM; global xprint: ## VERSION: 09/09/2013 ## PREVIOUS VERSION: 07/25/2012 ## findcongbeta(QS,T) ## findcongbeta(QS,T,LM) ## findcongbeta(QS,T,LM,XSET) ## findcongbeta(QS,T,LM,XSET,xxTLIM) ## find linear congruences for q-series QS up to q^T ## If QS = sum a(n) q^n then findcong searches for congruences ## a(M*n + r) == 0 (mod K) ## and returns possible set of congruences : {[r1,M1,K1], ..... } ## EXAMPLE: ## P:=series(1/etaq(q,1,1001),q,1001): ## > findcongbeta(P,1000); ## [4, 5, 5] ## [5, 7, 7] ## [6, 11, 11] ## [24, 25, 25] ## {[5, 7, 7], [4, 5, 5], [24, 25, 25], [6, 11, 11]} ## NOTE1: LM is maximum M (default = [sqrt(T)] ## NOTE2: XSET set of moduli to exclude ## NOTE3: xxTLIM max number of coeffs to test gcd (default = 100) if nargs>5 or nargs=1 then ERROR(`findcong takes 0, 2, 3 or 4 or 5 args.`); fi: if nargs=0 then printf(" findcongbeta(QS,T)\n"); printf(" findcongbeta(QS,T,LM)\n"); printf(" findcongbeta(QS,T,LM,XSET)\n"); printf(" findcongbeta(QS,T,LM,XSET,xxTLIM)\n"); printf(" find linear congruences for q-series QS up to q^T\n"); printf(" If QS = sum a(n) q^n then findcong searches for congruences\n"); printf(" a(M*n + r) == 0 (mod K)\n"); printf(" and returns possible set of congruences : {[r1,M1,K1], ..... }\n"); printf(" EXAMPLE:\n"); printf(" P:=series(1/etaq(q,1,1001),q,1001):\n"); printf(" > findcongbeta(P,1000);\n"); printf(" [4, 5, 5]\n"); printf(" [5, 7, 7]\n"); printf(" [6, 11, 11]\n"); printf(" [24, 25, 25]\n"); printf(" {[5, 7, 7], [4, 5, 5], [24, 25, 25], [6, 11, 11]}\n"); printf(" NOTE1: LM is maximum M (default = [sqrt(T)]\n"); printf(" NOTE2: XSET set of moduli to exclude\n"); printf(" NOTE3: xxTLIM max number of coeffs to test gcd (default = 100)\n"); else if not(type(xprint,boolean)) then xprint:=false: fi: QS:=args[1]: T:=args[2]: LM1:=2: XSET:={}: if nargs=2 then LM:=trunc(sqrt(T)): else LM:=args[3]: fi: if nargs>=4 then XSET:=args[4]: fi: if nargs=5 then xxTLIM:=args[5]: else xxTLIM:=100: fi: S:={}: #### ##"xxT1=", 11, "CFS1=", [660, 91740, 3593480, 76836100, 1128188020, ## 12733555780, 117951349040, 935191373080, 6532841375940, 41057165666720, ## 235820387905900, 1253017582965800] ##"M=", 40, "r=", 27, "IGCD1=", 20 #### for M from LM1 to LM do for r from 0 to M-1 do xxT:=trunc((T-r)/M): xxT1:=min(xxT,xxTLIM): CFS1:=[seq(coeff(QS,q,M*n+r),n=0..xxT1)]: if xprint then lprint("xxT1=",xxT1,"CFS1=",CFS1); fi: IGCD1:=igcd(op(CFS1)); if xprint then lprint("M=",M,"r=",r,"IGCD1=",IGCD1); fi: #next line fixed 09/09/2013 if IGCD1<>1 and not member(IGCD1,XSET) then CFS:=[seq(coeff(QS,q,M*n+r),n=0..trunc((T-r)/M))]: IGCD:=igcd(op(CFS)); if IGCD<>1 and not member(IGCD,XSET) then # new one? f:=0: IFX:=ifactors(IGCD): HH:=IFX[2]: if xprint then lprint("IGCD=",IGCD,"HH=",HH); fi: for h from 1 to nops(HH) do P:=HH[h][1]: R:=HH[h][2]: #BUG FIX 10.20.214 (In the old version the variable fH was # called f and did not appear here but was outside # this loop and hence some congruences were missed) fH:=1: for m from 1 to nops(S) do L:=S[m]: ra:=L[1]: Ma:=L[2]: pa:=L[3]: if modp(r,Ma)=ra and pa=P^R and modp(M,Ma)=0 then fH:=0: fi: od: if fH=1 then # next line added 7/27/13 if not member(P^R,XSET) then S1:= S union {[r,M,P^R]}: if nops(S1) > nops(S) then print([r,M,P^R]); S:=S1: fi: fi: fi: od: fi: fi: od:od: RETURN(S); fi: end: #++++++++++++++++++++++++++++++++++++++++++++++++++++ qseries[findhom]:=proc(L,q,n,topshift) #This program generates a list of potential homogeneous relations #of degree n among the list of q-series L. #HISTORY: # 11.28.17: Coefficients now computed from constant term # findhom([1,q],1,0) gave {X[1]} in error # # 05/07/13: now handles case nops(L)=1 correctly. # 04.18.13: added global xprint to annoying extra prints # 10.28.15: changed taylor to series local xx,x,y,z,nx,n2,n3,gg,goo,gooo,c,dh,jj,g,k,w,d,i,ct,D,ii,h,G,ANS,yy; global X,xprint: if not(type(xprint,boolean)) then xprint:=false: fi: if whattype(n)=integer and whattype(topshift)=integer then if n>0 and topshift>-20 then D:=nops(L); gg[1]:={}; xx:=expand(sum(x[i],i=1..D)^(n) ): nx:=nops(xx): n2:=nx+20+topshift:#step this up if some solutions are spurious n3:=n2+1: ################################################################ ##05/07/13: handle case when nops(L)=1 if nops(L)=1 then yy:=convert(series(L[1],q,n3),polynom): if yy=0 then RETURN({1}): else RETURN({{}}): fi: fi: ################################################################ if xprint then print(`# of terms `,n3); fi: c:=array(1..nx,1..n2); dh:=array(1..nx,1..D); for jj from 1 to nx do G:=op(jj,xx): for i from 1 to D do h[i]:=degree(G,x[i]): dh[jj,i]:=h[i]: od: w:=product(L[ii]^h[ii],ii=1..D): d:=series(w,q,n3+5); for i from 1 to n2 do c[jj,i]:=coeff(d,q,i-1); ##11.28.2017: old c[jj,i]:=coeff(d,q,i); od; od: ct:= linalg[transpose](c): gooo:=(linalg[kernel](ct)); for k from 1 to nops(gooo) do goo:=gooo[k]; d:=op(dh): g[k]:=0: for i from 1 to nx do g[k]:=g[k]+goo[i]*product(X[ii]^d[i,ii],ii=1..D): od; gg[k]:=g[k]; od; if xprint then print(`-----RELATIONS----of order---`,n); fi: ANS:=convert(gg,set); RETURN(ANS); else ERROR(`n must be a positive integer and topshift must apositive integer greater then -20`); fi: else ERROR(`n and topshift must be integers.`); fi: end: qseries[findhomcombo]:=proc(f,L,q,n,topshift,etaoption) #This program tries to express f as a homogeneous polynomial #of degree n among the list of q-series in L. # #01/26/06: Fixed bug when nops(L)=1 # local xx,x,y,z,nx,n2,n3,gg,goo,c,dh,jj,g,k,w,d,i,D,ii,h,G,ANS,func,fq,ANSETA,geta; global X,ct,gooo,xprint: #06/20/07: added gooo to global #03/03/17: added xprint to global if not(type(xprint,boolean)) then xprint:=false: fi: X:='X': if whattype(n)=integer and whattype(topshift)=integer then if n>0 and topshift>-20 then D:=nops(L); gg[1]:={}; xx:=expand(sum(x[i],i=1..D)^(n) ): nx:=nops(xx): if D=1 then nx:=1: fi: n2:=nx+20+topshift:#step this up if some solutions are spurious n3:=n2+1: if xprint then print(`# of terms `,n3); fi: c:=array(1..nx+1,1..n2); dh:=array(1..nx,1..D); if D>1 then for jj from 1 to nx do G:=op(jj,xx): for i from 1 to D do h[i]:=degree(G,x[i]): dh[jj,i]:=h[i]: od: w:=product(L[ii]^h[ii],ii=1..D): d:=series(w,q,n3); func[jj]:=d: for i from 1 to n2 do c[jj,i]:=coeff(d,q,i); od; od: else d:=series(L[1]^n,q,n3): dh[1,1]:=n: func[1]:=d: for i from 1 to n2 do c[1,i]:=coeff(d,q,i); od; fi: fq:=series(f,q,n3): for i from 1 to n2 do c[nx+1,i]:=coeff(fq,q,i):od: ct:= linalg[transpose](c): gooo:=(linalg[kernel](ct)): ##warning added 09/13/05 if nops(gooo)>1 then print(`WARNING: dim ker =`,nops(gooo)); fi: ANS:={}: ANSETA:={}: for k from 1 to nops(gooo) do goo:=gooo[k]: d:=op(dh): g[k]:=0: geta[k]:=0: if goo[nx+1]<>0 then for i from 1 to nx do g[k]:=g[k]+goo[i]*product(X[ii]^d[i,ii],ii=1..D): if etaoption = `yes` then geta[k]:=geta[k]+goo[i]*qseries[etamake](func[i],q,n3-2): fi: od: ANS:=ANS union {-g[k]/goo[nx+1]}: if etaoption = `yes` then ANSETA:=ANSETA union {-geta[k]/goo[nx+1]}: fi: fi: od: if xprint then print(`-----possible linear combinations of degree------`,n): fi: if etaoption = `yes` then print(ANSETA); fi: RETURN(ANS); else ERROR(`n must be a positive integer and topshift must apositive integer greater then -20`); fi: else ERROR(`n and topshift must be integers.`); fi: end: #++++++++++++++++++++++++++++++++++++++++++++++++++++ qseries[findhomcombomodp]:=proc(f,L,p,q,n,topshift,etaoption) #This program tries to express f (mod p) as a homogeneous polynomial #of degree n among the list of q-series in L. # # local xx,x,y,z,nx,n2,n3,gg,goo,gooo,c,ct,dh,jj,g,k,w,d,i,D,ii,h,G,ANS,func,fq,ANSETA,geta; global X: X:='X': if whattype(n)=integer and whattype(topshift)=integer then if n>0 and topshift>-20 then D:=nops(L); gg[1]:={}; xx:=expand(sum(x[i],i=1..D)^(n) ): nx:=nops(xx): if D=1 then nx:=1: fi: n2:=nx+20+topshift:#step this up if some solutions are spurious n3:=n2+1: print(`# of terms `,n3); c:=array(1..nx+1,1..n2); dh:=array(1..nx,1..D); if D>1 then for jj from 1 to nx do G:=op(jj,xx): for i from 1 to D do h[i]:=degree(G,x[i]): dh[jj,i]:=h[i]: od: w:=product(L[ii]^h[ii],ii=1..D): d:=series(w,q,n3); func[jj]:=d: for i from 1 to n2 do c[jj,i]:=coeff(d,q,i); od; od: else d:=series(L[1]^n,q,n3): dh[1,1]:=n: func[1]:=d: for i from 1 to n2 do c[1,i]:=coeff(d,q,i); od; fi: fq:=series(f,q,n3): for i from 1 to n2 do c[nx+1,i]:=coeff(fq,q,i):od: ct:= linalg[transpose](c): gooo:=Nullspace(ct) mod p: print("Nullspace computed"); if nops(gooo)>1 then print(`WARNING: dim ker =`,nops(gooo)); fi: ANS:={}: ANSETA:={}: for k from 1 to nops(gooo) do goo:=gooo[k]: d:=op(dh): g[k]:=0: geta[k]:=0: if goo[nx+1]<>0 then for i from 1 to nx do g[k]:=g[k]+goo[i]*product(X[ii]^d[i,ii],ii=1..D): #added if to stop unnecessary slowdown using etamake if etaoption = `yes` then geta[k]:=geta[k]+goo[i]*qseries[etamake](func[i],q,n3-2): fi: od: ANS:=ANS union {-g[k]/goo[nx+1]}: if etaoption = `yes` then ANSETA:=ANSETA union {-geta[k]/goo[nx+1]}: fi: fi: od: ANS:=modp(ANS,p): print(`-----possible linear combinations of degree------`,n,`---- mod `,p): if etaoption = `yes` then print(ANSETA); fi: RETURN(ANS); else ERROR(`n must be a positive integer and topshift must apositive integer greater then -20`); fi: else ERROR(`n and topshift must be integers.`); fi: end: #++++++++++++++++++++++++++++++++++++++++++++++++++++ qseries[findhommodp]:=proc(L,p,q,n,topshift) # HISTORY: ##05/18/05 This is a modp version of findhom. ##10.30.15: changed taylor to series #This program generates a list of potential homogeneous relations mod p #of degree n among the list of q-series L. # local xx,x,y,z,nx,n2,n3,gg,goo,gooo,c,dh,jj,g,k,w,d,i,D,ii,h,G,ANS; global X,ct: if whattype(n)=integer and whattype(topshift)=integer then if n>0 and topshift>-20 then D:=nops(L); gg[1]:={}; xx:=expand(sum(x[i],i=1..D)^(n) ): nx:=nops(xx): n2:=nx+20+topshift:#step this up if some solutions are spurious n3:=n2+1: print(`# of terms `,n3); c:=array(1..nx,1..n2); dh:=array(1..nx,1..D); for jj from 1 to nx do G:=op(jj,xx): for i from 1 to D do h[i]:=degree(G,x[i]): dh[jj,i]:=h[i]: od: w:=product(L[ii]^h[ii],ii=1..D): d:=series(w,q,n3+5); for i from 1 to n2 do c[jj,i]:=coeff(d,q,i); od; od: ct:= linalg[transpose](c): ##gooo:=(linalg[kernel](ct)); gooo:=Nullspace(ct) mod p; for k from 1 to nops(gooo) do goo:=gooo[k]; d:=op(dh): g[k]:=0: for i from 1 to nx do g[k]:=g[k]+goo[i]*product(X[ii]^d[i,ii],ii=1..D): od; gg[k]:=g[k]; od; print(`-----RELATIONS----of order---`,n,`---- mod `,p); ANS:=convert(gg,set); RETURN(ANS); else ERROR(`n must be a positive integer and topshift must apositive integer greater then -20`); fi: else ERROR(`n and topshift must be integers.`); fi: end: qseries[findlincombo]:=proc() #04/27/08 #This program tries to express f as a linear combo of funcs in L #SL is list of names of funcs in L. # local fq, nx, n2, n3, c, jj, d, i, goo, ANS; local f, L, SL, q, topshift; global ct,gooo,xprint: #06/20/07: added gooo to global #06.13.20: added nargs options and xprint ############################################################################# if not(type(xprint,boolean)) then xprint:=false: fi: ############################################################################# if not member(nargs,{0,5}) then ERROR("findlincombo takes 0, or 5 args"); fi: if nargs=0 then printf("---------------------------------------------------------\n"); printf(" findlincombo() \n"); printf(" findlincombo(f,L,SL,q,topshift) \n"); printf(" f - q-series \n"); printf(" L - list if q-series \n"); printf(" S - list symbol names of items in L \n"); printf(" topsift - integer (>-20) \n"); printf(" DESCRIPTION: \n"); printf(" Attempt to write f as a linear combination of the items\n"); printf(" in L \n"); printf(" EXAMPLE: \n"); printf(" f1:=1+q+q^3; \n"); printf(" f2:=1+q-q^3-q^5-q^7; \n"); printf(" f3:=12*f1+13*f2; \n"); printf(" qseries[findlinhomcombo](f3,[f1,f2],[F1,F2],q,0); \n"); printf(" 12 F1 + 13 F2 \n"); printf(" \n"); printf("--------------------------------------------------------\n"); else f:=args[1]: L:=args[2]: SL:=args[3]: q:=args[4]: topshift:=args[5]: if type(topshift,integer) then if topshift>-20 then nx:=nops(L): if xprint then print(`nx = `,nx); fi: n2:=nx+20+topshift:#step this up if some solutions are spurious n3:=n2+1: if xprint then print(`# of terms `,n3); fi: c:=array(1..nx+1,1..n2); for jj from 1 to nx do d:=series(L[jj],q,n3); ## 02/14/09: changed loop [i from 1 to n2] TO [for i from 0 to n2-1] for i from 0 to n2-1 do c[jj,i+1]:=coeff(d,q,i); od; od: fq:=series(f,q,n3): ## 02/14/09: changed loop [i from 1 to n2] TO [for i from 0 to n2-1] for i from 0 to n2-1 do c[nx+1,i+1]:=coeff(fq,q,i):od: ct:= linalg[transpose](c): gooo:=(linalg[kernel](ct)): ##warning added 09/13/05 if nops(gooo)>1 or nops(gooo)=0 then print(`WARNING: dim ker =`,nops(gooo)); if nops(gooo)=0 then print("NOT A LINEAR COMBO."); fi: RETURN(): fi: goo:=gooo[1]: if goo[nx+1]<>0 then ANS:=add(-goo[k]/goo[nx+1]*SL[k],k=1..nx); RETURN(ANS); else print("NOT A LINEAR COMBO."); RETURN(): fi: else ERROR(`topshift must an integer greater then -20`); fi: else ERROR(`topshift must be integers.`); fi: fi: end: ##################################################################### ##EXAMPLE: ##> f1:=1+q+q^3; ##> f2:=1+q-q^3-q^5-q^7; ##> f3:=12*f1+13*f2; ##> qseries[findlinhomcombo](f3,[f1,f2],[F1,F2],q,0); ## nx = , 2 ## ## # of terms , 23 ## ## 12 F1 + 13 F2 ## ##> qseries[findlinhomcombo](f3,[f1,f2+q],[F1,F2],q,0); ## nx = , 2 ## ## # of terms , 23 ## ## WARNING: dim ker =, 0 ## ## "NOT A LINEAR COMBO." ## ## ##################################################################### qseries[findlincombomodp]:=proc(f,L,SL,p,q,topshift) #02/15/09 (This is a mod p version of findlincombo) #This program tries to express f as a linear combo modp of funcs in L #SL is list of names of funcs in L. # local fq, nx, n2, n3, c, jj, d, i, goo, ANS; global ct,gooo: #06/20/07: added gooo to global if whattype(topshift)=integer then if topshift>-20 then nx:=nops(L): print(`nx = `,nx); n2:=nx+20+topshift:#step this up if some solutions are spurious n3:=n2+1: print(`# of terms `,n3); c:=array(1..nx+1,1..n2); for jj from 1 to nx do d:=series(L[jj],q,n3); ## 02/14/09: changed loop [i from 1 to n2] TO [for i from 0 to n2-1] for i from 0 to n2-1 do c[jj,i+1]:=coeff(d,q,i); od; od: fq:=series(f,q,n3): ## 02/14/09: changed loop [i from 1 to n2] TO [for i from 0 to n2-1] for i from 0 to n2-1 do c[nx+1,i+1]:=coeff(fq,q,i):od: ct:= linalg[transpose](c): gooo:=Nullspace(ct) mod p: ##warning added 09/13/05 if nops(gooo)>1 or nops(gooo)=0 then print(`WARNING: dim ker =`,nops(gooo)); if nops(gooo)=0 then print("NOT A LINEAR COMBO MOD ",p,"."); fi: RETURN(): fi: goo:=gooo[1]: if goo[nx+1]<>0 then ANS:=add(-goo[k]/goo[nx+1]*SL[k],k=1..nx); RETURN(ANS); else print("NOT A LINEAR COMBO MOD ",p,"."); RETURN(): fi: else ERROR(`topshift must apositive integer greater then -20`); fi: else ERROR(`topshift must be integers.`); fi: end: ##################################################################### ##################################################################### ##EXAMPLE: ## ## > E4:=1+240*add(n^3*q^n/(1-q^n),n=1..300): ## > E6:=1-504*add(n^5*q^n/(1-q^n),n=1..300): ## > P:=series(1/etaq(q,1,300),q,300): ## > ETA1:=etaq(q,1,300): ## > F1:=sift(E4^16*E6*P,q,13,6,299): ## > BB13:=[seq(ETA1^11*E6*E4^(3*j+1),j=0..5)]: ## > SBB13:=[seq(_ETA1^11*_E6*_E4^(3*j+1),j=0..5)]: ## > findlincombomodp(F1,BB13,SBB13,13,q,-8); ## nx = , 6 ## ## # of terms , 19 ## ## 11 ## -6 _ETA1 _E6 _E4 ## ## Let E4(q), E6(q) be the standard Eisenstein series of ## weights 4 and 6, and let E(q) = (q;q)[infinity]. ## Let F = sum a(n) q^n = E4^16*E6/E(q). ## We suspect that ## sum a(13*n+6) q^n = linear combination of ## E(q)^11*E6*E4^(3*j+1) (j=0..5) mod 13. ## Using findlincombomodp it seems that ## sum a(13*n+6) q^n = -6*E(q)^11*E4(q)*E6(q) mod 13. ## ## ##################################################################### qseries[findmaxind]:=proc() local P,NXFL,j,NP,NNXFL,XFL,T: ## 11.28.17: findhom like fixed was findhom(NP,q,1,0,T) ## Created NOV 2015 ## 06.13.20 updated nargs=0 etc if member(nargs,{0,2}) then if nargs=0 then printf("-------------------------------------------------------------\n"); printf("findmaxind() \n"); printf("findmaxind(XFL,T) \n"); printf(" XFL is list of q-polynomials. \n"); printf(" T is an integer (ussually 0). Increase value of T if you \n"); printf(" a problem with not computing enough coefficients. \n"); printf(" Returns [P,NXFL], \n"); printf(" where P is maximal independent subset of XFL, and \n"); printf(" and NXFL is a list of indices.\n"); printf("-------------------------------------------------------------\n"); else XFL:=args[1]: T:=args[2]: P:=[XFL[1]]: NXFL:=[1]: for j from 2 to nops(XFL) do NP:=[op(P),XFL[j]]: NNXFL:=[op(NXFL),j]: if findhom(NP,q,1,T)={{}} then P:=NP: NXFL:=NNXFL: fi: od: RETURN([P,NXFL]): fi: else #ERROR(` number of arguments must be 0 or 2.`); error "number of arguments must be 0 or 2."; fi: end: qseries[findnonhom]:=proc(L,q,n,topshift) #This program generates a list of potential nonhomogeneous relations #of degree n among the list of q-series L. # local xx,x,y,z,nx,n2,n3,gg,goo,gooo,c,dh,jj,g,k,w,d,i,ct,D,ii,h,G,ANS; global X: if whattype(n)=integer and whattype(topshift)=integer then if n>0 and topshift>-20 then X:='X'; D:=nops(L); gg[1]:={}; xx:=expand((sum(x[i],i=1..D)+1)^(n) ): nx:=nops(xx): n2:=nx+20+topshift:#step this up if some solutions are spurious n3:=n2+1: print(`# of terms `,n3); c:=array(1..nx,1..n2+1); dh:=array(1..nx,1..D); for jj from 1 to nx do G:=op(jj,xx): for i from 1 to D do h[i]:=degree(G,x[i]): dh[jj,i]:=h[i]: od: w:=product(L[ii]^h[ii],ii=1..D): d:=series(w,q=0,n3+4); for i from 0 to n2 do c[jj,i+1]:=coeff(d,q,i); od; od: ct:= linalg[transpose](c): gooo:=(linalg[kernel](ct)); for k from 1 to nops(gooo) do goo:=gooo[k]; d:=op(dh): g[k]:=0: for i from 1 to nx do g[k]:=g[k]+goo[i]*product(X[ii]^d[i,ii],ii=1..D): od; gg[k]:=g[k]; od; print(`-----RELATIONS----of order---`,n); ANS:=convert(gg,set); RETURN(ANS); else ERROR(`n must be a positive integer and topshift must apositive integer greater then -20`); fi: else ERROR(`n and topshift must be integers.`); fi: end: qseries[findnonhomcombo]:=proc() #This program tries to express f as a polynomial #of degree n among the list of q-series in L. # # 05.13.20: fixed bug replace n=args[4] by nL (which is a list of degrees) local xx,x,y,z,nx,n2,n3,gg,goo,gooo,c,dh,nL,jj,g,k,w,d,i,ct,D,ii,h,G,ANSf,L,q,n,etaoption, topshift,f,func,fq,ANS,ANSETA,geta; global X: X:='X': f:=args[1]: L:=args[2]: q:=args[3]: nL:=args[4]: if nargs>4 and whattype(args[5])=integer then topshift:=args[5]: if nargs=6 then etaoption:=args[6]: else etaoption:=no: fi: fi: if nargs=4 then topshift:=0: etaoption:=no: fi: if nargs=5 and whattype(args[5])<>integer then topshift:=0: etaoption:=args[5]: fi: ##print(` n= `,n, `topshift =`,topshift); if nops(L)=nops(nL) and whattype(topshift)=integer then if topshift>-20 then D:=nops(L); gg[1]:={}; xx:=expand(mul( (x[i]+1)^nL[i],i=1..D)): nx:=nops(xx): n2:=nx+20+topshift:#step this up if some solutions are spurious n3:=n2+1: print(`# of terms `,n3); c:=array(1..nx+1,1..n2+1); print(`matrix is `,nx+1,` x `,n2+1); dh:=array(1..nx,1..D); for jj from 1 to nx do G:=op(jj,xx): for i from 1 to D do h[i]:=degree(G,x[i]): dh[jj,i]:=h[i]: od: w:=product(L[ii]^h[ii],ii=1..D): ##d:=taylor(w,q=0,n3+4); ##09-17-10: changed taylor to series d:=series(w,q=0,n3+4); func[jj]:=d: for i from 0 to n2 do c[jj,i+1]:=coeff(d,q,i); od; od: fq:=series(f,q,n3+4): for i from 0 to n2 do c[nx+1,i+1]:=coeff(fq,q,i): od: ct:= linalg[transpose](c): gooo:=(linalg[kernel](ct)): ANS:={}: ANSETA:={}: for k from 1 to nops(gooo) do goo:=gooo[k]: d:=op(dh): g[k]:=0: geta[k]:=0: if goo[nx+1]<>0 then for i from 1 to nx do g[k]:=g[k]+goo[i]*product(X[ii]^d[i,ii],ii=1..D): if etaoption=`yes` then geta[k]:=geta[k]+goo[i]*qseries[etamake](func[i],q,n3-2): fi: od: ANS:=ANS union {-g[k]/goo[nx+1]}: if etaoption=`yes` then ANSETA:=ANSETA union {-geta[k]/goo[nx+1]}: fi: fi: od: print(`-----possible linear combinations of degree------`,n): if etaoption = `yes` then print(ANSETA); fi: RETURN(ANS); else ERROR(`n must be a positive integer and topshift must apositive integer greater then -20`); fi: else ERROR(`n and topshift must be integers.`); fi: end: qseries[findpoly]:=proc() #This proc looks for a polynomial local x,y,q,deg1,deg2,ARGLIST,TYPELIST,CORRECTL,check,dim1,dim2,A,num,k,j,B,qq,l,kk,POLY,kkk,i,POLYg,POLYfunc,ss,numtyp,tA,opkk: global X,Y: lprint(`WARNING: X,Y are global.`); #relation between x,y of degree deg1 in x, and degree deg2 in y. #The relation is checked to order O(q^check). if nargs<5 then ERROR(` number of arguments must be 5 or 6.`); fi: x:=args[1]: y:=args[2]: q:=args[3]: deg1:=args[4]: deg2:=args[5]: ARGLIST:=[q,deg1,deg2]; TYPELIST:=map(whattype,ARGLIST); ##05/15/99: change string->symbol here. ##OLD: CORRECTL:=[string,integer,integer]: CORRECTL:=[symbol,integer,integer]: if TYPELIST=CORRECTL then if nargs=6 then check:=args[6]: fi: if nargs>6 then ERROR(` findpoly can at most 6 arguments`); fi: dim1:=(deg1+1)*(deg2+1): dim2:=dim1+10: print(` dims `, dim1, dim2); A:=array(1..dim1,1..dim2): num:=0: for k from 0 to deg1 do for j from 0 to deg2 do num:=num+1: B[num]:=X^k*Y^j: qq:=series(x^k*y^j,q,dim2+3): for l from 0 to (dim2-1) do A[num,l+1]:=coeff(qq,q,l): od: od: od: #removed 10/19/06: with(linalg): tA:=linalg[transpose](A): kk:=linalg[kernel](tA): if kk={} then lprint(` NO polynomial relation found. `); else POLY:=0; opkk:=op(kk); kkk:=opkk; for i from 1 to num do POLY:=POLY+B[i]*kkk[i]: od: POLYg:=0; for j from 0 to deg2 do POLYg:=POLYg+factor(coeff(POLY,Y,deg2-j))*Y^(deg2-j): od: if nargs=6 then print(`The polynomial is`); print(POLYg); POLYfunc:=unapply(POLYg,X,Y): ss:=series(POLYfunc(x,y),q,check+1): print(`Checking to order`,check); print(ss); RETURN(POLYg): else print(`The polynomial is`); fi: RETURN(POLY): fi: else numtyp:=nops(TYPELIST): ERROR(` Wrong type of argument. ARGLIST has type `,seq(TYPELIST[i],i=1..numtyp), `It should have type`,seq(CORRECTL[i],i=1..numtyp)); fi: end: qseries[findprod]:=proc(FL,T,M,Q) ## find z-linear combination of the ## 09.25.15: This function uses checkprod. ## 03.06.19: removed print statement local COMBS,nfl,S,BS,CP,vec,mcomb,cc,LL: COMBS:=[]: ## functions in FL which is a prob.product nfl:=nops(FL): ## T=max(abs) of coeffs in z-lin.combo S:=[seq(j,j=-T..T)]: ## M=max(abs(multiplicity))) in prod BS:=[seq(S,k=1..nfl)]:## Q is highest power of q CP:=combinat[cartprod](BS): while not CP[finished] do vec:=CP[nextvalue](); if igcd(op(vec))=1 then mcomb:=add(vec[k]*FL[k],k=1..nfl): cc:=qseries[checkprod](mcomb,M,Q): ##print(vec,cc); if cc[2]=1 then ##print(cc); LL:=cc[1]: COMBS:=[op(COMBS),[LL,vec]]: fi: fi: od; RETURN(COMBS): end: qseries[J2jaclist]:=proc() ## EXAMPLE: ## > with(qseries): ## > z1:=J[25, 5]*J[25]*J[50, 15]/J[25, 10]; ## J[25, 5] J[25] J[50, 15] ## z1 := ------------------------ ## J[25, 10] ## ## > J2jaclist(z1); ## [[25, 5, 1], [25, 1], [50, 15, 1], [25, 10, -1]] ## ## > x1:=J[25,1]; ## x1 := J[25, 1] ## ## > J2jaclist(x1); ## [[25, 1, 1]] ## ## > x2:=J[25]^2; ## 2 ## x2 := J[25] ## ## > J2jaclist(x2); ## [[25, 2]] ## local L1,L1n,JP,i,r,L1i,s,chk; global Jprod: if nargs=0 then printf("-------------------------------------------------------------\n"); printf("J2jaclist(Jprod) \n"); printf(" Jprod is a quotient of theta-functions encoded\n"); printf(" in terms of J[b,a], J[b]; \n"); printf(" The quotient is converted to a list.\n"); printf(" Each term J[b,a]^c or J[b]^c in the quotient is converted to an\n"); printf(" item [b,a,c] or [b,c] in the list.\n"); printf("-------------------------------------------------------------\n"); elif nargs = 1 then Jprod:=args[1]: if whattype(Jprod)=`^` then L1:=[Jprod]: else if whattype(Jprod)=indexed then if op(0,Jprod)='J' then RETURN([[op(Jprod),1]]); else ERROR(`not a J-prod`); fi: else L1:=[op(Jprod)]: fi: fi: L1n:=nops(L1): JP:=[]: for i from 1 to L1n do r:=degree(L1[i]): L1i:=L1[i]: if whattype(L1i)=`^` then r:=op(2,L1i): s:=op(op(1,L1i)): else r:=1: s:=op(L1i): fi: #check: ##print("L1i=",L1i,"J[s]^r=",J[s]^r); chk:=simplify(L1i-J[s]^r): if chk<>0 then error "chk<>0"; fi: JP:=[op(JP),[s,r]]: od: RETURN(JP); else ERROR(`invalid input type`); fi: end: ####################################################################### # qseries[jac2J] ####################################################################### macro(jacJ = `jac2J/jacJ`); jacJ:=proc(a::integer, b::integer, c::infinity) local Q; if a0 then Q:=J[b,a]; RETURN(Q): else RETURN(J[b]); fi: else ERROR(` a,b must satisy a0 then Q:=` `(q^a,q^b)[infinity]*` `(q^(b-a),q^b)[infinity]*` `(q^b,q^b)[infinity]; RETURN(Q): else RETURN(` `(q^b,q^b)[infinity]); fi: else ERROR(` a,b must satisy ab if T>0 then if a<>0 then if a<0 then RETURN(qjac(-a,b,T+b)*(-q^(a))): else if a>b then RETURN(qjac(a-b,b,T+b)*(-q^(b-a))): else t:=max(T,abs(b)): ##c:=trunc(1/2*(b-2*a+(4*a^2-4*a*b+b^2+8*b*t)^(1/2))/b)+1: ##Nov 15, 2002 added evalf to trunc c:=trunc(evalf(1/2*(b-2*a+(4*a^2-4*a*b+b^2+8*b*t)^(1/2))/b))+1: RETURN(tripleprod2(q^a,q^b,c)); fi: fi: else RETURN(qseries[etaq](q,b,T)); fi: else ERROR(` T must be positive. `); RETURN(): fi: end: ####################################################################### # qseries[jac2series] ####################################################################### ####################################################################### # FUNCTION : jac2series - converts a product of theta functions into # q-product form. # CALLING SEQUENCE : jacseries(jacexpr) # PARAMETERS : jacexpr - product of JAC(i,j,oo) # where i,j are integers # and 0 < i < j. # = # SYNOPSIS : # jacprod(jacexpr) returns a q-product;ie a product of the # a b # of functions of the form (q , q ). ####################################################################### qseries[jac2series]:=proc(JEXPR, T::integer) local JJ; JJ:=JEXPR: RETURN(eval(subs({JAC=qjac,infinity=T},JJ))): end: macro(tripleprod2=tripleprod2, qjac = qjac): qseries[jaclist2JACPROD]:=proc() ## 05.25.20: Function only takes 0 or 1 args (corrected) ## EXAMPLE: ## > with(qseries): ## > z1:=J[25, 5]*J[25]*J[50, 15]/J[25, 10]: ## > L1:=J2jaclist(z1): ## > jaclist2JACPROD(L1); ## JAC(5, 25, infinity) JAC(0, 25, infinity) JAC(15, 50, infinity) ## --------------------------------------------------------------- ## JAC(10, 25, infinity) ## ## > x1:=J[25,1]: ## > L2:=J2jaclist(x1): ## > jaclist2JACPROD(L2); ## JAC(1, 25, infinity) ## ## > x2:=J[25]^2: ## > L3:=J2jaclist(x2): ## > jaclist2JACPROD(L3); ## 2 ## JAC(0, 25, infinity) ## local jaclist,xj,L; if nargs=0 then printf("-------------------------------------------------------------\n"); printf("jaclist2JACPROD(jaclist) \n"); printf(" jaclist is a list of terms [b,a,c] or [b,c] \n"); printf(" corresponding to J[b,a]^c or J[b]^c \n"); printf(" These are converted to JAC(a,b,infinity)^c or JAC(0,b,infinity)^c"); printf("-------------------------------------------------------------\n"); elif nargs = 1 then jaclist:=args[1]: xj:=1: for L in jaclist do if nops(L)=2 then xj:=xj*JAC(0,L[1],infinity)^L[2]: else xj:=xj*JAC(L[2],L[1],infinity)^L[3]: fi: od: RETURN(xj): fi: end: qseries[jaclist2J]:=proc() local jaclist,xj,L; if nargs=0 then printf("-------------------------------------------------------------\n"); printf("jaclist2J(jaclist) \n"); printf(" jaclist is a list of terms [b,a,c] or [b,c] \n"); printf(" corresponding to J[b,a]^c or J[b]^c \n"); printf(" These are converted back to J notation "); printf("-------------------------------------------------------------\n"); elif nargs = 1 then jaclist:=args[1]: xj:=1: for L in jaclist do if nops(L)=2 then xj:=xj*J[L[1]]^L[2]: else xj:=xj*J[L[1],L[2]]^L[3]: fi: od: RETURN(xj): fi: end: qseries[jacprod]:=proc(a,b,q,T) local x,i,lasti: tripleprod(q^a,q^b,T)/tripleprod(q^(b),q^(3*b),T): end: ####################################################################### # qseries[jacprodmake] ####################################################################### macro(jaccheck = `jacprodmake/jaccheck`, periodfind = `jacprodmake/periodfind`, periodfind2 = `jacprodmake/periodfind2`, jacmake = `jacprodmake/jacmake`); ####################################################################### # FUNCTION : periodfind - finds the smallest period of a finite list # CALLING SEQUENCE : periodfind(A,T) # PARAMETERS : A - list of integers # P - positive integer # SYNOPSIS : # periodfind(A,T) returns P if # A[i] = A[i+P] for each i. ####################################################################### periodfind:=proc(A,T) local num,n,perfi,pp,dud,i,j,lastj,diffc; num:=T: n:=trunc(num/2): perfi:=0: pp:=2: while perfi=0 do dud:=0: while dud=0 do for i from 1 to pp do lastj:=trunc(num/pp)-2: for j from 0 to lastj do diffc:=A[i+pp*j]-A[i+pp*j+pp]: if diffc<>0 then dud:=1: fi: od: od: if dud=0 then perfi:=1: RETURN(pp): dud:=1: fi: od: pp:=pp+1: od: end; periodfind2:=proc(A,T,PP) global xprint: local num,n,perfi,pp,dud,i,j,lastj,diffc,pset,k,np; num:=T: n:=trunc(num/2): perfi:=0: pset:=numtheory[divisors](PP) minus {1}: pp:=pset[1]: if xprint then lprint("TRYING period pp=",pp); fi: k:=1: np:=nops(pset): while perfi=0 do dud:=0: while dud=0 do for i from 1 to pp do lastj:=trunc(num/pp)-2: for j from 0 to lastj do diffc:=A[i+pp*j]-A[i+pp*j+pp]: if diffc<>0 then dud:=1: fi: od: od: if dud=0 then perfi:=1: if xprint then lprint("PERIOD FOUND: ",pp); fi: RETURN(pp): dud:=1: fi: od: if k < np then k:=k+1: pp:=pset[k]: if xprint then lprint("TRYING period pp=",pp); fi: else RETURN( trunc(T/2)+2 ): dud:=1: fi: od: end; ####################################################################### # FUNCTION : jaccheck - checks whether an array corresponds a # theta-product. # CALLING SEQUENCE : jaccheck(A,P): # PARAMETERS : A - list of integers # P - positive integer # SYNOPSIS : # jaccheck(A,P) returns 1 if # A[i] = A[P-i] for each i, 1 < i < (P/2); # otherwise 0 is returned. If jaccheck(A,P)=1 and A is periodic # with period P, then A corresponds to a certain theta product. ####################################################################### jaccheck:=proc(A,P) local n,jac,i: n:=trunc(P/2): jac:=1: for i from 1 to n do if A[i]<>A[P-i] then jac:=0: RETURN(0): fi: od: if jac=1 then RETURN(1): fi: RETURN(-1): end: ####################################################################### # FUNCTION : jacmake - connverts a list of integers into a # theta-product if possible. # CALLING SEQUENCE : jacmake(A,T): # jacmake(A,T,P): # PARAMETERS : A - list of integers # T - positive integer # P - positive integer # SYNOPSIS : T # If f = product((1-q^i)^(-A[i]),i=1..T-1) + O(q ) # then # jacmake(A,T) will return a product of the form # # product( JAC(j,B,oo), j in S) # T # if this product agrees with f to O(q ). # # Here JAC(j,B,oo) corresponds to the theta-function # tripleprod(q^j,q^B,oo) when 0 < j < B # and # JAC(0,B,oo) corresponds to the eta-product etaq(q,B,oo). # jacmake(A,T,P) does the same except it assumes the base (period) B is # a divisor of P. ####################################################################### jacmake:=proc() # 04/23/10 NEW VERSION global xprint,jacp: local A,T,PP,pp,y,mp,i,y1,y2: # 12/17/12: jacp:=[jaccheck(A,pp),pp] # if jaccheck=1 then pp=theta period if xprint then lprint("jacmake started with args",args); fi: if nargs=2 or nargs=3 then # OK else ERROR("jacmake takes 2 or 3 args"); fi: A:=args[1]: T:=args[2]: if nargs=3 then PP:=args[3]: fi: if nargs=2 then pp:=periodfind(A,T): else pp:=periodfind2(A,T,PP): fi: if nargs=3 then if modp(PP,pp)<>0 then print(`ERROR: PP should be multiple of pp`); RETURN(): fi: fi: if pp>(T/2) then print(` no period found `); print(` This means either that there is no period,`); print(` or a larger value of T should be chosen.`); jacp:=[0,pp]: RETURN(): else ## 12/17/12: added global jacp jacp:=[jaccheck(A,pp),pp]: if jaccheck(A,pp)<>1 then print(` not a theta function `); RETURN(): else ##if nargs=3 then ## pp:=PP: ##fi: y:=1: mp:=modp(pp,2): if mp=0 then for i from 1 to ((pp)/2-1) do y:=y/(JAC(i,pp,infinity)/JAC(0,pp,infinity))^A[i]: od: ##OLD:y:=y/(JAC(pp/2,pp,infinity)/JAC(0,pp,infinity))^(A[pp/2]/2): y1:=JAC(pp/2,pp,infinity): y2:=JAC(0,pp,infinity): y:=y/y1^(A[pp/2]/2)*y2^(A[pp/2]/2): else for i from 1 to (pp-1)/2 do y:=y/(JAC(i,pp,infinity)/JAC(0,pp,infinity))^A[i]: od: fi: y:=y/JAC(0,pp,infinity)^A[pp]: RETURN(y): fi: fi: end: ####################################################################### # THE MAIN FUNCTION qseries[jacprodmake] ####################################################################### # 04/23/10 NEW VERSION # 05/03/10 added global var xprint qseries[jacprodmake]:=proc() global xprint,ft0,fixjacp,jacp: local f,q,T,ft,f0,_a,_b,i,n,j,d,_B,sum1,sum2,divj,divjb,m,_A,LT,PP,newT,je; fixjacp:=args: if not(type(xprint,boolean)) then xprint:=false: fi: if nargs=3 or nargs=4 then # OK else ERROR("nargs in jacprodmake should be 3 or 4"); fi: f:=args[1]: q:=args[2]: T:=args[3]: if nargs=4 then PP:=args[4]: fi: ##05/03/10 added leadterm stuff ft0:=series(f,q,T+5): if nops(ft0)=2 and op(1,ft0)=O(1) then newT:=trunc(op(2,ft0))+5: ft:=series(f,q,newT): else ft:=ft0: newT:=T+5: fi: LT:=series(`leadterm`(ft),q,newT): LT:=convert(LT,polynom): if whattype(ft)=series then f0:=coeff(ft,q,0): ##if f0=1 then _b:=series(ft/LT,q,newT): _b:=convert(_b,polynom): for i from 1 to T-1 do _B[i]:=coeff(_b,q,i): od: _A[1]:=_B[1]: for n from 2 to T-1 do sum2:=0: for j from 1 to n-1 do divj:=numtheory[divisors](j): sum1:=0: for d in divj do sum1:=sum1+d*(_A[d]): od: sum2:=sum2 + (_B[n-j])*sum1: od: sum1:=0: divjb:=numtheory[divisors](j) minus {n}: for d in divjb do sum1:=sum1+d*(_A[d]): od: sum2:=n*_B[n] - sum2 - sum1: _A[n]:=sum2/n: od: if nargs=3 then je:=jacmake(_A,T-1): else if xprint then lprint("_A done"); fi: je:=jacmake(_A,T-1,PP): fi: #05/04/10: added error and LT stuff if nops([je])=0 then fixjacp:=args: #12/12/12: changed following error to warning printf("WARNING: jacprodmake failed (see gobal var fixjacp)"); RETURN(): else RETURN(LT*je): fi: ##else ## ERROR(`coeff of q^0 must be 1`); ##fi: else ERROR(`f must be a series`); fi: end: macro(jaccheck = jacprod, periodfind = periodfind, periodfind2 = periodfind2, jacmake = jacmake); qseries[Jetamake]:=proc() # #10.19.19: This is version of qetamake which returns eta-products using # J-notation; ie. eta(p*tau) <-> J[p] #This is a version of etamake which returns _E(q^m) instead of eta(m*tau) #This procedure computes an eta-product expansion #of the series f to order O(q^last). local f,last,fp,tc,exq,g,aa,ld,h,hh,i,cf,Jetaprod,alast,sf: global q: if nargs=0 then printf("---------------------------------------------------------\n"); printf(" Jetamake(f,q,T) \n"); printf(" qetamake is a variant of etamake. \n"); printf(" etamake(f,q,T) converts the q-series f into an eta-product\n"); printf(" expansion that agrees with f to O(q^T). \n"); printf(" Jetamake returns a product of the functions of the form J[m]\n"); printf(" where J[m] = (q^m;q^m)oo = (1-q^m)*(1-q^(2m))*(1-q^(3m))... \n"); printf(" In other words, J[m] = eta(m*tau)/q^(m/24). \n"); printf("---------------------------------------------------------\n"); else f:=args[1]: q:=args[2]: last:=args[3]: sf:=series(f,q,last+10): fp:=convert(sf,polynom): tc:=tcoeff(fp,q): exq:=ldegree(fp,q): g:=normal(fp/tc/q^exq): aa:=tc: ld:=1: alast:=last-exq: while ld>0 do h:=series(g-1,q=0,alast+1): hh:=0: for i from 1 to alast do hh:=hh+coeff(h,q,i)*q^i: od: h:=hh: ## ##08/20/99: bug fix ldegree(0,q) returns infinity ## in maple V release 5 if h=0 then ld:=0: else ld:=ldegree(h,q): fi: cf:=coeff(h,q,ld): if ld>0 then ##aa:=_E(q^ld)^(-cf)*aa: aa:=J[ld]^(-cf)*aa: g:=g*etaq(q,ld,alast)^cf: fi: od: ##etaprod:=aa ##Fixed 05/18/05 Jetaprod:=aa*q^exq: RETURN(Jetaprod): fi: end: qseries[Jterm2JACPROD]:=proc() local LJT,jterm2,JL,JP,jterm,dilfactor,conterm,qterm,selcon: local qjterm,qpow: ############################################################################# ## > y1:=2*J[25, 5]*J[25]*J[50, 15]/J[25, 10]; ## 2 J[25, 5] J[25] J[50, 15] ## y1 := -------------------------- ## J[25, 10] ## ## > Jterm2JACPROD(y1,1); ## 2 JAC(5, 25, infinity) JAC(0, 25, infinity) JAC(15, 50, infinity) ## ----------------------------------------------------------------- ## JAC(10, 25, infinity) ## ## > Jterm2JACPROD(y1,1/5); ## 2 JAC(1, 5, infinity) JAC(0, 5, infinity) JAC(3, 10, infinity) ## -------------------------------------------------------------- ## JAC(2, 5, infinity) ############################################################################# # Thu, May 21, 2020 8:58:20 PM --- fixed bug by adding conterm if nargs=0 then printf("---------------------------------------------------------\n"); printf(" Jterm2JACPRPOD(jterm,dilfactor) \n"); printf(" Jterm2JACPRPOD(jterm) \n"); printf(" Converts jterm to JACPROD and also does q -> q^dilfactor\n"); printf(" where default is dilfator=1. \n"); printf(" \n"); printf(" EXAMPLE: \n"); printf(" y1:=2*J[25, 5]*J[25]*J[50, 15]/J[25, 10];\n"); printf(" Jterm2JACPROD(y1,1);\n"); printf(" Jterm2JACPROD(y1,1/5);\n"); printf("---------------------------------------------------------\n"); else if nargs=2 or nargs=1 then jterm:=args[1]: if nargs=2 then dilfactor:=args[2]: else dilfactor:=1: fi: if type(jterm,`*`) or type(jterm,indexed) then if type(jterm,`*`) then LJT:=[op(jterm)]: else LJT:=[jterm]: fi: # remove non J-stuff jterm2:=select(has,jterm,J): conterm:=simplify(jterm/jterm2): JL:=dilatejaclist(J2jaclist(jterm2),dilfactor): JP:=subs(q=q^dilfactor,conterm)*jaclist2JACPROD(JL): RETURN(JP): else RETURN(jterm): fi: else ERROR("nargs = 0, 1 or 2 "); fi: fi: end: qseries[lqdegree]:=proc() local FT,FTC,FT1,FT2,M1,MS1,qexp: ##> Y:=1/2*JAC(1,2,infinity) + q*JAC(3,4,infinity) + JAC(1,5,infinity)/q^(11/2); ## JAC(1, 5, infinity) ## Y := 1/2 JAC(1, 2, infinity) + q JAC(3, 4, infinity) + ------------------- ## 11/2 ## q ##> lqdegree(Y); ## -11/2 if nargs=0 then printf("-------------------------------------------------------------\n"); printf("lqdegree(qexp) \n"); printf(" qexp is a sum of q-monomials. \n"); printf(" Degrees in q are allowed to be negative and fractional. \n"); printf(" Returns the lowest degree in q that occurs. \n"); printf("-------------------------------------------------------------\n"); elif nargs = 1 then qexp:=args[1]: if convert(qexp,polynom) <>FAIL and ldegree(convert(qexp,polynom),q)<> FAIL then ldegree(convert(qexp,polynom),q); else FT:=qexp: M1:=map(lqdegree0,[op(FT)]): MS1:=convert(M1,set) minus{FAIL}: min(MS1); fi: fi: end: qseries[lqdegree0]:=proc() local FT,FTC,FT1,FT2,qexp: ######################################################################### ##> B:=sqrt(q)*JAC(0,1,infinity); ## 1/2 ## B := q JAC(0, 1, infinity) ##> lqdegree0(B); ## 1/2 ##> B1:=(q)*JAC(0,1,infinity); ## B1 := q JAC(0, 1, infinity) ##> lqdegree0(B1); ## 1 ##> B2:=JAC(0,1,infinity); ## B2 := JAC(0, 1, infinity) ##> lqdegree0(B2); ## 0 ##> B3:=JAC(0,1,infinity)/q^3; ## JAC(0, 1, infinity) ## B3 := ------------------- ## 3 ## q ##> lqdegree0(B3); ## -3 ##> B4:=JAC(0,1,infinity)/q^(1/3); ## JAC(0, 1, infinity) ## B4 := ------------------- ## 1/3 ## q ##> lqdegree0(B4); ## -1/3 ######################################################################### if nargs=0 then printf("-------------------------------------------------------------\n"); printf("lqdegree0(qexp) \n"); printf(" qexp is q-monomial. \n"); printf(" This function returns the degree in q.\n"); printf(" It also handles fractional degrees. \n"); printf("-------------------------------------------------------------\n"); elif nargs = 1 then qexp:=args[1]: if ldegree(qexp,q)<>FAIL then ldegree(convert(qexp,polynom),q); else FT:=qexp: FTC:=subs(q=1,FT): FT1:=FT/FTC: FT2:=[op(FT1)]: if nops(FT2)=2 and FT2[1]=q then FT2[2]; else RETURN(FAIL); fi: fi: fi: end: qseries[mprodmake]:=proc(f,q,last) #05/18/05 #This procedure computes a product expansion of the form # (1+q^n1)*(1+q^n2).... #of the series f to order O(q^last). local fp,tc,exq,g,aa,ld,h,hh,i,cf,etaprod,alast,sf,qqprod: sf:=series(f,q,last+10): fp:=convert(sf,polynom): tc:=tcoeff(fp,q): exq:=ldegree(fp,q): g:=normal(fp/tc/q^exq): aa:=tc: ld:=1: alast:=last-exq: while ld>0 do h:=series(g-1,q=0,alast+1): hh:=0: for i from 1 to alast do hh:=hh+coeff(h,q,i)*q^i: od: h:=hh: ## ##08/20/99: bug fix ldegree(0,q) returns infinity ## in maple V release 5 if h=0 then ld:=0: else ld:=ldegree(h,q): fi: cf:=coeff(h,q,ld): if ld>0 then aa:=(1+q^ld)^(cf)*aa: g:=g*(1+q^ld)^(-cf): fi: od: qqprod:=q^(exq)*aa: RETURN(qqprod): end: qseries[oldsift]:=proc(s,q,n,k,T) # # sum a_i q^i --> sum a_[ni+k] q^i # local y,i,st,lasti: st:=series(s,q,T+5): if whattype(st)=series then y:=0: lasti:=floor((T-k)/n): for i from 0 to lasti do ##y:=y+coeff(s,q,(n*i+k))*q^i: ##fixed 11-16-06 y:=y+coeff(st,q,(n*i+k))*q^i: od: RETURN(y): else ERROR(`s must be a series`); fi: end: qseries[qspackageversion]:=proc() printf("****************************************************\n"); printf("*\n"); printf("* qseries package version 1.3j \n"); printf("* Sat, Jun 13, 2020 3:10:39 PM \n"); printf("*\n"); printf("* This version tested on MAPLE 2020\n"); printf("*\n"); printf("* Please report any problems to fgarvan@ufl.edu\n"); printf("* See \n"); printf("* http://qseries.org/fgarvan/qmaple/qmaple.html \n"); printf("* for documentation and help.\n"); printf("*\n"); printf("* Previous versions:\n"); printf(" 1.3j - Jun 2020 (MAPLE 2020)\n"); printf(" 1.3i - Jun 2020 (MAPLE 2020)\n"); printf(" 1.3h - May 2020 (MAPLE 2020)\n"); printf(" 1.3g - Apr 2020 (MAPLE 2020)\n"); printf(" 1.3f - Feb 2020 (MAPLE 2019)\n"); printf(" 1.3e - Jan 2020 (MAPLE 2019)\n"); printf(" 1.3d - Oct 2019 (MAPLE 2019)\n"); printf(" 1.3c - Jul 2019 (MAPLE 2019)\n"); printf(" 1.3b - Mar 2019 (MAPLE 2018)\n"); printf(" 1.3a - Nov 2017 (MAPLE 2017)\n"); printf(" 1.3 - Aug 2016 (MAPLE 2015)\n"); printf(" 1.2 - Dec 2012 (MAPLE 16)\n"); printf(" 1.1 - Ju1 2012 (MAPLE 13)\n"); printf(" 1.0 - Jun 2009 (MAPLE 10)\n"); printf(" 0.9 - Apr 2008 (MAPLE 10)\n"); printf(" 0.8 - May 2005 (MAPLE 9)\n"); printf(" 0.7 - Mar 2004\n"); printf(" 0.6 - Nov 2002\n"); printf(" 0.5 - May 2000\n"); printf(" 0.4 - Jan 2000\n"); printf(" 0.3 - Nov 1999\n"); printf(" 0.2 - Dec 1998\n"); printf(" 0.1 - Dec 1997\n"); printf("****************************************************\n"); RETURN(): end: qseries[qspversion]:=proc() printf("****************************************************\n"); printf("*\n"); printf("* qseries package version 1.3j \n"); printf("* Sat, Jun 13, 2020 3:10:39 PM \n"); printf("* This version tested on MAPLE 2020\n"); printf("*\n"); printf("****************************************************\n"); RETURN(): end: qseries[qsfunctions]:=proc() local qLIST: ## DATE OF UPDATE: Sat, Jun 13, 2020 3:10:39 PM qLIST:=[ aqprod, briefqshelp, qschanges, checkmult, checkprod, dilatejaclist, dilateJterm, etamake, etamakebeta, etaq, findcong, findcongbeta, findhom, findhomcombo, findhomcombomodp, findhommodp, findlincombo, findlincombomodp, findmaxind, findnonhom, findnonhomcombo, findpoly, findprod, J2jaclist, jac2J, jac2prod, jac2series, jaclist2JACPROD, jaclist2J, jacprod, jacprodmake, Jetamake, Jterm2JACPROD, lqdegree, lqdegree0, mprodmake, oldsift, qspackageversion, qspversion, qsfunctions, qshelp, prodmake, qbin, qdegree, qetamake, qfactor, qs2jaccombo, quinprod, sift, theta, theta2, theta3, theta4, tripleprod, winquist, zqfactor]: RETURN(qLIST); end: qseries[qshelp]:=proc() local qshelpTAB,funcsL,tmp,a,qsprocname: qsprocname:=args[1]: funcsL:=qsfunctions(): if member(qsprocname,funcsL) then qshelpTAB:=table([ aqprod=[ " n-1 ", "FUNCTION : qseries[aqprod] - the product (1-a)(1-aq)..(1-aq ) ", " ", "CALLING SEQUENCE : aqprod(a,q,n); ", " ", "PARAMETERS : a,q - names ", " n - integer ", " ", "SYNOPSIS : ", " aqprod(a,q,n) returns the product ", " n-1 ", " (a) = (a;q) = (1-a)(1-aq)..(1-aq ), ", " n n ", " where n is a given positive integer. Here a and q are names, variables, ", " or constants. If n=0 then 1 is returned. It returns ", " ((1-aq^(-1))...(1-aq^n))^(-1) when n is negative integer. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> aqprod(); ", "--------------------------------------------------------- ", " aqprod(a,q,n) ", " (1-a)(1-aq)...(1-aq^(n-1)) when n is a nonnegative integer, ", " ((1-aq^(-1))...(1-aq^n))^(-1) when n is negative integer. ", " else returns a symbolic form. ", " ", " EXAMPLE: ", " aqprod(a,q,n) ", " aqprod(a,q,0) ", " aqprod(a,q,5) ", " aqprod(a,q,-5) ", " ", "-------------------------------------------------------- ", "> aqprod(a,q,n); ", " (a, q)[n] ", " ", "> aqprod(a,q,0); ", " 1 ", " ", "> aqprod(a,q,5); ", " 2 3 4 ", " (1 - a) (-a q + 1) (-a q + 1) (-a q + 1) (-a q + 1) ", " ", "> aqprod(a,q,-5); ", " 15 ", " q ", " - -------------------------------------------------------- ", " / 2 \ / 3 \ / 4 \ / 5 \ ", " 5 | q | | q | | q | | q | ", " a (1 - q/a) |1 - ----| |1 - ----| |1 - ----| |1 - ----| ", " \ a / \ a / \ a / \ a / ", " ", "SEE ALSO : ", " "],briefqshelp=[ "FUNCTION : qseries[briefqshelp] - brief help for a qseries function ", " ", "CALLING SEQUENCE : briefqshelp(funcname) ", " ", "PARAMETERS : funcname - name of qseries function ", " ", "SYNOPSIS : ", " Brief help for a function in the qseries package ", " Only returns FUNCTION, CALLING SEQUENCE and PARAMETERS ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> briefqshelp(aqprod); ", " n-1 ", "FUNCTION : qseries[aqprod] - the product (1-a)(1-aq)..(1-aq ) ", " ", "CALLING SEQUENCE : aqprod(a,q,n); ", " ", "PARAMETERS : a,q - names ", " n - integer ", " "],qschanges=[ "FUNCTION : qseries[qschanges] - print out list of recent qschanges to ", " qseries package ", " ", " ", "CALLING SEQUENCE : qschanges() ", " ", " ", "PARAMETERS : none ", " ", " ", "GLOBAL VARIABLES : none ", " ", "SYNOPSIS : ", " ", " qschanges() prints out a list of qschanges in previous versions ", " of the qseries package. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> qschanges(); ", "************************************************************** ", "* ", "* qseries package version 1.1 - Mon Jul 16 15:24:26 EDT 2012 ", "* qseries package version 1.2 - Thu Dec 20 11:52:01 EST 2012 ", "* qseries package version 1.3 - Fri Aug 12 15:07:08 EDT 2016 ", "* qseries package version 1.3a - Tue Nov 28 13:48:19 EST 2017 ", "* qseries package version 1.3b - Wed, Mar 6, 2019 8:15:20 PM ", "* qseries package version 1.3c - Wed, Jul 17, 2019 9:41:24 AM ", "* qseries package version 1.3d - Sat, Oct 19, 2019 9:58:53 AM ", "* qseries package version 1.3e - Fri, Jan 24, 2020 11:06:28 PM ", "* qseries package version 1.3f - Sat, Feb 8, 2020 10:33:00 PM ", "* qseries package version 1.3g - Fri, Apr 17, 2020 8:11:55 PM ", "* ", "* This version tested on MAPLE 2020 ", "* ", "* Changes since version 1.3 ", "* ", "* * New function qsfunctions() ", "* This lists function in the package. ", "* ", "* * Change function names: ", "* packageversion -> qspackageversion ", "* changes -> qschanges ", "* ", "* * nargs version of the following functions: ", "* aqprod, checkprod ", "* ", "* * New function J2jaclist ", "* Takes 0 or 1 args. Converts theta-quotient in J-notation ", "* to a jaclist. J[b,a]^c and J[b]^c correspond to ", "* [b,a,c] or [b,c] in the list. ", "* ", "* * New function jaclist2JACPROD ", "* Takes 0 or 2 args.Converts theta-quotient as a jaclist to ", "* JAC-notation. ", "* ", "* * New function dilatejaclist ", "* Takes 0 or 2 args. ", " Does q -> q^r in jacprod corresponding to ", "* a jaclist. It is used by Jterm2JACPRPOD. ", "* ", "* * New function Jterm2JACPROD ", "* Takes 0 or 2 args.Converts jterm to JACPROD and also ", "* does q -> q^r using dilatejaclist. ", "* * New function jac2J ", "* This functions takes 0 or 3 args. ", "* This is just a variant of etamake (or qetamake) ", "* which returns J[m] instead of eta(m*tau) etc. ", "* ", "* * New function Jetamake ", "* This functions takes 0 or 3 args. ", "* This is just a variant of etamake (or qetamake) ", "* which returns J[m] instead of eta(m*tau) etc. ", "* ", "* * Testing new function version findcongbeta ", "* Now takes up to 5 args try findcongbeta() for help ", "* ", "* * Removed print from findprod ", "* ", "* * Fixed small bug in findmaxind ", "* ", "* * Fixed bug in findhom (coeffs now computed from constant ", "* term instead of from q^1) ", "* ", "* * Added global var _xprint to findhomcombo ", "* ", "* ", "* Changes since version 1.2 ", "* ", "* * Added global vars _etalisttop, _etalistbot, ", "* _etaconst to etamake (used by latex progs in ", "* new ramarobinsids package) ", "* ", "* * New function findmaxind ", "* ", "* * Changed taylor to series in both findhom and findhommodp ", "* so they can handle negative powers of q. ", "* ", "* * New version of sift can now handle negative exponents ", "* See oldsift for old version. The new sift needs the ", "* functions lqdegree and lqdegree0 from thetaids package. ", "* So these have also been added to qseries package. ", "* ", "* * Added xprint option to findhom to avoid extra printing in large loops ", "* Default is xprint=false (no extra printing) ", "* ", "* * jac2series can now handle JAC(a,b,infinity) when ", "* a<0 or a>b. ", "* ", "* * fixed major bug in findcong ", "* The old version missed some congruences. ", "* ", "* * findhom works correctly when nops(L)=1 ", "* ", "* * added new function checkmult ", "* This function checks with a give qseries has multiplicative coefficients. ", " USAGE: ", " checkmult() ", " checkmult(QS,T) ", " checkmult(QS,T,yes) ", "* ", "* * aqprod(a,q,n) can now handle negative n ", "* ", "* * added new function checkprod ", "* This function checks a qseries has a nice product. ", " USAGE: ", " checkprod(f,M,Q) ", "* ", "* * added new function findprod ", "* This function searches for Z-linear combinations of ", "* the functions in FL which are probable products. ", "* This function also uses checkprod. ", " USAGE: ", " findprod(FL,T,M,Q) ", "* ", "* * aqprod(a,q,n) can now handle negative n ", "* ", "* Changes since version 1.1 ", "* ", "* * Added global var jacp to jacmake. ", "* ", "* * In jacprodmake change failure from ERROR to WARNING: ", " In jacprodmake changed handling of half-integer exponents. ", "* ", "* * In etamake added var ebase (to be used by jacprodmake ", "* when converting an etaprod to a jacprod. ", "* ", "* ", "* Changes since version 1.0 ", "* ", "* * Added new function qdegree ", "* qdegree(QS) returns degree in q. ", "* ", "* * Added new function findcong ", " This function finds congruences c(A*n+B) == 0 mod C ", " for a give qseries f=add(c(n)*q^n). ", "* ", "* * Added new function qs2jaccombo ", " This function converts a sum of q-series to a sum ", " of jacprods if possible. ", "* ", "* * Local vars added to procs where necessary ", "* ", "* * jacprodmake now takes 3 or 4 args ", "* jacprodmake(f,q,T) works as before. ", "* jacprodmake(f,q,T,P) returns a jacprod (if it exists) on ", " base q^b where b is a divisor of P. ERROR is returned ", " if f is not a jacprod. ", " This new version also handles the case where the coeff ", " of q^0 is not 1. ", " PLEASE report any bugs. ", "* ", "* * New hidden function periodfind2 added. ", " This is used by jacprodmake to find period assuming it ", " is a divisor of a given integer. ", "* ", "* * New hidden function jacmake now takes 2 or 3 args. ", "* It is used by jacprodmake. ", "* ", "* * Added instructions for windows installation ", "* Tested with Maple 11 ", "* ", "* * Corrected email and homepage listed below ", "* New email: fgarvan@ufl.edu ", "* New homepage: http://www.math.ufl.edu/~fgarvan ", "* ", "* Changes since version 0.9 ", "* ", "* * Updated packageversion with new email address and homepage. ", "* ", "* * qbin accepts q=root of unity etc (Suggested by Michael Somos) ", "* ", "* * Added function findlincombomodp ", "* ", "* * Fixed bug in findlincombo ", "* ", "* * Local username changed from frank to fgarvan ", "* New email: fgarvan@ufl.edu ", "* New homepage: http://www.math.ufl.edu/~fgarvan ", "* ", "* * Corrected typo in online help for findlincombo ", "* ", "* Changes since version 0.8 ", "* ", "* * Added online FUNCTIONS page: ", "* http://www.math.ufl.edu/~fgarvan/qmaple/functions/ ", "* ", "* * Added gooo to global list in findhomcombo ", "* * Added new function findlincombo ", "* ", "* * Fixed bugs in findhomcombo and modp version ", "* There was unnecessary etamake comp when etaopt=no ", "* ", "* * updated prodmake so it can have symbolic exponents ", "* Used series instead of taylor ", "* ", "* * new function findhomcombomodp ", "* This is a modp version of findhomcombo ", "* Useage: findhomcombomodp(f,L,p,q,n,topshift,etaoption)) ", "* ", "* * Fixed a bug in findhomcombo when nops(L)=1 ", "* ", "* * Fixed bug in findpoly ", "* ", "* * In qetamake change E(q) to _E(q) ", "* ", "* * Fixed minor bug in sift ", "* ", "* Changes since version 0.7 ", "* ", "* * changed name of function version to packageversion ", "* since version is maple builtin function ", "* Useage: packageversion() ", "* ", "* * new function findhommodp ", "* This is a modp version of findhom ", "* Useage: findhommodp(L,p,q,n,topshift) ", "* ", "* * new function mprodmake ", "* Finds product expansion (1+q^n1)*(1+q^n2)*... ", "* Useage: mprodmake(f,q,last) ", "* ", "* * fixed bug in qetamake ", "* ", "* Changes since version 0.6 (Nov 2002): ", "* ", "* * new function qetamake ", "* This is just a variant of etamake which returns E(q^m) ", "* instead of eta(m*tau). ", "* ", "* * fixed bug in jac2series ", "* ", "* Changes since version 0.5: ", "* ", "* * new function zqfactor ", "* Takes 4 or 5 args: ", "* zqfactor(F,z,q,N,buglim) ", "* zqfactor(F,z,q,N) ", "* factors F into a product of terms ", "* of the form (1 - a[i,j] z^i q^j). ", "* Factor F into a product of terms (1 - a[i,j] z^i q^j) ", "* N = largest j ", "* buglim = max number of terms (default is 1000). ", "* ", "* Changes since version 0.4: ", "* ", "* * prodmake now takes 3 or 4 args. ", "* prodmake(f,q,t) returns a q-product. ", "* prodmake(f,q,t,list) returns a q-product as a list of exponents. ", "* * new function changes() - returns changes since previous release. ", "* ", "* Please report any problems to fgarvan@ufl.edu ", "* See ", "* http://www.math.ufl.edu/~fgarvan/qmaple/qmaple.html ", "* for documentation and help. ", "* ", "************************************************************** ", " "],checkmult=[ "FUNCTION : qseries[checkmult] - determine whether coefficients are multiplicative ", " ", " ", "CALLING SEQUENCE : checkmult() ", " checkmult(QS,T) ", " checkmult(QS,T,yes) ", " ", " ", "PARAMETERS : QS - q-series ", " T - positive integer ", " arg3 - yes/no ", " ", "GLOBAL VARIABLES : none ", " ", "SYNOPSIS : ", " Returns 1 if QS up to Q^T is multiplicative ", " If nargs=3 and arg3=yes then m,n where QS fails to ", " be multiplicative are printed. ", " Otherwise only the first instance of failure is ", " printed. ", " ", "EXAMPLES : ", " ", "> with(qseries); ", "> checkmult(); ", "--------------------------------------------------------- ", " checkmult(QS,T) ", " checkmult(QS,T,yes) ", " Returns 1 if QS up to Q^T is multiplicative ", " If nargs=3 and arg3=yes then m,n where QS fails to ", " be multiplicative are printed. ", " Otherwise only the first instance of failure is ", " printed. ", "--------------------------------------------------------- ", "> X5:=series(etaq(q,5,500)^5/etaq(q,1,500)*q,q,501): ", "> checkmult(X5,500); ", "\" MULTIPLICATIVE\" ", " 1 ", " ", "> A1:=add(q^(n^2)/aqprod(-q,q,n),n=0..20): ", "> AS1:=series(A1,q,400): ", "> checkmult(AS1,399); ", "\"NOT MULTIPLICATIVE\" ", "\"failure at m=\", 5, \"and n=\", 2 ", " 0 ", " ", "> checkmult(AS1,14,yes); ", "\"NOT MULTIPLICATIVE\" ", "\"failure at m=\", 5, \"and n=\", 2 ", "\"NOT MULTIPLICATIVE\" ", "\"failure at m=\", 7, \"and n=\", 2 ", "\"NOT MULTIPLICATIVE\" ", "\"failure at m=\", 4, \"and n=\", 3 ", "\"NOT MULTIPLICATIVE\" ", "\"failure at m=\", 3, \"and n=\", 4 ", "\"NOT MULTIPLICATIVE\" ", "\"failure at m=\", 2, \"and n=\", 5 ", "\"NOT MULTIPLICATIVE\" ", "\"failure at m=\", 2, \"and n=\", 7 ", " 0 ", " ", "DISCUSSION : ", " We see that the coeffs of eta(5tau)^5/eta(tau) are multiplicative ", " at least up to q^500. The coeffs of A1 are not. The first failure ", " occurs for the pair 2,5. ", " ", "SEE ALSO : ", " ", " "],checkprod=[ "FUNCTION : qseries[checkprod] - Check if q-series is a probable nice product ", " ", "CALLING SEQUENCE : checkprod(f,M,Q) ", " ", "PARAMETERS : f - q-series ", " M - positive integer ", " Q - positive integer ", " ", "GLOBAL VARIABLES : none ", " ", "SYNOPSIS : Let f = c1*q^a*mul ( (1 - q^j)^b[j], j=1 .. Q) + O(q^Q) ", " where c1,a are integers (a>=0). ", " Let B=MAX abs(b[j]). ", " If B with(qseries); ", "> R:=add(q^(n^2),n=0..10): ", "> RS:=series(R,q,101): ", "> checkprod(R,1,20); ", " [0, 6] ", " ", "> prodmake(RS,q,20,list); ", " [-1, 1, 0, -1, 1, -1, 1, 0, -1, 1, -2, 3, -1, -1, 2, -5, 6, -4, 2] ", " ", "> TH1:=add(q^(n^2),n=-10..10): ", "> checkprod(TH1,1,20); ", " [0, 3] ", " ", "> prodmake(TH1,q,99,list); ", "[-2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, ", " -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, ", " -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, ", " -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, -2, 3, -2, 1, ", " -2, 3, -2, 1, -2, 3, -2, 1, -2, 3] ", " ", "> checkprod(TH1,4,99); ", " [0, 1] ", " ", "> checkprod(2*q*TH1,4,99); ", " [1, 1] ", " ", "DISCUSSION : ", " We see that R is probably not a nice product but TH1 is. ", " ", "SEE ALSO : prodmake, findprod ", " ", " "],dilatejaclist=[ "FUNCTION : qseries[dilatejaclist] - changes q to q^r in jaclist ", " ", "CALLING SEQUENCE : dilatejaclist() ", " dilatejaclist(jaclist,r) ", " ", " ", "PARAMETERS : jaclist - list ", " r - postive integer ", " ", " ", "GLOBAL VARIABLES : none ", " ", "SYNOPSIS : ", " ", " dilatejaclist(jaclist,r) performs q->q^r on given jaclist. ", " jaclist=[[M,r,n], .... ] where [M,r,n] corresponds to JAC(r,M,infinity). ", " ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> dilatejaclist(); ", "--------------------------------------------------------- ", " dilatejaclist(jaclist,r) ", " Does q -> q^r in the jacprod corresponding to jaclist. ", " ", " EXAMPLE: ", " jlist:=[[25, 5, -1], [25, 10, 1], [25, 1], [50, 5, 1]]; ", " jlist2:=dilatejaclist(jlist,1/5); ", "-------------------------------------------------------- ", " ", "> jlist:=[[25, 5, -1], [25, 10, 1], [25, 1], [50, 5, 1]]; ", " jlist := [[25, 5, -1], [25, 10, 1], [25, 1], [50, 5, 1]] ", " ", "> jaclist2JACPROD(jlist); ", " JAC(10, 25, infinity) JAC(0, 25, infinity) JAC(5, 50, infinity) ", " --------------------------------------------------------------- ", " JAC(5, 25, infinity) ", " ", "> jlist2:=dilatejaclist(jlist,1/5); ", " jlist2 := [[5, 1, -1], [5, 2, 1], [5, 1], [10, 1, 1]] ", " ", "> jaclist2JACPROD(jlist2); ", " JAC(2, 5, infinity) JAC(0, 5, infinity) JAC(1, 10, infinity) ", " ------------------------------------------------------------ ", " JAC(1, 5, infinity) ", " ", "DISCUSSION : ", " ", "SEE ALSO : ", " ", " "],dilateJterm=[ "FUNCTION : qseries[dilateJterm] - changes q to q^r in J-term ", " ", "CALLING SEQUENCE : dilateJterm() ", " dilatejaclist(jterm,r) ", " ", " ", "PARAMETERS : jterm - a product in J-notation ", " r - postive integer ", " ", " ", "GLOBAL VARIABLES : none ", " ", "SYNOPSIS : ", " ", " dilateJterm(jterm,r) performs q->q^r on given jterm ", " ", " ", "EXAMPLES : ", "> with(qseries): ", "> E1:=etaq(q,1,5000): ", "> E10:=sift(E1,q,5,0,5000): E11:=sift(E1,q,5,1,5000): E12:=sift(E1,q,5,2,5000): ", "> E13:=sift(E1,q,5,3,5000); E14:=sift(E1,q,5,4,5000); ", " E13 := 0 ", " ", " E14 := 0 ", " ", "> symE10a:=jac2J(jacprodmake(E10,q,1000)); ", " J[5, 2] J[5] ", " symE10a := ------------ ", " J[5, 1] ", " ", "> symE11a:=jac2J(jacprodmake(E11,q,1000)); ", " symE11a := -J[5] ", " ", "> symE12a:=jac2J(jacprodmake(E12,q,1000)); ", " J[5, 1] J[5] ", " symE12a := - ------------ ", " J[5, 2] ", " ", "> dilatejaclist(J2jaclist(symE10a),5); ", " [[25, 5, -1], [25, 10, 1], [25, 1]] ", " ", "> symE10:=jaclist2J(%%); ", " J[25, 10] J[25] ", " symE10 := --------------- ", " J[25, 5] ", " ", "> symE11:=dilateJterm(symE11a,5); ", " symE11 := -J[25] ", " ", "> symE12:=dilateJterm(symE12a,5); ", " J[25, 5] J[25] ", " symE12 := - -------------- ", " J[25, 10] ", " ", "> symE10 + q*symE11+q^2*symE12; ", " 2 ", " q J[25, 5] J[25] J[25, 10] J[25] ", " - ----------------- - q J[25] + --------------- ", " J[25, 10] J[25, 5] ", " ", "> convert(map(Jterm2JACPROD,[op(%%)]),`+`); ", " 2 ", " q JAC(5, 25, infinity) JAC(0, 25, infinity) ", "- -------------------------------------------- - q JAC(0, 25, infinity) ", " JAC(10, 25, infinity) ", " ", " JAC(10, 25, infinity) JAC(0, 25, infinity) ", " + ------------------------------------------ ", " JAC(5, 25, infinity) ", " ", "> series(etaq(q,1,1000)-jac2series(%%,1000),q,1000); ", " 1000 ", " O(q ) ", " ", "DISCUSSION : ", " We found the elements of the 5-dissection of (q;q)oo. This identity in ", "J-notation is ", " 2 ", " q J[25, 5] J[25] J[25, 10] J[25] ", " (q;q)oo = - ----------------- - q J[25] + --------------- ", " J[25, 10] J[25, 5] ", "We used dilateJterm to sub q->q^5. ", "We also confirmed the identity up to q^1000. ", " ", "SEE ALSO : dilatejaclist ", " ", " "],etamake=[ "FUNCTION : qseries[etamake] - Convert a q-series into an eta-product expansion ", " ", "CALLING SEQUENCE : etamake(f,q,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", "SYNOPSIS : ", " ", " etamake(f,q,T) converts the q-series f into an eta-product expansion ", " T ", " that agrees with f to O(q ). ", " ", " ", "EXAMPLES : ", " ", "> tripleprod(q,q^3,10); ", " ", " 57 40 26 15 7 2 5 12 22 35 51 ", " q - q + q - q + q - q + 1 - q + q - q + q - q + q ", "---------------------------------------------------------------------------- ", "> etamake(%%,q,20); ", " ", " eta(tau) ", " -------- ", " 1/24 ", " q ", "---------------------------------------------------------------------------- ", "> sum((-1)^n*q^(n*n),n=-10..10); ", " ", " 100 81 64 49 36 25 16 9 4 ", " 2 q - 2 q + 2 q - 2 q + 2 q - 2 q + 2 q - 2 q + 2 q ", " ", " - 2 q + 1 ", "---------------------------------------------------------------------------- ", "> etamake(%%,q,50); ", " ", " 2 ", " eta(tau) ", " ---------- ", " eta(2 tau) ", "---------------------------------------------------------------------------- ", "SEE ALSO : qetamake ", " ", " "],etamakebeta=[ "FUNCTION : qseries[etamakebeta] - Convert a q-series into an eta-product expansion ", " ", "CALLING SEQUENCE : etamakebeta(f,q,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", "SYNOPSIS : ", " ", " etamakebeta(f,q,T) converts the q-series f into an eta-product expansion ", " T ", " that agrees with f to O(q ). ", " This is a beta version of etamake which handles fractional powers of q. ", " ", " ", "EXAMPLES : ", "> with(qseries): ", "> etamakebeta(); ", "--------------------------------------------------------- ", " etamakebeta() ", " etamakebeta(f,q,T) ", " converts the q-series f into an eta-product expansion ", " that agrees with f to O(q^T). ", " ", "EXAMPLES : ", " T3:=tripleprod(q,q^3,10); ", " etamake(T3,q,20); ", " T2:=add((-1)^n*q^(n*n),n=-10..10); ", " etamake(T2,q,50); ", "-------------------------------------------------------- ", " ", "> c:=add(add(q^( (n+1/3)^2 + (n+1/3)*(m+1/3) + (m+1/3)^2 ),m=-20..20),n=-20..20): ", "> series(c,q,20); ", " (1/3) (4/3) (7/3) (13/3) (16/3) (19/3) (25/3) ", "3 q + 3 q + 6 q + 6 q + 3 q + 6 q + 3 q ", " ", " (28/3) (31/3) (37/3) (43/3) (49/3) (52/3) ", " + 6 q + 6 q + 6 q + 6 q + 9 q + 6 q ", " ", " (61/3) ", " + O(q ) ", " ", "> etamake(c,q,20); ", "Error, (in etamake) invalid argument for sign, lcoeff or tcoeff ", " ", "> etamakebeta(c,q,20); ", " 3 ", " 3 eta(3 tau) ", " ------------- ", " eta(tau) ", "DISCUSSION: ", " ", "SEE ALSO : etamake ", " ", " "],etaq=[ " ", "FUNCTION : qseries[etaq] - Dedekind eta product ", " ", "CALLING SEQUENCE : etaq(q,a,T) ", " ", "PARAMETERS : q - variable ", " a,T - positive integers ", " ", "SYNOPSIS : ", " ", " T ", " etaq(q,a,T) returns the q-series expansion to O(q ) ", " of the eta-product ", " ", " a a ", " (q , q ) ", " oo ", " ", " where q is real or complex variable (with |q|<1) and ", " a is a positive integer. ", " The series is computed using Euler's pentagonal number theorem. ", " ", "EXAMPLES : ", " ", "> etaq(q,2,100); ", " ", " 80 52 30 14 4 2 10 24 44 70 ", " - q + q - q + q - q + 1 - q + q - q + q - q ", "---------------------------------------------------------------------------- ", "> series(%%,q,100); ", " ", " 2 4 10 14 24 30 44 52 70 80 ", " 1 - q - q + q + q - q - q + q + q - q - q ", "---------------------------------------------------------------------------- ", "SEE ALSO : etamake ", " ", " ", " "],findcong=[ "FUNCTION : qseries[findcong] - Find linear congruence ", " ", "VERSION: October 20, 2014: ", "PREVIOUS VERSION: June 17, 2010 ", "HELP UPDATE: April 23, 2020 ", " ", "CALLING SEQUENCE : findcong(QS,T) ", " findcong(QS,T,LM) ", " findcong(QS,T,LM,XSET) ", " ", "PARAMETERS : QS - q-series ", " T,LM - positive integers ", " XSET - set of positive integers ", " ", "GLOBAL VARIABLES : xprint ", " ", "SYNOPSIS : ", " ", " findcong(QS,T) searches for linear congruences. ", " If QS = sum c[n]*q^n (where n<=T) then ", " it returns triples [B,A,R] where ", " c[A*n + B] == 0 mod R (A<=LM and A*n+B<=T) ", " and R is not in XSET. ", " The default LM=trunc(sqrt(T)). ", " Also R is a prime power. ", " ", " The global var xprint is the usual. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", " ", "> P:=series(1/etaq(q,1,1001),q,1001): ", " ", "> findcong(P,1000); ", " [4, 5, 5] ", " ", " [5, 7, 7] ", " ", " [6, 11, 11] ", " ", " [24, 25, 25] ", " ", " {[5, 7, 7], [4, 5, 5], [24, 25, 25], [6, 11, 11]} ", " ", "DISCUSSION: ", " ", "findcong found the Ramanujan partition congruences ", " ", "p(5n+4) == 0 mod 5 ", "p(7n+5) == 0 mod 7 ", "p(11n+6) == 0 mod 11 ", "p(25n+24) == 0 mod 25 ", " ", " ", "SEE ALSO : findlincombomodp ", " "],findcongbeta=[ "FUNCTION : qseries[findcongbeta] - Find linear congruence ", " This is a beta version of findcong ", "VERSION: 09/09/2013 ", "PREVIOUS VERSION: 07/25/2012 ", " ", " ", "CALLING SEQUENCE : findcong(QS,T) ", " findcong(QS,T,LM) ", " findcong(QS,T,LM,XSET) ", " findcongbeta(QS,T,LM,XSET,xxTLIM) ", " ", "PARAMETERS : QS - q-series ", " T,LM - positive integers ", " XSET - set of positive integers ", " xxTLIM - positive integer ", " ", "GLOBAL VARIABLES : xprint ", " ", "SYNOPSIS : ", " findcongbeta(QS,T,LM,XSET,xxTLIM) ", " Find linear congruences for q-series QS up to q^T ", " If QS = sum a(n) q^n then findcong searches for congruences ", " a(M*n + r) == 0 (mod K) ", " and returns possible set of congruences : {[r1,M1,K1], ..... } ", " NOTE1: LM is maximum M (default = [sqrt(T)] ", " NOTE2: XSET set of moduli to exclude ", " NOTE3: xxTLIM max number of coeffs to test gcd (default = 100) ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> P:=series(1/etaq(q,1,1001),q,1001): ", "> findcong(P,1000); ", " [4, 5, 5] ", " [5, 7, 7] ", " [6, 11, 11] ", " [24, 25, 25] ", " {[5, 7, 7], [4, 5, 5], [24, 25, 25], [6, 11, 11]} ", " ", "DISCUSSION: ", " ", "findcong found the Ramanujan partition congruences ", " ", "p(5n+4) == 0 mod 5 ", "p(7n+5) == 0 mod 7 ", "p(11n+6) == 0 mod 11 ", "p(25n+24) == 0 mod 25 ", " ", " ", "SEE ALSO : findlincombomodp, findcong ", " "],findhom=[ "FUNCTION : qseries[findhom] - finds a set of potential homogeneous ", " relations among a list of q-series. ", " ", "CALLING SEQUENCE : findhom(L,q,n,topshift) ", " ", "PARAMETERS : L - list of q-series ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLE : X ", " ", "SYNOPSIS : ", " ", " findhom(L,q,n,topshift) returns a set of potential homogenous relations ", " of order n among the q-series in the list L. ", " The value of topshift is usually taken to be zero. Howeverm if ", " it appears that spurious relations are being generated then a higher ", " value of topshift should be taken. ", " ", " This program converts the list of q-series into a list of polynomials ", " of a certain degree and then converts these into a matrix. The entries ", " in a given row correspond to coefficients of the corrresponding the ", " polynomial. The set of relations is then found by computing ", " the kernel of the transpose of this matrix. ", " ", "NOTE: There is a global variable X that is reassigned each time the ", "function is called. This variable is used to display the relations. ", " ", "EXAMPLES : ", " ", "> findhom([theta3(q,100),theta4(q,100),theta3(q^2,100), ", " theta4(q^2,100)],q,1,0); ", " ", " # of terms , 25 ", " ", " -----RELATIONS----of order---, 1 ", " ", " {{}} ", " ", "> findhom([theta3(q,100),theta4(q,100),theta3(q^2,100), ", " theta4(q^2,100)],q,2,0); ", " ", " # of terms , 31 ", " ", " -----RELATIONS----of order---, 2 ", " ", " 2 2 2 2 ", " {X[1] + X[2] - 2 X[3] , - X[1] X[2] + X[4] } ", " ", "> ", " ", "DISCUSSION : ", " ", "From the session above we see that there is no linear relation between ", "the functions ", " ", "theta3(q), theta4(q), theta3(q^2) and theta4(q^2). ", " ", "However, it appears that there are two quadratic relations. ", " ", " / 2 2\1/2 ", " 2 |theta3(q) + theta4(q) | ", " theta3(q ) = |-----------------------| ", " \ 2 / ", " ", "and ", " 2 1/2 ", " theta4(q ) = (theta3(q) theta4(q)). ", " ", "SEE ALSO : findnonhom ", " ", " "],findhomcombo=[ "FUNCTION : qseries[findhomcombo] - tries to express a q-series as a ", " homogeneous polynomial of degree n of ", " a given list of q-series. ", " ", "CALLING SEQUENCE : findhomcombo(L,q,n,topshift,etaoption) ", " ", "PARAMETERS : L - list of q-series ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " etaoption - yes, no ", " ", "GLOBAL VARIABLE : X ", " ", "SYNOPSIS : ", " ", "findhomcombo(f,L,q,n,topshift,etatoption) returns a set of potential ", "set of linear combinations from L for the given q-series f. ", "The value of topshift is usually taken to be zero. Howeverm if ", "it appears that spurious relations are being generated then a higher ", "value of topshift should be taken. ", " ", "If etaoption=yes then each function in the combination is \"converted\" ", "into an eta-product. ", " ", "NOTE: There is a global variable X that is reassigned each time the ", "function is called. This variable is used to display the combinations. ", "If the list L is linearly dependent more than one linear combination ", "may be returned. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> f := sum((n^2-5*trunc((n^2+2)/5)) ", " *q^n*((q^n)^4+26*(q^n)^3+66*(q^n)^2+26*q^n+1) ", " /(1-q^n)^6,n=1..50): ", "> B1 := etaq(q,1,50)^5/etaq(q,5,50): ", "> B2 := q*etaq(q,5,50)^5/etaq(q,1,50): ", "> findhomcombo(f,[B1,B2],q,3,0,yes); ", " # of terms , 25 ", " ", " -----possible linear combinations of degree------, 3 ", " ", " 15 ", " 3 9 9 3 eta(5 tau) ", " {eta(5 tau) eta(tau) + 40 eta(5 tau) eta(tau) + 335 ------------} ", " 3 ", " eta(tau) ", " ", " 2 2 3 ", " {X[1] X[2] + 40 X[1] X[2] + 335 X[2] } ", " ", " ", "> g := sum((n^2-5*trunc((n^2+2)/5))*q^n/(1-q^n)^2,n=1..50): ", "> findhomcombo(g,[B1,B2],q,1,0,no); ", " ", " # of terms , 23 ", " ", " -----possible linear combinations of degree------, 1 ", " ", " {X[2]} ", "> ", " ", "DISCUSSION : ", " ", "From the session above it appears that ", " 15 ", " 3 9 9 3 eta(5 tau) ", "f = eta(5 tau) eta(tau) + 40 eta(5 tau) eta(tau) + 335 ------------ ", " 3 ", " eta(tau) ", " ", "and ", " 5 ", " eta(5 tau) ", " g = -----------. ", " eta(tau) ", " ", " ", "SEE ALSO : findhom, findnonhom ", " ", " "],findhomcombomodp=[ "FUNCTION : qseries[findhomcombomodp] - tries to express a q-series as a ", " homogeneous polynomial of degree n of ", " a given list of q-series modulo p ", " ", " ", " ", "CALLING SEQUENCE : findhomcombomodp(f,L,p,q,n,topshift,etaoption) ", " ", " ", "PARAMETERS : L - list of q-series ", " p - prime ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " etaoption - yes, no ", " ", "GLOBAL VARIABLE : X ", " ", "SYNOPSIS : ", " ", "findhomcombomodp is a modp version of findhomcombo. ", " ", "findhomcombomodp(f,L,p,q,n,topshift,etaoption) returns a set of potential ", "set of linear combinations mod p from L for the given q-series f. ", "This is modp version of findhomcombo. ", "The value of topshift is usually taken to be zero. Howeverm if ", "it appears that spurious relations are being generated then a higher ", "value of topshift should be taken. ", " ", "If etaoption=yes then each function in the combination is \"converted\" ", "into an eta-product. ", " ", "NOTE: There is a global variable X that is reassigned each time the ", "function is called. This variable is used to display the combinations. ", "If the list L is linearly dependent more than one linear combination ", "may be returned. ", " ", "EXAMPLES : ", "> with(qseries): ", "> SG:=series(add(q^n*aqprod(q,q,n-1)/(1-q^n),n=1..660)/etaq(q,1,700),q,660): ", "> spt:=proc(n) ", "> local x: ", "> if n>=1 and type(n,integer) then ", "> RETURN(coeff(SG,q,n)): ", "> else ", "> RETURN(0): ", "> fi: ", "> end: ", "> X13:=add((spt(13*n-7)-13*spt(n/13))*q^n,n=1..50): ", "> Y13:=X13*etaq(q,13,100): ", "> T13:=series(Y13/2,q,51): ", "> modp(series(T13,q,13),2); ", " 3 4 10 12 13 ", " q + q + q + q + q + O(q ) ", " ", "> EFUNCS:=[seq( etaq(q,1,100)^(2*b)*etaq(q,13,100)^(24-2*b) ", " *q^( (13*(24-2*b)+2*b)/24),b=0..12)]: ", "> findhomcombomodp(T13,EFUNCS,2,q,1,15,yes); ", " # of terms , 49 ", " ", " \"Nullspace computed\" ", " ", " -----possible linear combinations of degree------, 1, ---- mod , 2 ", " ", " 22 2 18 6 16 8 ", "{-eta(13 tau) eta(tau) - eta(13 tau) eta(tau) - eta(13 tau) eta(tau) ", " ", " 12 12 10 14 ", " - eta(13 tau) eta(tau) - eta(13 tau) eta(tau) ", " ", " 6 18 4 20 24 ", " - eta(13 tau) eta(tau) - eta(13 tau) eta(tau) - eta(tau) } ", " ", " {X[2] + X[4] + X[5] + X[7] + X[8] + X[10] + X[11] + X[13]} ", " ", "DISCUSSION : ", " This implies a mod 4 congruence for the spt function. ", " ", "SEE ALSO : findhomcombo ", " ", " "],findhommodp=[ "FUNCTION : qseries[findhommodp] - finds a set of potential homogeneous ", " relations modp among a list of q-series. ", " ", "CALLING SEQUENCE : findhommodp(L,p,q,n,topshift) ", " ", "PARAMETERS : L - list of q-series ", " p - prime ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLE : X ", " ", "SYNOPSIS : ", " ", " findhommodp is a modp version of findhom. ", " ", " findhommodp(L,p,q,n,topshift) returns a set of potential homogenous relations ", " mod p of order n among the q-series in the list L. ", " The value of topshift is usually taken to be zero. Howeverm if ", " it appears that spurious relations are being generated then a higher ", " value of topshift should be taken. ", " ", " This program converts the list of q-series into a list of polynomials ", " of a certain degree and then converts these into a matrix. The entries ", " in a given row correspond to coefficients of the corrresponding the ", " polynomial. The set of relations is then found by computing ", " the kernel mod p of the transpose of this matrix. ", " ", "NOTE: There is a global variable X that is reassigned each time the ", "function is called. This variable is used to display the relations. ", " ", "EXAMPLES : ", " ", "SEE ALSO : findhom, findhomcombomodp ", " ", " "],findlincombo=[ "FUNCTION : qseries[findlincombo] - tries to express a q-series as a ", " linear combination of ", " a given list of q-series. ", " ", "CALLING SEQUENCE : findlincombo(f,L,SL,q,topshift) ", " ", " ", "PARAMETERS : L - list of q-series ", " SL - list of names ", " q - variable ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLES : ct, gooo ", " ", "SYNOPSIS : ", " ", "findlincombo(f,L,SL,q,topshift) returns a set of potential ", "set of linear combinations from L for the given q-series f. ", "The value of topshift is usually taken to be zero. Howeverm if ", "it appears that spurious relations are being generated then a higher ", "value of topshift should be taken. ", " ", "SL is a list of names used in printing the linear combinbations. ", " ", "NOTE: The global var ct is tranpose of matrix of coeffs. ", " The global var gooo is its kernel. These used for debugging ", " purposes. ", " ", "EXAMPLES : ", " ", "> f1:=1+q+q^3; ", "> f2:=1+q-q^3-q^5-q^7; ", "> f3:=12*f1+13*f2; ", "> qseries[findlinhomcombo](f3,[f1,f2],[F1,F2],q,0); ", " nx = , 2 ", " ", " # of terms , 23 ", " ", " 12 F1 + 13 F2 ", " ", "> qseries[findlinhomcombo](f3,[f1,f2+q],[F1,F2],q,0); ", " nx = , 2 ", " ", " # of terms , 23 ", " ", " WARNING: dim ker =, 0 ", " ", " \"NOT A LINEAR COMBO.\" ", " ", " ", " ", "DISCUSSION : ", " ", "We see that f3 is a linear combination of f1 and f2; namely ", "f3 = 12*f1 + 13*f2. We also see that f3 is not a linear ", "combination of f1 and (f2+q). ", " ", "SEE ALSO : findhom, findhomcombo ", " ", " "],findlincombomodp=[ "FUNCTION : qseries[findlincombomodp] - tries to express a q-series as a ", " linear combination mod p of ", " a given list of q-series. ", " ", "CALLING SEQUENCE : findlincombomodp(f,L,SL,p,q,topshift) ", " ", " ", "PARAMETERS : L - list of q-series ", " SL - list of names ", " p - prime ", " q - variable ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLES : ct, gooo ", " ", "SYNOPSIS : ", " ", "findlincombomodp(f,L,SL,p,q,topshift) returns a set of potential ", "set of linear combinations mod p from L for the given q-series f. ", "The value of topshift is usually taken to be zero. However if ", "it appears that spurious relations are being generated then a higher ", "value of topshift should be taken. ", " ", "SL is a list of names used in printing the linear combinbations. ", " ", "NOTE: The global var ct is tranpose of matrix of coeffs. ", " The global var gooo is its Nullspace mod p. These used for debugging ", " purposes. This function is a mod p version of findlincombo ", " ", "EXAMPLES : ", " ", " ", " > E4:=1+240*add(n^3*q^n/(1-q^n),n=1..300): ", " > E6:=1-504*add(n^5*q^n/(1-q^n),n=1..300): ", " > P:=series(1/etaq(q,1,300),q,300): ", " > ETA1:=etaq(q,1,300): ", " > F1:=sift(E4^16*E6*P,q,13,6,299): ", " > BB13:=[seq(ETA1^11*E6*E4^(3*j+1),j=0..5)]: ", " > SBB13:=[seq(_ETA1^11*_E6*_E4^(3*j+1),j=0..5)]: ", " > findlincombomodp(F1,BB13,SBB13,13,q,-8); ", " nx = , 6 ", " ", " # of terms , 19 ", " ", " 11 ", " -6 _ETA1 _E6 _E4 ", " ", " ", " ", "DISCUSSION : ", " ", "We see that F1 is a linear combination of functions in BB13 mod 13. ", " ", "SEE ALSO : findhom, findhomcombo, findhomcombomodp, findlincombo ", " ", " "],findmaxind=[ "FUNCTION : qseries[findmaxind] - Find a maximal linearly independent subset of ", " q-series ", " ", "VERSION: November, 2017 ", "PREVIOUS VERSION: November, 2015 ", " ", "CALLING SEQUENCE : findmaxind() ", " findmaxind(XFL,T) ", " ", "PARAMETERS : XFL - list of q-polynomials ", " T - positive integers ", " ", "SYNOPSIS : ", " Returns [P,NXFL], ", " where P is maximal independent subset of XFL, and ", " and NXFL is a list of indices. ", " NOTE: T is an integer (usually 0). Increase value of T if there is ", " a problem with not computing enough coefficients. ", " ", " ", "EXAMPLES : ", "> with(qseries): ", "> with(ETA): ", "> findmaxind(); ", "------------------------------------------------------------- ", "findmaxind(XFL,T) ", " XFL is list of q-polynomials. ", " T is an integer (ussually 0). Increase value of T if you ", " a problem with not computing enough coefficients. ", " Returns [P,NXFL], ", " where P is maximal independent subset of XFL, and ", " and NXFL is a list of indices. ", "------------------------------------------------------------- ", "> s4:=proc(T) ", "> local a1,a2,a4,a8,GL,FL,gp,epq: ", "> GL:=[]: FL:=[]: ", "> for a1 from -T to T do for a2 from -T to T do for a4 from -T to T do ", "> a8:=4-a1-a2-a4: ", "> gp:=[1,a1,2,a2,4,a4,8,a8]: ", "> if modp(a1+2*a2+4*a4+8*a8,24)=0 and modp(8*a1+4*a2+2*a4+a8,24)=0 then ", "> epq:=etaprodtoqseries(gp2etaprod(gp),1000): ", "> GL:=[op(GL),gp]: FL:=[op(FL),epq]: ", "> fi: ", "> od:od:od: ", "> RETURN([FL,GL]): ", "> end: ", "> X4:=s4(8): ", "> nops(X4[1]); ", " 28 ", " ", "> Y:=findmaxind(X4[1],0): ", "> nops(Y[1]); ", " 17 ", " ", "> Y[2]; ", " [1, 2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 17, 20, 23, 24, 26, 28] ", " ", "> findhomcombo(X4[1][8],Y[1],q,1,0,yes); ", " 16 4 24 ", " eta(8 tau) eta(4 tau) 4 eta(8 tau) ", " {------------------------ - ---------------------------------} ", " 8 8 8 4 8 ", " eta(2 tau) eta(tau) eta(4 tau) eta(2 tau) eta(tau) ", " ", " {X[1] - 4 X[2]} ", " ", "DISCUSSION: ", " We used the proc s4 to generate 28 eta-quotients of weight 2. ", " Using findmaxind we found 17 linearly independent ones. ", " We expressed one as a linear combo of the 17. ", " ", "SEE ALSO : findhom, findhomcombo ", " "],findnonhom=[ "FUNCTION : qseries[findhom] - finds a set of potential non-homogeneous ", " relations among a list of q-series. ", " ", "CALLING SEQUENCE : findnonhom(L,q,n,topshift) ", " ", "PARAMETERS : L - list of q-series ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " ", "GLOBAL VARIABLE : X ", " ", "SYNOPSIS : ", " ", " findnonhom(L,q,n,topshift) returns a set of potential non-homogenous ", " relations of order n among the q-series in the list L. The value of ", " topshift is usually taken to be zero. However if it appears that ", " spurious relations are being generated then a higher value of ", " topshift should be taken. ", " ", " This program is similar to findhom. ", " ", "NOTE: There is a global variable X that is reassigned each time the ", "function is called. This variable is used to display the relations. ", " ", "EXAMPLES : ", " ", " ", "DISCUSSION : ", " ", "From the session above we see that there is no linear relation between ", "the functions ", " ", "theta3(q), theta4(q), theta3(q^2) and theta4(q^2). ", " ", "However, it appears that there are two quadratic relations. ", " ", " / 2 2\1/2 ", " 2 |theta3(q) + theta4(q) | ", " theta3(q ) = |-----------------------| ", " \ 2 / ", " ", "and ", " 2 1/2 ", " theta4(q ) = (theta3(q) theta4(q)). ", " ", "SEE ALSO : findnonhom ", " ", " "],findnonhomcombo=[ "FUNCTION : qseries[findnonhomcombo] - tries to express a q-series as ", " a polynomial of degree n of a ", " given list of q-series. ", " ", "CALLING SEQUENCE : findnonhomcombo(L,q,n,topshift,etaoption) ", " findnonhomcombo(L,q,n,topshift) ", " findnonhomcombo(L,q,n,etaoption) ", " findnonhomcombo(L,q,n) ", " ", "PARAMETERS : L - list of q-series ", " q - variable ", " n - positive integer ", " topshift - integer greater than -20 ", " etaoption - yes, no ", " ", "GLOBAL VARIABLE : X ", " ", "SYNOPSIS : ", " ", "findnonhomcombo(f,L,q,n,topshift,etatoption) returns a set of potential ", "set of polynomials in elements of L for the given q-series f. ", "The value of topshift is usually taken to be zero. However if ", "it appears that spurious relations are being generated then a higher ", "value of topshift should be taken. ", " ", "If etaoption=yes then each monomial in the polynomial is \"converted\" ", "into an eta-product. ", " ", "NOTE: There is a global variable X that is reassigned each time the ", "function is called. This variable is used to display the polynomials. ", "If the list L is linearly dependent more than one linear combination ", "may be returned. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> c:=q*etaq(q,3,100)^9/etaq(q,1,100)^3: ", "> a:=radsimp(theta3(q,100)*theta3(q^3,40)+theta2(q,100)*theta2(q^3,40)): ", "> c:=3*q^(1/3)*etaq(q,3,100)^3/etaq(q,1,100): ", "> x:=radsimp(c^3/a^3): ", "> z:=a: ", "> N:=q-> 1 - 504*sum(n^5*q^n/(1-q^n),n=1..100): ", "> findnonhomcombo(N(q)/z^6,[x],q,2); ", " ", " # of terms , 24 ", " ", " matrix is , 4, x, 24 ", " ", " -----possible linear combinations of degree------, 2 ", " ", " 2 ", " {- 8 X[1] - 20 X[1] + 1} ", " ", "> xi:=q^2*etaq(q,49,100)/etaq(q,1,100): ", "> T:=q*(etaq(q,7,100)/etaq(q,1,100))^4: ", "> findnonhomcombo(T^2,[T,xi],q,7,-15,no); ", " ", " # of terms , 42 ", " ", " matrix is , 37, x, 42 ", " ", " -----possible linear combinations of degree------, 7 ", " ", " 7 6 5 2 3 ", "{343 X[2] + 343 X[2] + 147 X[2] + 35 X[1] X[2] + 49 X[1] X[2] + X[2] ", " ", " 4 3 2 ", " + 49 X[2] + 21 X[2] + 7 X[1] X[2] + 7 X[2] } ", " ", " ", " ", "DISCUSSION : ", " ", "If we define ", " 3 3 ", " a = theta (q) theta (q ) + theta (q) theta (q ) ", " 3 3 2 2 ", " ", " 3 ", " eta(3 tau) ", " c := 3 ----------- ", " eta(tau) ", " ", " 3 ", " c ", " x := ---- ", " 3 ", " a ", " ", " /infinity \ ", " | ----- 5 n| ", " | \ n q | ", "and N := 1 - 504 | ) ------| ", " | / n| ", " | ----- 1 - q | ", " \ n = 1 / ", " ", "then it seems that ", " 6 2 ", " N = z (1 - 20 x - 8 x ). ", " ", "If we define ", " eta(49 tau) ", " xi := ----------- ", " eta(tau) ", " ", " 4 ", " eta(7 tau) ", " T := ----------- ", " 4 ", " eta(tau) ", " ", "then it seems that ", " ", " 2 2 3 7 6 5 4 3 ", " T = (35 xi + 49 xi + 7 xi) T + 343 xi + 343 xi + 147 xi + 49 xi + 21 xi ", " ", " 2 ", " + 7 xi + xi ", " ", " ", "SEE ALSO : findhom, findnonhom, findhomcombo ", " ", " "],findpoly=[ "FUNCTION : qseries[findpoly] - tries to find a polynomial relation between ", " two given q-series with degrees specified. ", " ", "CALLING SEQUENCE : findpoly(x,y,q,deg1,deg2,check) ", " findpoly(x,y,q,deg1,deg2) ", " ", "PARAMETERS : x,y - q-series ", " q - variable ", " deg1,deg2 - positive integers ", " check - positive integer ", " ", "GLOBAL VARIABLES : X, Y ", " ", "SYNOPSIS : ", " ", "findpoly(x,y,q,deg1,deg2,check) returns a possible polynomial in X,Y ", "(with corresponding degrees deg1, deg2) which is satisfied by x,y. ", " check ", "If check is assigned then the relation is checked to O(q ). ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> read findpoly: ", "> x1 := radsimp(theta2(q,100)^2/theta2(q^3,40)^2): ", "> x2 := theta3(q,100)^2/theta3(q^3,40)^2: ", "> x := x1+x2: ", "> c := q*etaq(q,3,100)^9/etaq(q,1,100)^3: ", "> a := radsimp(theta3(q,100)*theta3(q^3,40)+theta2(q,100)*theta2(q^3,40)): ", "> c := 3*q^(1/3)*etaq(q,3,100)^3/etaq(q,1,100): ", "> y := radsimp(c^3/a^3): ", "> m := x2: ", "> findpoly(x,y,q,3,1,60); ", "WARNING: X,Y are global. ", " dims , 8, 18 ", " ", " The polynomial is ", " ", " 3 2 ", " (X + 6) Y - 27 (X + 2) ", " ", " Checking to order, 60 ", " ", " 59 ", " O(q ) ", " ", " 3 2 ", " (X + 6) Y - 27 (X + 2) ", " ", "> findpoly(m,y,q,6,1,50); ", "WARNING: X,Y are global. ", " dims , 14, 24 ", " ", " The polynomial is ", " ", " 2 3 4 ", " - 1/27 (X + 6 X - 3) Y + (X - 1) (X + 1) ", " ", " Checking to order, 50 ", " ", " 51 ", " O(q ) ", " ", " 2 3 4 ", " - 1/27 (X + 6 X - 3) Y + (X - 1) (X + 1) ", " ", " ", "DISCUSSION : ", " ", "If we define ", " 3 3 ", " a = theta (q) theta (q ) + theta (q) theta (q ) ", " 3 3 2 2 ", " ", " 3 ", " eta(3 tau) ", " c := 3 ----------- ", " eta(tau) ", " ", " 3 ", " c ", " y := ---- ", " 3 ", " a ", " ", "then it appears that ", " 3 2 ", " c (x + 2) ", " ---- = 27 -------- ", " 3 3 ", " a (x + 6) ", " ", " 4 ", " (m - 1) (m + 1) ", " = 27 ----------------. ", " 2 3 ", " (m + 6 m - 3) ", " ", "where ", " 2 2 ", " theta2(q) theta3(q) ", " x = ----------- + ----------- ", " 3 2 3 2 ", " theta2(q ) theta3(q ) ", " ", " 2 ", " theta3(q) ", "and m = -----------. ", " 3 2 ", " theta3(q ) ", " ", " ", "SEE ALSO : findhom, findnonhom, findhomcombo, findnonhomcombo ", " ", " "],findprod=[ "FUNCTION : qseries[findprod] - ", " ", " ", "CALLING SEQUENCE : findprod(FL,T,M,Q) ", "qseries[findprod]:=proc(FL,T,M,Q) ## find z-linear combination of the ", " COMBS:=[]: ## functions in FL which is a prob.product ", " nfl:=nops(FL): ## T=max(abs) of coeffs in z-lin.combo ", " S:=[seq(j,j=-T..T)]: ## M=max(abs(multiplicity))) in prod ", " BS:=[seq(S,k=1..nfl)]:## Q is highest power of q ", " ", " ", "PARAMETERS : FL - list of q-series ", " T, M, Q - positive integers ", " ", "GLOBAL VARIABLES : none ", " ", "SYNOPSIS : Searches for Z-linear combinations of the functions in FL ", " that are nice products, where ", " T=max(abs) of coeffs in z-lin.combo ", " M=max(abs(multiplicity))) in prod ", " Q is highest power of q ", " ", " ", "EXAMPLES : ", "> with(qseries): with(combinat): ", "> with(rank): ", "> RDIFF:=(r1,m,r2,t)->add( N(r1,m,t*n+r2)*q^n,n=0..trunc(500/t)-1): ", "> FUNCS:=[seq(RDIFF(j,5,1,5),j=0..2)]: ", "> findprod(FUNCS,1,5,80); ", " [0, 1] ", " [0, 1] ", " [0, 1] ", " [0, 1] ", " [[0, [-1, 0, 1]], [0, [-1, 1, 0]], [0, [1, -1, 0]], [0, [1, 0, -1]]] ", " ", "> jacprodmake(FUNCS[1]-FUNCS[3],q,80); ", " 2 ", " JAC(0, 5, infinity) ", " -------------------- ", " JAC(1, 5, infinity) ", " ", "DISCUSSION : ", " This means that the Z-combinations ", " FUNCS[1]-FUNCS[2] and FUNCS[1]-FUNCS[3] ", " are probable nice products. This is confirmed for the first one ", " at least up to q^80. ", " NOTE: These are rank differences mod 5 and final results are due to ", " Atkin and Swinnerton-Dyer. ", " ", "SEE ALSO : checkprod, jacprodmake ", " ", " "],J2jaclist=[ "FUNCTION : qseries[J2jaclist] - convert jacprod to jac list ", " ", "VERSION: November, 2017 ", "PREVIOUS VERSION: November, 2015 ", " ", "CALLING SEQUENCE : J2jaclist() ", " J2jaclist(Jprod) ", " ", "PARAMETERS : Jprod - quotient of theta-functions encoded ", " in terms of J[b,a], J[b] ", "GLOBAL VAR: Jprod ", " ", "SYNOPSIS : ", " Each term J[b,a]^c or J[b]^c in the quotient is converted to an ", " item [b,a,c] or [b,c] in the list. ", " ", "EXAMPLES : ", "> with(qseries): ", "> z1:=J[25, 5]*J[25]*J[50, 15]/J[25, 10]; ", " J[25, 5] J[25] J[50, 15] ", " z1 := ------------------------ ", " J[25, 10] ", " ", "> J2jaclist(z1); ", " [[25, 5, 1], [25, 1], [50, 15, 1], [25, 10, -1]] ", " ", "> x1:=J[25,1]; ", " x1 := J[25, 1] ", " ", "> J2jaclist(x1); ", " [[25, 1, 1]] ", " ", "> x2:=J[25]^2; ", " 2 ", " x2 := J[25] ", " ", "> J2jaclist(x2); ", " [[25, 2]] ", " ", "DISCUSSION: ", " ", "SEE ALSO : jaclist2JACPROD, Jterm2JACPROD ", " "],jac2J=[ "FUNCTION : qseries[jac2J] - a variant of jac2J ", " ", "CALLING SEQUENCE : jac2J() ", " jac2J(JEXP) ", " ", "PARAMETERS : Jprod - quotient of JAC-functions ", " ", "SYNOPSIS : ", " Converts JAC notation to J[b,a] and J[b] ", " ", "EXAMPLES : ", "> with(qseries): ", "> E1:=etaq(q,1,5000): ", "> J0:=jacprodmake(subs(q=q^5,sift(E1,q,5,0,5000)),q,500); ", " JAC(10, 25, infinity) JAC(0, 25, infinity) ", " J0 := ------------------------------------------ ", " JAC(5, 25, infinity) ", " ", "> symJ0:=jac2J(J0); ", " J[25, 10] J[25] ", " symJ0 := --------------- ", " J[25, 5] ", " ", "DISCUSSION: ", " ", "SEE ALSO : jacprodmake ", " "],jac2prod=[ " ", "FUNCTION : jac2prod - converts a product of theta functions into ", " q-product form. ", " ", "CALLING SEQUENCE : jac2prod(jacexpr) ", " ", "PARAMETERS : jacexpr - product of JAC(i,j, infinity) ", " where i,j are integers ", " and 0 < i < j. ", " = ", "SYNOPSIS : ", " ", "jac2prod(jacexpr) returns a q-product;ie a product of the ", " a b ", "of functions of the form (q , q ) . ", " oo ", " ", "EXAMPLES : ", " ", "> x:=tripleprod(q,q^5,10); ", " ", " 99 70 46 27 13 4 7 18 34 55 81 ", " x := q - q + q - q + q - q + 1 - q + q - q + q - q + q ", " ", "> jacprodmake(x,q,50); ", " ", " JAC(1, 5, oo) ", "> jac2prod(\"); ", " ", " 5 4 5 5 5 ", " (q, q ) (q , q ) (q , q ) ", " oo oo oo ", " ", "> XX:=series( (1- theta4(q,60)^2/theta4(q^5,12)^2)/4/q,q,60); ", " ", " 3 4 5 6 7 8 9 10 11 12 ", "XX := 1 - q - q + q + 4 q - 4 q - q - 3 q + 3 q + 12 q - 12 q - 2 q ", " ", " 13 14 15 16 17 18 19 20 ", " - 8 q + 8 q + 31 q - 30 q - 5 q - 20 q + 19 q + 72 q ", " ", " 21 22 23 24 25 26 27 28 ", " - 68 q - 12 q - 44 q + 41 q + 154 q - 144 q - 24 q - 90 q ", " ", " 29 30 31 32 33 34 35 ", " + 84 q + 312 q - 289 q - 48 q - 178 q + 164 q + 603 q ", " ", " 36 37 38 39 40 41 42 ", " - 554 q - 92 q - 336 q + 307 q + 1122 q - 1024 q - 168 q ", " ", " 43 44 45 46 47 48 49 ", " - 612 q + 557 q + 2024 q - 1836 q - 300 q - 1087 q + 983 q ", " ", " 50 51 52 53 54 55 56 ", " + 3552 q - 3206 q - 522 q - 1880 q + 1692 q + 6088 q - 5472 q ", " ", " 57 58 59 ", " - 886 q - 3180 q + O(q ) ", " ", "> jacprodmake(XX,q,50); ", " ", " JAC(1, 10,oo) JAC(3, 10, oo) ", " ---------------------------- ", " 2 ", " JAC(5, 10, oo) ", " ", "> jac2prod(\"); ", " ", " 10 9 10 3 10 7 10 ", " (q, q ) (q , q ) (q , q ) (q , q ) ", " oo oo oo oo ", " ------------------------------------------------------ ", " 5 10 4 ", " (q , q ) ", " oo ", " ", "> JAC(0,10, infinity); ", " ", " JAC(0, 10, oo) ", " ", "> jac2prod(\"); ", " ", " 10 10 ", " (q , q ) ", " oo ", " ", "SEE ALSO : jac2series, prodmake, etamake ", " "],jac2series=[ " ", "FUNCTION : jac2series - converts a product of theta functions into ", " a product of q-series. ", " ", "CALLING SEQUENCE : jac2series(jacexpr,T) ", " ", "PARAMETERS : jacexpr - product of JAC(i,j, infinity) ", " where i,j are integers ", " and 0 < i < j. ", " = ", "SYNOPSIS : ", " ", "jac2series(jacexp,T) returns a q-series product which agrees with ", " T ", "the function corresponding to jacexp to O(q ). ", " ", "EXAMPLES : ", " ", "> with(qseries): ", " ", "> x:=tripleprod(q,q^5,10); ", " ", " 99 70 46 27 13 4 7 18 34 55 81 ", " x := q - q + q - q + q - q + 1 - q + q - q + q - q + q ", " ", "> y:=jacprodmake(x,q,50); ", " ", " y := JAC(1, 5, oo) ", " ", "> jac2series(y,50); ", " ", " 4 7 13 18 27 34 46 ", " 1 - q - q + q + q - q - q + q + q ", " ", "> XX:=series( (1- theta4(q,60)^2/theta4(q^5,12)^2)/4/q,q,60); ", " ", " 3 4 5 6 7 8 9 10 11 ", "XX := 1 - q - q + q + 4 q - 4 q - q - 3 q + 3 q + 12 q - 12 q ", " ", " 12 13 14 15 16 17 18 19 ", " - 2 q - 8 q + 8 q + 31 q - 30 q - 5 q - 20 q + 19 q ", " ", " 20 21 22 23 24 25 26 27 ", " + 72 q - 68 q - 12 q - 44 q + 41 q + 154 q - 144 q - 24 q ", " ", " 28 29 30 31 32 33 34 ", " - 90 q + 84 q + 312 q - 289 q - 48 q - 178 q + 164 q ", " ", " 35 36 37 38 39 40 41 ", " + 603 q - 554 q - 92 q - 336 q + 307 q + 1122 q - 1024 q ", " ", " 42 43 44 45 46 47 48 ", " - 168 q - 612 q + 557 q + 2024 q - 1836 q - 300 q - 1087 q ", " ", " 49 50 51 52 53 54 55 ", " + 983 q + 3552 q - 3206 q - 522 q - 1880 q + 1692 q + 6088 q ", " ", " 56 57 58 59 ", " - 5472 q - 886 q - 3180 q + O(q ) ", " ", "> YY:=jacprodmake(XX,q,50); ", " ", " JAC(1, 10, oo) JAC(3, 10, oo) ", " YY := ---------------------------------- ", " 2 ", " JAC(5, 10, oo) ", " ", "> JJ:=jac2series(YY,60); ", " ", " 96 57 28 9 12 33 64 ", " JJ := (q - q + q - q + 1 - q + q - q + q ) ", " ", " 88 51 24 7 3 16 39 72 ", " (q - q + q - q + 1 - q + q - q + q ) ", " ", " / 80 45 20 5 2 ", " / (2 q - 2 q + 2 q - 2 q + 1) ", " / ", " ", "> series(JJ-XX,q,60); ", " ", " 59 ", " O(q ) ", " ", "> Z:=JAC(0,10, infinity); ", " ", " Z := JAC(0, 10, oo) ", " ", "> jac2series(Z,50); ", " ", " 20 10 50 ", " - q + 1 - q + q ", " ", "SEE ALSO : jac2prod, jacprodmake ", " "],jaclist2JACPROD=[ "FUNCTION : qseries[jaclist2JACPROD] - convert jaclist to JAC-notation ", " ", "CALLING SEQUENCE : jaclist2JACPROD(); ", " jaclist2JACPROD(jaclist) ", " ", "PARAMETERS : jaclist - list of terms [b,a,c] or [b,c] ", " ", "SYNOPSIS : ", " Converts jaclist to JAC notation ", " ", "EXAMPLES : ", "> with(qseries): ", "> E1:=etaq(q,1,5000): ", "> J0:=jacprodmake(subs(q=q^5,sift(E1,q,5,0,5000)),q,500); ", " JAC(10, 25, infinity) JAC(0, 25, infinity) ", " J0 := ------------------------------------------ ", " JAC(5, 25, infinity) ", " ", "> symJ0:=jac2J(J0); ", " J[25, 10] J[25] ", " symJ0 := --------------- ", " J[25, 5] ", " ", "> JL:=J2jaclist(symJ0); ", " JL := [[25, 5, -1], [25, 10, 1], [25, 1]] ", " ", "> jaclist2JACPROD(JL); ", " JAC(10, 25, infinity) JAC(0, 25, infinity) ", " ------------------------------------------ ", " JAC(5, 25, infinity) ", "DISCUSSION: ", " ", "SEE ALSO : jacprodmake, jac2J, J2jaclist ", " "],jaclist2J=[ "FUNCTION : qseries[jaclist2J] - convert jaclist to J-notation ", " ", "CALLING SEQUENCE : jaclist2J(); ", " jaclist2J(jaclist) ", " ", "PARAMETERS : jaclist - list of terms [b,a,c] or [b,c] ", " ", "SYNOPSIS : ", " Converts jaclist back to J notation ", " ", "EXAMPLES : ", "> with(qseries): ", "> E1:=etaq(q,1,5000): ", "> J0:=jacprodmake(subs(q=q^5,sift(E1,q,5,0,5000)),q,500); ", " JAC(10, 25, infinity) JAC(0, 25, infinity) ", " J0 := ------------------------------------------ ", " JAC(5, 25, infinity) ", " ", "> symJ0:=jac2J(J0); ", " J[25, 10] J[25] ", " symJ0 := --------------- ", " J[25, 5] ", " ", "> JL:=J2jaclist(symJ0); ", " JL := [[25, 5, -1], [25, 10, 1], [25, 1]] ", " ", "> jaclist2J(JL); ", " J[25, 10] J[25] ", " --------------- ", " J[25, 5] ", " ", "DISCUSSION: ", " ", "SEE ALSO : jacprodmake, jac2J, J2jaclist, jaclist2JACPROD ", " "],jacprod=[ "FUNCTION : qseries[jacprod] - Jacobi-type infinite product ", " ", "CALLING SEQUENCE : jacprod(a,b,q,T) ", " ", "PARAMETERS : a,b positive integers ", " q variable ", " T - positive integer ", " ", "SYNOPSIS : ", " T ", " jacprod(a,b,q,T) returns the q-series expansion to order O(q ) of ", " Jacobi-type infinite product ", " ", " a b b-a b ", " (q , q ) (q , q ) ", " oo oo ", " ", " where a and b are positive integers and ", " q is a variable with |q|<1. ", " The expansion is found using qseries[tripleprod]. ", " ", "EXAMPLES : ", " ", "------------------------------------------------------------------------- ", "> y:=series(1/jacprod(1,5,q,10),q,40); ", " ", " 2 3 4 5 6 7 8 9 10 11 ", " y := 1 + q + q + q + 2 q + 2 q + 3 q + 3 q + 4 q + 5 q + 6 q + 7 q ", " ", " 12 13 14 15 16 17 18 19 ", " + 9 q + 10 q + 12 q + 14 q + 17 q + 19 q + 23 q + 26 q ", " ", " 20 21 22 23 24 25 26 27 ", " + 31 q + 35 q + 41 q + 46 q + 54 q + 61 q + 70 q + 79 q ", " ", " 28 29 30 31 32 33 34 ", " + 91 q + 102 q + 117 q + 131 q + 149 q + 167 q + 189 q ", " ", " 35 36 37 38 39 40 ", " + 211 q + 239 q + 266 q + 299 q + 333 q + O(q ) ", "---------------------------------------------------------------------------- ", "> x:=0: ", "---------------------------------------------------------------------------- ", "> for i from 1 to 10 do x:=x+q^(i*i)/aqprod(q,q,i):od: ", "---------------------------------------------------------------------------- ", "> series(x-y,q,50); ", " ", " 40 ", " - 1 + O(q ) ", "---------------------------------------------------------------------------- ", "SEE ALSO : ", " ", " ", " "],jacprodmake=[ "FUNCTION : qseries[jacprodmake] - Convert a q-series into a product of ", " theta functions if possible ", "VERSION: May 4, 2010 ", " ", "CALLING SEQUENCE : jacprodmake(f,q,T) ", " jacprodmake(f,q,T,P) ", " ", "PARAMETERS : f - q-series ", " T,P - positive integers ", " ", "GLOBAL VARIABLES : xprint,ft0,fixjacp: ", " ", "SYNOPSIS : ", " ", " jacprodmake(f,q,T) converts the q-series f into a product of theta ", " T ", " functions that agrees with f to O(q ). ", " ", " Each theta-function has the form JAC(a,b), where a,b are integers ", " and 0 < a < b. ", " = ", " ", " If 0 < a, then JAC(a,b) corresponds to the theta-product ", " ", " a b b-a b b b ", " (q , q ) (q , q ) (q , q ) ", " oo oo oo ", " ", "If a = 0, then JAC(0,b) corresponds to the eta-product ", " ", " ", " b b ", " (q , q ) ", " oo ", " ", " jacprodmake(f,q,T,P) is a version that searches for theta-products ", " where b is a divisor of P. If xprint=true then extra information is ", " printed as the program runs. An ERROR is returned if f is NOT a jac-prod. ", " In this case the global var fixjacp saves the value of args. ", " ", " In this new version jacprodmake should still work even if the ", " coefficient of q^0 is not 1. ", " ", " ", "EXAMPLES : ", " ", "> with(qseries); ", " ", "> x:=tripleprod(q,q^5,10); ", " ", " 99 70 46 27 13 4 7 18 34 55 81 ", " x := q - q + q - q + q - q + 1 - q + q - q + q - q + q ", " ", "> jacprodmake(x,q,50); ", " ", " JAC(1, 5) ", " ", "> XX:=series( (1- theta4(q,60)^2/theta4(q^5,12)^2)/4/q,q,60); ", " ", " 3 4 5 6 7 8 9 10 11 12 ", "XX := 1 - q - q + q + 4 q - 4 q - q - 3 q + 3 q + 12 q - 12 q - 2 q ", " ", " 13 14 15 16 17 18 19 20 ", " - 8 q + 8 q + 31 q - 30 q - 5 q - 20 q + 19 q + 72 q ", " ", " 21 22 23 24 25 26 27 28 ", " - 68 q - 12 q - 44 q + 41 q + 154 q - 144 q - 24 q - 90 q ", " ", " 29 30 31 32 33 34 35 ", " + 84 q + 312 q - 289 q - 48 q - 178 q + 164 q + 603 q ", " ", " 36 37 38 39 40 41 42 ", " - 554 q - 92 q - 336 q + 307 q + 1122 q - 1024 q - 168 q ", " ", " 43 44 45 46 47 48 49 ", " - 612 q + 557 q + 2024 q - 1836 q - 300 q - 1087 q + 983 q ", " ", " 50 51 52 53 54 55 56 ", " + 3552 q - 3206 q - 522 q - 1880 q + 1692 q + 6088 q - 5472 q ", " ", " 57 58 59 ", " - 886 q - 3180 q + O(q ) ", " ", "> jacprodmake(XX,q,50); ", " ", " JAC(1, 10) JAC(3, 10) ", " --------------------- ", " 2 ", " JAC(5, 10) ", " ", "> V:=add(q^n/aqprod(q,q,2*n+1),n=0..100): ", "> jacprodmake(V,q,50); ", " 8 / 2 ", "JAC(0, 16, infinity) / (JAC(1, 16, infinity) JAC(3, 16, infinity) JAC(4, 16, infinity) ", " / ", " ", " 2 ", " JAC(5, 16, infinity) JAC(6, 16, infinity) JAC(7, 16, infinity) ) ", " ", "> xprint:=true: ", "> jacprodmake(V,q,50); ", "\"jacmake started with args\", _A, 49 ", " 8 / 2 ", "JAC(0, 16, infinity) / (JAC(1, 16, infinity) JAC(3, 16, infinity) JAC(4, 16, infinity) ", " / ", " ", " 2 ", " JAC(5, 16, infinity) JAC(6, 16, infinity) JAC(7, 16, infinity) ) ", " ", "> jacprodmake(V,q,50,16); ", "\"_A done\" ", "\"jacmake started with args\", _A, 49, 16 ", "\"TRYING period pp=\", 2 ", "\"TRYING period pp=\", 4 ", "\"TRYING period pp=\", 8 ", "\"TRYING period pp=\", 16 ", " 8 / 2 ", "JAC(0, 16, infinity) / (JAC(1, 16, infinity) JAC(3, 16, infinity) JAC(4, 16, infinity) ", " / ", " ", " 2 ", " JAC(5, 16, infinity) JAC(6, 16, infinity) JAC(7, 16, infinity) ) ", " ", "> jacprodmake(V,q,50,8); ", "\"_A done\" ", "\"jacmake started with args\", _A, 49, 8 ", "\"TRYING period pp=\", 2 ", "\"TRYING period pp=\", 4 ", "\"TRYING period pp=\", 8 ", " ERROR: PP should be multiple of pp ", " ", "Error, (in jacprodmake) jacprodmake failed (see gobal var fixjacp) ", " ", "> Y:=add(q^(n*(n+1)/2),n=-20..20); ", " 45 36 28 21 15 10 6 3 55 190 ", "Y := 2 + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q ", " ", " 171 153 136 120 105 91 78 66 210 ", " + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + q ", " ", "> jacprodmake(Y,q,100); ", " 2 JAC(0, 2, infinity) ", " ------------------------ ", " /JAC(1, 2, infinity)\1/2 ", " |-------------------| ", " \JAC(0, 2, infinity)/ ", " ", " ", "> V:=add( (q)^(n)/aqprod(q,q,max(min(2*n+1,400-n),0)),n=0..400): ", "> V:=series(V,q,350): ", " ", "> jacprodmake(V2*aqprod(q,q^2,150),q,300); ", "\"jacmake started with args\", _A, 299 ", " 4 ", " JAC(0, 16, infinity) ", " ----------------------------------------------------------------------------------- ", " JAC(1, 16, infinity) JAC(4, 16, infinity) JAC(6, 16, infinity) JAC(7, 16, infinity) ", " ", " ", "SEE ALSO : jac2prod ", " "],Jetamake=[ "FUNCTION : qseries[Jetamake] - convert q-series to a product of eta-functions ", " using J[m] notation ", " ", "CALLING SEQUENCE : Jetamake(f,q,T) ", " ", " ", "PARAMETERS : f - q-series ", " T - positive integer ", " ", "SYNOPSIS : ", " Jetamake is a variant of etamake and qetamake. ", " Jetamake returns a product of the functions of the form J[m] ", " where J[m] = (q^m;q^m)oo = (1-q^m)*(1-q^(2m))*(1-q^(3m))... ", " In other words, J[m] = eta(m*tau)/q^(m/24). ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> E52:=etaq(q,5,100); ", " 75 60 35 25 10 5 ", " E52 := -q - q + q + q - q - q + 1 ", " ", "> Jetamake(E52,q,50); ", " J[5] ", " ", "DISCUSSION : ", " ", "SEE ALSO : etamake, qetamake ", " ", " "],Jterm2JACPROD=[ "FUNCTION : qseries[Jterm2JACPROD] - a variant of Jterm2JACPROD ", " ", "CALLING SEQUENCE : Jterm2JACPROD() ", " Jterm2JACPROD(jterm) ", " Jterm2JACPROD(jterm,dilfactor) ", " ", "PARAMETERS : jterm - quotient of theta-functions in J-notation ", " ", "SYNOPSIS : ", " Converts jterm to JACPROD and also does q -> q^dilfactor ", " where dilfactor=1 is the default. ", " ", "EXAMPLES : ", " ", "> z5:=RootOf(numtheory[cyclotomic](5,x)=0); ", "> with(qseries): ", "> L1:=simplify(series(tripleprod(z5,q,200)/(1-z5),q,201)): ", "> subs(q=q^5,sift(L1,q,5,0,200)); ", "> jacprodmake(%%,q,190); ", " JAC(10, 25, infinity) ", " ", "> R1:=jac2J(%%); ", " R1 := J[25, 10] ", " ", "> subs(q=q^5,normal(subs(z5=zeta,sift(L1,q,5,1,200))/(zeta^2+zeta^3))); ", " 170 135 90 65 35 20 5 ", " q - q - q + q + q - q - q + 1 ", " ", "> jacprodmake(%%,q,190); ", " JAC(5, 25, infinity) ", " ", "> R2:=jac2J(%%); ", " R2 := J[25, 5] ", " ", "> symR:= R1 + (zeta^2 + zeta^3)*q*R2; ", " 3 2 ", " symR := J[25, 10] + (zeta + zeta ) q J[25, 5] ", " ", "> Rq0:=Jterm2JACPROD(op(1,symR))+Jterm2JACPROD(op(2,symR)); ", " 2 ", " Rq0 := JAC(10, 25, infinity) + zeta (zeta + 1) q JAC(5, 25, infinity) ", " ", "> simplify(series( L1 - subs(zeta=z5,jac2series(Rq0,200)),q,200)); ", " 210 ", " O(q ) ", " ", "DISCUSSION: ", " We calculated the 5-dissection of (q;q)oo in J- and JACPROD notation ", " and checked up to q^200. ", " ", "SEE ALSO : jacprodmake, jac2J ", " "],lqdegree=[ "FUNCTION : qseries[lqdegree] - lowest q-degree in sum of q-monomials ", " ", "CALLING SEQUENCE : lqdegree() ", " lqdegree(qexp) ", " ", "PARAMETERS : qexp - sum of q-mononials ", " ", "SYNOPSIS : ", " Returns the lowest degree in q (includes negative and fractiona degrees) ", " ", "EXAMPLES : ", "> with(qseries): ", "> Y:=1/2*JAC(1,2,infinity) + q*JAC(3,4,infinity) + JAC(1,5,infinity)/q^(11/2); ", " JAC(1, 5, infinity) ", " Y := 1/2 JAC(1, 2, infinity) + q JAC(3, 4, infinity) + ------------------- ", " 11/2 ", " q ", "> lqdegree(Y); ", " -11/2 ", " ", "DISCUSSION: ", " ", "SEE ALSO : lqdegree0 ", " "],lqdegree0=[ "FUNCTION : qseries[lqdegree0] - lowest q-degree in q-monomial ", " ", "CALLING SEQUENCE : lqdegree0() ", " lqdegree0(qexp) ", " ", "PARAMETERS : qexp - a q-mononial ", " ", "SYNOPSIS : ", " Returns the lowest degree in q (includes negative and fractional degrees) ", " ", "EXAMPLES : ", "> with(qseries): ", "> B:=sqrt(q)*JAC(0,1,infinity); ", " 1/2 ", " B := q JAC(0, 1, infinity) ", " ", "> lqdegree0(B); ", " 1/2 ", " ", "> B1:=(q)*JAC(0,1,infinity); ", " B1 := q JAC(0, 1, infinity) ", " ", "> lqdegree0(B1); ", " 1 ", " ", "> B2:=JAC(0,1,infinity); ", " B2 := JAC(0, 1, infinity) ", " ", "> lqdegree0(B2); ", " 0 ", " ", "> B3:=JAC(0,1,infinity)/q^3; ", " JAC(0, 1, infinity) ", " B3 := ------------------- ", " 3 ", " q ", " ", "> lqdegree0(B3); ", " -3 ", " ", "> B4:=JAC(0,1,infinity)/q^(1/3); ", " JAC(0, 1, infinity) ", " B4 := ------------------- ", " 1/3 ", " q ", " ", "> lqdegree0(B4); ", " -1/3 ", " ", "DISCUSSION: ", " ", "SEE ALSO : lqdegree ", " "],mprodmake=[ "FUNCTION : qseries[mprodmake] - Convert a q-series into an infinite product ", " of the form (1+q^n1)*(1+q^n2)*... ", " ", "CALLING SEQUENCE : mprodmake(f,q,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", "SYNOPSIS : ", " ", " mprodmake(f,q,T) converts the q-series f into an infinite product ", " of the form (1+q^n1)*(1+q^n2)*... ", " T ", " that agrees with f to O(q ). ", " ", " ", "EXAMPLES : ", " ", "> with(qseries); ", "> EP:=etaq(q,2,100)^2/etaq(q,4,100)/etaq(q,1,100): ", "> mprodmake(EP,q,17); ", " 3 5 7 9 11 13 15 17 ", " (1 + q) (1 + q ) (1 + q ) (1 + q ) (1 + q ) (1 + q ) (1 + q ) (1 + q ) (1 + q ) ", " ", "SEE ALSO: prodmake ", " "],oldsift=[ "FUNCTION : qseries[oldsift] - Pick out the terms of a q-series in which the exponent ", " belongs to a fixed residue class mod p ", " ", "CALLING SEQUENCE : oldsift(s,q,n,k,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", "SYNOPSIS : ", " ", " Suppose s is the q-series ", " ", " s = sum a[i] q^i O(q^T) ", " ", " then sift(s,q,n,k,T) returns the q-series ", " ", " sum a[n*i+k] q^i ", " T ", "NOTE: (1) This is the old version of sift. ", " (2) The new version of sift can handle negative exponents but oldsift ", " can not. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> s:=series(etaq(q,1,500)^3,q,500); ", " 3 6 10 15 21 28 36 45 ", "s := 1 - 3 q + 5 q - 7 q + 9 q - 11 q + 13 q - 15 q + 17 q - 19 q ", " ", " 55 66 78 91 105 120 136 ", " + 21 q - 23 q + 25 q - 27 q + 29 q - 31 q + 33 q - 35 ", " ", " 153 171 190 210 231 253 276 300 ", " q + 37 q - 39 q + 41 q - 43 q + 45 q - 47 q + 49 q ", " ", " 325 351 378 406 435 465 496 ", " - 51 q + 53 q - 55 q + 57 q - 59 q + 61 q - 63 q + ", " ", " 500 ", " O(q ) ", " ", "> s76:=oldsift(s,q,7,6,500); ", " 70 42 21 7 ", " s76 := -63 q + 49 q - 35 q + 21 q - 7 ", " ", "> series(s76+7*etaq(q,7,70)^3,q,71); ", " 77 ", " O(q ) ", "SEE ALSO : sift ", " ", " "],qspackageversion=[ "FUNCTION : qseries[packageversion] - package version ", " ", " ", "CALLING SEQUENCE : packageversion() ", " ", " ", "PARAMETERS : none ", " ", "SYNOPSIS : ", " ", " Prints version and date of qseries package ", " ", "EXAMPLE : ", " ", "> with(qseries): ", "> packageversion(); ", "**************************************************** ", "* ", "* qseries package version 1.2f ", "* Mon Oct 20 14:42:12 EDT 2014 ", "* This version tested on Maple 7 and Maple 13 ", "* ", "* Please report any problems to fgarvan@ufl.edu ", "* See ", "* http://qseries.org/fgarvan/qmaple/qmaple.html ", "* for documentation and help. ", "* ", "* Previous versions: ", " 1.2f- Oct 2014 (MAPLE 7 and 13) ", " 1.2e- Sep 2014 (MAPLE 7 and 13) ", " 1.2d- Aug 2014 (MAPLE 13) ", " 1.2c- Jul 2013 (MAPLE 16) ", " 1.2b- May 2013 (MAPLE 16) ", " 1.2 - Dec 2012 (MAPLE 16) ", " 1.1 - Ju1 2012 (MAPLE 13) ", " 1.0 - Jun 2009 (MAPLE 10) ", " 0.9 - Apr 2008 (MAPLE 10) ", " 0.8 - May 2005 (MAPLE 9) ", " 0.7 - Mar 2004 ", " 0.6 - Nov 2002 ", " 0.5 - May 2000 ", " 0.4 - Jan 2000 ", " 0.3 - Nov 1999 ", " 0.2 - Dec 1998 ", " 0.1 - Dec 1997 ", "**************************************************** ", "> quit ", "memory used=1.7MB, alloc=1.8MB, time=0.03 ", " ", " ", " "],qsfunctions=[ "FUNCTION : qseries[qsfunctions] - list functions in the qseries package ", " ", "CALLING SEQUENCE : qsfunctions() ", " ", "PARAMETERS : none ", " ", "SYNOPSIS : ", " List functions in the qseries package ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> qsfunctions(); ", "[J2jaclist, Jetamake, Jterm2JACPROD, aqprod, checkmult, checkprod, ", " dilatejaclist, etamake, etamakebeta, etaq, findcong, findcongbeta, findhom, ", " findhomcombo, findhomcombomodp, findhommodp, findlincombo, findlincombomodp, ", " findmaxind, findnonhom, findnonhomcombo, findpoly, findprod, jac2J, ", " jac2prod, jac2series, jaclist2JACPROD, jacprod, jacprodmake, lqdegree, ", " lqdegree0, mprodmake, oldsift, prodmake, qbin, qdegree, qetamake, qfactor, ", " qs2jaccombo, qschanges, qsfunctions, qshelp, qspackageversion, quinprod, ", " sift, theta, theta2, theta3, theta4, tripleprod, winquist, zqfactor] ", " ", "DISCUSSION: ", " ", "SEE ALSO : qshelp ", " "],qshelp=[ "FUNCTION : qseries[qshelp] - help for a qseries function ", " ", "CALLING SEQUENCE : qshelp(funcname) ", " ", "PARAMETERS : funcname - name of qseries function ", " ", "SYNOPSIS : ", " Help for a function in the qseries package ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> qshelp(aqprod); ", " n-1 ", "FUNCTION : qseries[aqprod] - the product (1-a)(1-aq)..(1-aq ) ", " ", "CALLING SEQUENCE : aqprod(a,q,n); ", " ", "PARAMETERS : a,q - names ", " n - positive integer ", " ", "SYNOPSIS : ", " ", " aqprod(a,q,n) returns the product ", " ", " n-1 ", " (a) = (a;q) = (1-a)(1-aq)..(1-aq ), ", " n n ", " where n is a given positive integer. Here a and q are names, variables, ", " or constants. If n=0 then 1 is returned. ", " ", "EXAMPLES : ", " ", "> aqprod(q,q,6); ", " ", " 2 3 4 5 6 ", " (1 - q) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) ", " ", "> aqprod(z,q,3); ", " ", " 2 ", " (1 - z) (1 - z q) (1 - z q ) ", "SEE ALSO : ", " ", "DISCUSSION: ", " ", "SEE ALSO : qsfunctions ", " "],prodmake=[ "FUNCTION : qseries[prodmake] - Convert a q-series into an infinite product ", " ", "CALLING SEQUENCE : prodmake(f,q,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", "SYNOPSIS : ", " ", " prodmake(f,q,T) converts the q-series f into an infinite product ", " T ", " that agrees with f to O(q ). ", " ", " ", "EXAMPLES : ", " ", "> with(qseries); ", " ", "----------------------------------------------------------------------------- ", "> tripleprod(q,q^5,30); ", " ", " 216 172 133 99 70 46 27 13 4 7 18 34 ", "- q + q - q + q - q + q - q + q - q + 1 - q + q - q + q ", " ", " 55 81 112 148 189 ", " - q + q - q + q - q ", "----------------------------------------------------------------------------- ", "> prodmake(\",q,50); ", " ", " 4 5 6 9 10 11 14 ", " (1 - q) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) ", " ", " 15 16 19 20 21 24 25 ", " (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) ", " ", " 26 29 30 31 34 35 36 ", " (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) ", " ", " 39 40 41 44 45 46 49 ", " (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) (1 - q ) ", "----------------------------------------------------------------------------- ", " ", "SEE ALSO : ", " ", " "],qbin=[ "FUNCTION : qseries[qbin] - the q-binomial coefficient ", " (aka the Gaussian polynomial) ", " ", "CALLING SEQUENCE : qbin(q,m,n); ", " ", "PARAMETERS : q - variable ", " m,n - positive integers ", " ", "SYNOPSIS : ", " ", " When 0 < m < n then qbin(q,m,n) returns the Gaussian polynomial ", " = = ", " (q) ", " [ n ] n ", " [ ] = ----------- ", " [ m ] (q) (q) ", " q m n-m ", " ", " ", "otherwise it returns 0. ", " ", "EXAMPLES : ", " ", "> qbin(q,3,6); ", " ", " 2 4 3 2 3 2 ", " (q - q + 1) (q + q + q + q + 1) (q + q + q + 1) ", "> expand(\"); ", " ", " 9 8 7 6 5 4 3 2 ", " q + q + 2 q + 3 q + 3 q + 3 q + 3 q + 2 q + q + 1 ", " ", "SEE ALSO : aqprod ", " ", " "],qdegree=[ "FUNCTION : qseries[qdegree] - Degree in q ", " ", "VERSION: February 15, 2011 ", " ", "CALLING SEQUENCE : qdegree(QS) ", " ", "PARAMETERS : QS - q-series ", " ", " ", "SYNOPSIS : ", " ", " Returns degree in q. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", " ", "> P:=series(etaq(q,1,50)/q^5,q,20); ", " ", " -5 -4 -3 2 7 10 17 ", " P := q - q - q + 1 + q - q - q + O(q ) ", " ", "> qdegree(%%); ", " 10 ", " ", "> ", " ", " "],qetamake=[ "FUNCTION : qseries[qetamake] - convert q-series to a product of eta-functions ", " (variant of etamake) ", " ", "CALLING SEQUENCE : qetamake(f,q,T) ", " ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", "SYNOPSIS : ", " qetamake is a variant of etamake. ", " etamake(f,q,T) converts the q-series f into an eta-product expansion ", " T ", " that agrees with f to O(q ). ", " qetamake returns a product of the functions of the form _E(q^m) ", " where _E(q) = (q;q)oo = (1-q)*(1-q^2)*(1-q^3)... ", " In other words, _E(q) = eta(tau)/q^(1/24). ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> A:=add(q^(n*(n+1)/2),n=0..20): ", "> etamake(A,q,20); ", " 2 ", " eta(2 tau) ", " ------------- ", " 1/8 ", " q eta(tau) ", " ", "> qetamake(A,q,20); ", " 2 2 ", " _E(q ) ", " ------- ", " _E(q) ", " ", " ", " ", "DISCUSSION : ", " ", "SEE ALSO : etamake ", " ", " "],qfactor=[ "FUNCTION : qseries[qfactor] - factor into terms (1-q^i) ", " ", "CALLING SEQUENCE : qfactor(f,T) ", " ", "PARAMETERS : f - qseries or ratpoly ", " T - positive integer (optional) ", " ", "SYNOPSIS : ", " ", " qfactor(f,T) attempts to factor f into terms of the form (1-q^i) ", " if possible. T (if present) is the largest i. ", "EXAMPLES : ", " ", "------------------------------------------------------------------------- ", "---------------------------------------------------------------------------- ", "SEE ALSO : ", " ", " ", " "],qs2jaccombo=[ "FUNCTION : qseries[qs2jaccombo] - convert a sum of q-series to a sum ", " of jacprods ", " ", "VERSION: May 6, 2010 ", " ", "CALLING SEQUENCE : qs2jaccombo(f,q,T) ", " qs2jaccombo(f,q,T,P) ", " ", "PARAMETERS : f - a sum of q-series ", " T,P - positive integers ", " ", " ", "SYNOPSIS : ", " This function takes the same args as jacprodmake. ", " In fact it converts each term in a sum to a jacprod ", " if possible using jacprodmake. If f is not a sum ", " and error is returned. ", " ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> E:=n->etaq(q,n,500): ", "> f:=(a,b,T)->add(a^(j*(j+1)/2)*b^(j*(j-1)/2),j=-T..T): ", "> CHOIID1:=E(4)^2*E(10)^4*E(20)/E(2)/E(5)^2/E(8)/f(-q^2,-q^18,20)/f(-q^16,-q^24,20) ", " -( E(5)*E(10)*f(-q^4,-q^6,20)/f(-q^2,-q^3,20)/f(-q^2,-q^8,20) ", " -q^3*subs(q=-q^20,E(1))*E(40)*f(-q^8,-q^32,20)/f(q^4,-q^16,20)/f(-q^16,-q^24,20) ", " +q^6*E(40)*E(80)*f(-q^8,-q^32,20)/f(-q^16,-q^24,20)/f(-q^32,-q^48,20)): ", "> qs2jaccombo(CHOIID1,q,200); ", " ", " ", " 9 ", "JAC(0, 40, infinity) JAC(4, 40, infinity) JAC(10, 40, infinity) JAC(12, 40, infinity) ", " ", " /JAC(20, 40, infinity)\3/2 / 2 2 ", " |---------------------| / (JAC(2, 40, infinity) JAC(5, 40, infinity) ", " \JAC(0, 40, infinity) / / ", " ", " 2 ", " JAC(6, 40, infinity) JAC(14, 40, infinity) JAC(15, 40, infinity) ", " ", " 2 ", " JAC(16, 40, infinity) JAC(18, 40, infinity) ) ", " ", " 3 ", " JAC(0, 10, infinity) JAC(4, 10, infinity) 3 ", " - ------------------------------------------ + q JAC(4, 80, infinity) ", " 2 ", " JAC(2, 10, infinity) JAC(3, 10, infinity) ", " ", " 2 ", " JAC(0, 80, infinity) JAC(32, 80, infinity) JAC(36, 80, infinity) ", " ", " /JAC(40, 80, infinity)\1/2 / 2 2 ", " |---------------------| / (JAC(16, 80, infinity) JAC(24, 80, infinity) ) ", " \JAC(0, 80, infinity) / / ", " ", " 6 2 /JAC(40, 80, infinity)\1/2 ", " q JAC(8, 80, infinity) JAC(0, 80, infinity) |---------------------| ", " \JAC(0, 80, infinity) / ", " - ------------------------------------------------------------------------ ", " JAC(16, 80, infinity) JAC(24, 80, infinity) ", " ", " ", " ", "SEE ALSO : jacprodmake ", " ", " "],quinprod=[ " ", "FUNCTION : qseries[quinprod] - Watson's quintuple product ", " ", "CALLING SEQUENCE : quinprod(a,b,q,T) ", " ", "PARAMETERS : a,b,q - names ", " T - positive integer ", " or one of the names prodid or seriesid ", " ", "SYNOPSIS : ", " ", " CASE 1. T is a positive integer ", " T ", " quinprod(a,b,q,T) returns the q-series expansion to order O(q ) of ", " Watson's quintuple product ", " ", " ", " where z and q are real or complex variables (or constants) and ", " where z is nonzero and |q|<1. ", " Here T is postive integer. ", " The expansion is found using the quintuple product identity. ", " ", " CASE 2. T = prodid ", " ", " quinprod(a,b,q,prodid) returns the quintuple product identity ", " in product form. ", " ", " CASE 3. T = seriesid ", " ", " quinprod(a,b,q,prodid) returns the quintuple product identity ", " in series form. ", " ", "EXAMPLES : ", " ", "------------------------------------------------------------------------- ", "> quinprod(z,q,prodid); ", " ", " 2 2 ", " (- z, q) (- q/z, q) (z q, q ) ", " oo oo oo ", " q 2 ", " (----, q ) (q, q) = ", " 2 oo oo ", " z ", " ", " 2 ", " q 3 3 3 3 3 ", " (----, q ) (q z , q ) (q , q ) ", " 3 oo oo oo ", " z ", " ", " q 3 2 3 3 3 3 ", " + z (----, q ) (q z , q ) (q , q ) ", " 3 oo oo oo ", " z ", "--------------------------------------------------------------------------- ", "> quinprod(z,q,seriesid); ", " ", " 2 2 ", " (- z, q) (- q/z, q) (z q, q ) ", " oo oo oo ", " q 2 ", " (----, q ) (q, q) = ", " 2 oo oo ", " ", " infinity ", " ----- ", " \ (- 3 m) (3 m - 1) (1/2 m (3 m + 1)) ", " ) ((- z) - (- z) ) q ", " / ", " ----- ", " m = - infinity ", "---------------------------------------------------------------------------- ", "> quinprod(z,q,3); ", " ", "/ 12 1 \ 22 / 9 1 \ 12 / 6 1 \ 5 / 3 1 \ ", "|z + ---| q + |- z - ----| q + |z + ----| q + |- z - ----| q + 1 + z ", "| 11| | 8 | | 5 | | 2 | ", "\ z / \ z / \ z / \ z / ", " ", " / 1 4\ 2 / 1 7\ 7 / 1 10\ 15 / 1 13\ 26 ", "+ |- ---- - z | q + |---- + z | q + |- ---- - z | q + |--- + z | q ", " | 3 | | 6 | | 9 | | 12 | ", " \ z / \ z / \ z / \z / ", "---------------------------------------------------------------------------- ", "SEE ALSO : ", " ", " "],sift=[ "FUNCTION : qseries[sift] - Pick out the terms of a q-series in which the exponent ", " belongs to a fixed residue class mod p ", " ", "CALLING SEQUENCE : sift(s,q,n,k,T) ", " ", "PARAMETERS : f - q-series ", " T - positive integers ", " ", "SYNOPSIS : ", " ", " Suppose s is the q-series ", " ", " s = sum a[i] q^i O(q^T) ", " ", " then sift(s,q,n,k,T) returns the q-series ", " ", " sum a[n*i+k] q^i ", " T ", " ", " ", "EXAMPLES : ", "> with(qseries): ", "> F:=series((etaq(q,1,1000)/etaq(q,25,1000)/q)^5,q,1000): ", "> etamake(F,q,60); ", " 5 ", " eta(tau) ", " ------------ ", " 5 ", " eta(25 tau) ", " ", "> s25:=sift(F,q,5,0,999): ", "> series(s25,q,10); ", " -1 2 3 4 5 6 7 8 9 ", "q - 6 + 9 q + 10 q - 30 q + 6 q - 25 q + 96 q + 60 q - 250 q + 45 q ", " ", " 10 ", " + O(q ) ", " ", "> etamake(s25,q,50); ", " 6 ", " eta(tau) ", " ----------- ", " 6 ", " eta(5 tau) ", " ", "> s25a:=oldsift(F,q,5,0,999): ", "> series(s25a,q,10); ", " 2 3 4 5 6 7 8 9 ", "-6 + 9 q + 10 q - 30 q + 6 q - 25 q + 96 q + 60 q - 250 q + 45 q + ", " ", " 10 ", " O(q ) ", " ", "DISCUSSION : Observe that oldsift was in error because of negative exponent. ", " ", "SEE ALSO : oldsift ", " ", " "],theta=[ "FUNCTION : qseries[theta] - theta function ", " ", "CALLING SEQUENCE : theta(z,q,T) ", " ", "PARAMETERS : z - variable ", " q - variable ", " T - positive integer ", " ", "SYNOPSIS : ", " ", " theta(z,q,T) returns the tuncated theta-series ", " ", " T ", " ----- 2 ", " \ i (i ) ", " ) z q ", " / ", " ----- ", " i = - T ", " ", "EXAMPLES : ", " ", "------------------------------------------------------------------------- ", "> theta(-1,q,10); ", " ", " 100 81 64 49 36 25 16 9 4 ", " 2 q - 2 q + 2 q - 2 q + 2 q - 2 q + 2 q - 2 q + 2 q - 2 q + 1 ", " ", "---------------------------------------------------------------------------- ", "SEE ALSO : jacprod, tripleprod, theta2, theta3, theta4 ", " ", " ", " "],theta2=[ "FUNCTION : qseries[theta2] - the theta function theta (q) ", " 2 ", "CALLING SEQUENCE : theta2(q,T) ", " ", "PARAMETERS : q - variable ", " T - positive integer ", " ", "SYNOPSIS : ", " T ", " theta2(q,t) returns the q-series expansion to order O(q ) of ", " ", " oo ", " ----- 2 ", " \ (n+1/2) ", " theta (q) = ) q ", " 2 / ", " ----- ", " n = - oo ", " ", "EXAMPLES : ", " ", "------------------------------------------------------------------------- ", "> theta2(q,50); ", " ", " 72 56 42 30 20 12 6 2 90 1/4 ", "(2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 + q ) q ", " ", "---------------------------------------------------------------------------- ", "SEE ALSO : jacprod, tripleprod, theta, theta3, theta4 ", " ", " ", " "],theta3=[ "FUNCTION : qseries[theta3] - the theta function theta (q) ", " 3 ", "CALLING SEQUENCE : theta3(q,T) ", " ", "PARAMETERS : q - variable ", " T - positive integer ", " ", "SYNOPSIS : ", " T ", " theta3(q,t) returns the q-series expansion to order O(q ) of ", " ", " oo ", " ----- 2 ", " \ n ", " theta (q) = ) q ", " 3 / ", " ----- ", " n = - oo ", " ", "EXAMPLES : ", " ", "------------------------------------------------------------------------- ", "> theta3(q,50); ", " ", " ", " 64 49 36 25 16 9 4 ", " 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 2 q + 1 ", " ", "---------------------------------------------------------------------------- ", "SEE ALSO : jacprod, tripleprod, theta, theta2, theta4 ", " ", " ", " "],theta4=[ "FUNCTION : qseries[theta4] - the theta function theta (q) ", " 4 ", "CALLING SEQUENCE : theta4(q,T) ", " ", "PARAMETERS : q - variable ", " T - positive integer ", " ", "SYNOPSIS : ", " T ", " theta4(q,t) returns the q-series expansion to order O(q ) of ", " ", " oo ", " ----- 2 ", " \ n n ", " theta (q) = ) (-1) q ", " 4 / ", " ----- ", " n = - oo ", " ", "EXAMPLES : ", " ", "------------------------------------------------------------------------- ", "> theta4(q,50); ", " ", " 64 49 36 25 16 9 4 ", " 2 q - 2 q + 2 q - 2 q + 2 q - 2 q + 2 q - 2 q + 1 ", " ", "---------------------------------------------------------------------------- ", "SEE ALSO : jacprod, tripleprod, theta, theta2, theta3 ", " ", " ", " "],tripleprod=[ " ", "FUNCTION : qseries[tripleprod] - q-series expansion of Jacobi's triple product ", " ", "CALLING SEQUENCE : tripleprod(z,q,T) ", " ", "PARAMETERS : z,q - names ", " T - positive integer ", " ", "SYNOPSIS : ", " ", " T ", " tripleprod(z,q,T) returns the q-series expansion to order O(q ) of ", " Jacobi's tripleproduct ", " ", " infinity ", " --------' / i \ ", " ' | | (i - 1) | q | i ", " | | (1 - z q ) |1 - ----| (1 - q ) ", " | | \ z / ", " | | ", " i = 1 ", " ", " where z and q are real or complex variables (or constants) and ", " where z is nonzero and |q|<1. ", " Here T is postive integer. The expansion is found using Jacobi's ", " triple product identity. ", " ", "EXAMPLES : ", " ", "> tripleprod(z,q,10); ", " ", " 21 15 10 6 3 ", " q q q q q 2 3 3 4 6 5 10 ", " --- - --- + --- - ---- + ---- - q/z + 1 - z + z q - z q + z q - z q ", " 6 5 4 3 2 ", " z z z z z ", " ", " 6 15 ", " + z q ", " ", "> tripleprod(q,q^3,10); ", " ", " 57 40 26 15 7 2 5 12 22 35 51 ", " q - q + q - q + q - q + 1 - q + q - q + q - q + q ", " ", "SEE ALSO : ", " ", " ", " "],winquist=[ " ", "FUNCTION : qseries[winquist] - q-series of Winquist's product ", " ", "CALLING SEQUENCE : winquist(a,b,q,T) ", " ", "PARAMETERS : a,b,q - names ", " T - positive integer ", " ", "SYNOPSIS : ", " ", " T ", " winquist(a,b,q,T) returns the q-series expansion to order O(q ) of ", " Winquist's product ", " ", " 2 ", "(a;q) (q/a;q) (b;q) (q/b;q) (ab;q) (q/(ab);q) (a/b;q) (b/(aq);q) (q;q) ", " oo oo oo oo oo oo oo oo oo ", " ", " where a,b and q are real or complex variables (or constants) and ", " where a,b are nonzero and |q|<1. ", " Here T is postive integer. The expansion is found using Winquist's ", " identity. ", " ", "EXAMPLES : ", " ", "> winquist(a,b,q,30)/(1-a)/(1-b)/(1-a*b)/(1-a/b): ", " ", "> normal(series(\",q,30)): ", " ", "> subs(a=1,b=1,\"); ", " ", " 2 3 4 5 7 8 9 10 ", "1 - 10 q + 35 q - 30 q - 105 q + 238 q - 260 q - 165 q + 140 q + 1054 q ", " ", " 11 12 14 15 16 18 19 ", " - 770 q - 595 q - 715 q + 2162 q + 455 q - 2380 q - 1820 q ", " ", " 20 21 22 23 24 25 26 ", " + 2401 q - 680 q + 1495 q + 3080 q + 1615 q - 6958 q - 1925 q ", " ", " 29 30 ", " + 5100 q + O(q ) ", " ", "> series(\" - tripleprod(q,q^3,10)^10,q,30); ", " ", " 30 ", " O(q ) ", " ", "SEE ALSO : ", " ", " ", " "],zqfactor=[ "FUNCTION : qseries[zqfactor] - Convert (z,q)-series into (z,q)-product ", " ", " ", "CALLING SEQUENCE : zqfactor(F,z,q) ", " zqfactor(F,z,N) ", " ", " ", "PARAMETERS : F - q-series with coeffients that are polynomials in z ", " z - variable (name) ", " N - positive integer (optional, default=1000) ", " ", "GLOBAL VARIABLES : ", " ", "SYNOPSIS : ", " ", " zqfactor(F,z,q) tries to convert F into a product of terms ", " (1 - a[i,j] z^i q^j) where each a[i,j] is an integer. ", " Here N is the max number of terms (default is 1000 but can be assigned). ", " ", " WARNING: This function does not work all the time. ", " Sometimes it finds the correct (z,q)-product - see example below. ", " But at times it will fail to find a reasonable product even ", " though one may exist. ", " ", "EXAMPLES : ", " ", "> with(qseries): ", "> L1:=tripleprod(-z^2*q^3,q^4,20): ", "> L2:=tripleprod(-z^2*q,q^4,20): ", "> g:=L1-L2/z: ", "> zqfactor(g,z,q,10); ", " / 2 \ ", " 2 2 | q | 3 3 ", "(1 - 1/z) (1 - z q) (1 - q) (1 - q/z) (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) (1 - q ) ", " \ z / ", " ", " / 3 \ / 4 \ / 5 \ ", " | q | 4 4 | q | 5 5 | q | 6 ", " |1 - ----| (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) ", " \ z / \ z / \ z / ", " ", " / 6 \ / 7 \ / 8 \ ", " 6 | q | 7 7 | q | 8 8 | q | ", " (1 - q ) |1 - ----| (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) (1 - q ) |1 - ----| ", " \ z / \ z / \ z / ", " ", " / 9 \ / 10\ ", " 9 9 | q | 10 10 | q | ", " (1 - z q ) (1 - q ) |1 - ----| (1 - z q ) (1 - q ) |1 - ---| ", " \ z / \ z / ", " ", "DISCUSSION : ", " ", "SEE ALSO : qfactor ", " ", " "]]): tmp:=qshelpTAB[qsprocname]: for a in tmp do printf(cat(a,"\n"));od; RETURN(): else error "%1 is not a qseries function",qsprocname; fi: end: qseries[prodmake]:=proc() local ft,f0,_a,_b,i,n,j,d,_A,_B,sum1,sum2,divj,divjb,m,prd,f,q,T,bseq,lst; #### #USAGE: prodmake(f,q,T) returns q-product # prodmake(f,q,T,list) returns q-product as a list of exponents # #### #04/01/00: added nargs bit #03/30/07: add expand for symbolic prods if nargs>4 then ERROR(` number of arguments must be 3 or 4.`); fi: f:=args[1]: q:=args[2]: T:=args[3]: #### ft:=series(f,q,T+5): if whattype(ft)=series then f0:=coeff(ft,q,0): if f0=1 then _b:=series(f,q,T): _b:=convert(_b,polynom): for i from 1 to T-1 do _B[i]:=coeff(_b,q,i): od: _A[1]:=_B[1]: for n from 2 to T-1 do sum2:=0: for j from 1 to n-1 do divj:=numtheory[divisors](j): sum1:=0: for d in divj do sum1:=expand(sum1+d*(_A[d])): od: sum2:=expand(sum2 + (_B[n-j])*sum1): od: sum1:=0: divjb:=numtheory[divisors](j) minus {n}: for d in divjb do sum1:=expand(sum1+d*(_A[d])): od: sum2:=expand(n*_B[n] - sum2 - sum1): _A[n]:=sum2/n: od: #### #04/01/00: added option of returning list if nargs=3 then prd:=product((1-q^m)^(-_A[m]),m=1..(T-1)): RETURN(prd): else bseq:=[seq(-_A[m],m=1..(T-1))]: lst:=convert(bseq,list): RETURN(lst): fi: else ERROR(`coeff of q^0 must be 1`); fi: else ERROR(`f must be a series`); fi: end: qseries[qbin]:=proc(q,m,n) #06/21/09: allow q to be root of unity etc if whattype(m)=integer and whattype(n)=integer then if m>=0 and m<=n then if type(q,symbol) then RETURN(normal(aqprod(q,q,n)/aqprod(q,q,m)/aqprod(q,q,n-m))); else RETURN(subs(_x=q,normal(aqprod(_x,_x,n)/aqprod(_x,_x,m)/aqprod(_x,_x,n-m)))); fi: else RETURN(0); fi: else ERROR(` m and n must be integers.`); fi: end: qseries[qdegree]:=proc(QS) # 10/14/10 RETURN(degree(convert(QS,polynom),q)); end: qseries[qetamake]:=proc(f,q,last) # #03/16/04 #Bug fixed 05/18/05 #This is a version of etamake which returns _E(q^m) instead of eta(m*tau) #This procedure computes an eta-product expansion #of the series f to order O(q^last). local fp,tc,exq,g,aa,ld,h,hh,i,cf,etaprod,alast,sf: sf:=series(f,q,last+10): fp:=convert(sf,polynom): tc:=tcoeff(fp,q): exq:=ldegree(fp,q): g:=normal(fp/tc/q^exq): aa:=tc: ld:=1: alast:=last-exq: while ld>0 do h:=series(g-1,q=0,alast+1): hh:=0: for i from 1 to alast do hh:=hh+coeff(h,q,i)*q^i: od: h:=hh: ## ##08/20/99: bug fix ldegree(0,q) returns infinity ## in maple V release 5 if h=0 then ld:=0: else ld:=ldegree(h,q): fi: cf:=coeff(h,q,ld): if ld>0 then aa:=_E(q^ld)^(-cf)*aa: g:=g*etaq(q,ld,alast)^cf: fi: od: ##etaprod:=aa ##Fixed 05/18/05 etaprod:=aa*q^exq: RETURN(etaprod): end: ####################################################################### # qseries[qfactor] ####################################################################### ##01/08/00: ##BUGS FIXED: ## (1) Fix problem when numerator=1 ## Example OLD version: ## > qfactor(1/(1-q)); ## Error, (in qfactor/bigqpfac) unable to convert ## ## Example NEW version: ## > qfactor(1/(1-q)); ## 1 ## - ------ ## -1 + q ## (2) Fix problem when input is a polynom ## Example OLD version: ## > qfactor(1+q+q^2); ## 2 ## q + q + 1 ## Example NEW version: ## > qfactor(1+q+q^2); ## 3 ## 1 - q ## ------ ## 1 - q ##NOTE: Problems fixed by fixing qfopexp. ## ####################################################################### ##10/24/99: did maple-update and maple-local-make ####################################################################### ##10/19/99: BUGS FIXED: (1) added line in qsplit to make sure tcoeff ## returns correct value. ## (2) added extra condition statement to qfactor ## so that qfactor(f)=f if f has type symbol ## or rational. ####################################################################### macro(qsplit = `qfactor/qsplit`, qpfac = `qfactor/qpfac`, qfac=`qfactor/qfac`,qfopexp=`qfactor/qfopexp`, bigqpfac=`qfactor/bigqpfac`); ####################################################################### # FUNCTION : qsplit - returns a list [f,tc,ld,td] # CALLING SEQUENCE : qsplit(f) # PARAMETERS : f - a polynomial in q # SYNOPSIS : # qsplit(f) returns the list [f,tc,ld,td] # where f = tc*(q^ld + ........+()q^td. ####################################################################### ## qsplit:=proc(f::polynom) local tc,ld,td,f2; f2:=expand(f):##<--- this line added 10/19/99 ##If left unexpanded tcoeff may return incorrect value. tc := tcoeff(f2, q); ### WARNING: ldegree(0,x) now returns infinity ld := ldegree(f2, q); ### WARNING: degree(0,x) now returns -infinity td := degree(f2, q); RETURN([f,tc,ld,td]); end; ####################################################################### # FUNCTION : qpfac - factor a q polynom into factors (1-q^i) # CALLING SEQUENCE : qpfac(f,T,s) # qpfac(f) # qpfac(f,T) # qpfac(f,s) # PARAMETERS : f - a polynomial in q # T - upper bound for i (optional) # s - string (optional) # SYNOPSIS : # qpfac(f) attempts to factor the poly q into factors (1-q^i) # if it fails it simply returns the input f. # If the third (or second) argument s=test is given then qpfac # will return FAIL if f can not be q-factored. ####################################################################### ## #++++++++++++++++++++++++++++++++++++++++++++++++++++++ qpfac:=proc() local m1, m2, LBITS, tc, ld, g, gl, gl1, gl2, gl3, gd, ggc, gprod, gser, gno,f; f:=args[1]: if nargs=1 or (nargs=2 and type(args[2],integer)<>true) then m1:=4: m2:=3: else m1:=0: m2:=args[2] fi: LBITS:=qsplit(f); tc:=LBITS[2]: ld:=LBITS[3]: g:=convert(f/tc/q^ld,polynom); gl:=convert(g,list); gl1:=subs(q=1,gl); gl2:=map(whattype,gl1); gl3:=convert(gl2,set); if gl3 = '{integer}' then ### WARNING: degree(0,x) now returns -infinity gd:=degree(g,q); ggc:=coeff(g,q,0); gprod:=prodmake(g,q,m1*gd+m2); gser:=convert(series(g-gprod,q,m1*gd+m2+5),polynom); if gser<>0 then if nargs=2 and args[2]=test then RETURN(FAIL); fi: if nargs=3 and args[3]=test then RETURN(FAIL); fi: if nargs=1 or (nargs=2 and args[2]<>test) then RETURN(f); fi: else gno:=normal(gprod-g); if gno = 0 then RETURN(tc*gprod*q^ld); else if nargs=2 and args[2]=test then RETURN(FAIL); fi: if nargs=3 and args[3]=test then RETURN(FAIL); fi: if nargs=1 or (nargs=2 and args[2]<>test) then RETURN(f); fi: fi: fi: else if nargs=2 and args[2]=test then RETURN(FAIL); fi: if nargs=3 and args[3]=test then RETURN(FAIL); fi: if nargs=1 or (nargs=2 and args[2]<>test) then RETURN(f); fi: fi: end; ####################################################################### # FUNCTION : qfopexp - factors a SINGLE q-expression and factors # as much as possible into terms of the form (1-q^i) # CALLING SEQUENCE : qfopexp(f,T,s) # qfopexp(f) # qfopexp(f,T) # qfopexp(f,s) # PARAMETERS : f - a single q-expression (ie. a factor of a factored # expression. # T - upper bound for i (optional) # s - string (optional) # SYNOPSIS : # An expression that cant be q-factored is left alone. ####################################################################### ## #++++++++++++++++++++++++++++++++++++++++++++++++++++++ qfopexp:=proc() local expr,wh,n,whL,cond,s; expr:=args[1]; wh:=whattype(expr); n:=nops([op(expr)]); whL:=map(whattype,[op(expr)]); if n=2 and whL[1]=`+` and whL[2]=integer then cond:=1: else cond:=0; fi; if wh=`+` or cond=1 then s:=subs(q=2,expr); if type(s,rational)=true then RETURN(qfac(args)); else RETURN(expr); fi: else RETURN(expr); fi; end; ####################################################################### # FUNCTION : bigqpfac - factor a q polynom into factors (1-q^i) # CALLING SEQUENCE : bigqpfac(f,T,s) # bigqpfac(f) # bigqpfac(f,T) # bigqpfac(f,s) # PARAMETERS : f - a polynomial in q # T - upper bound for i (optional) # s - string (optional) # SYNOPSIS : # bigqpfac(f) attempts to factor the poly q into factors (1-q^i) # if it fails it simply returns the input f. # If the third (or second) argument s=test is given then qpfac # will return FAIL if f can not be q-factored. # This is a version of qpfac. This version does not fail if it comes # across a term with other variables beside q - these are simply # left alone. ####################################################################### ## #++++++++++++++++++++++++++++++++++++++++++++++++++++++ bigqpfac:=proc() local k,expr,na,qtmp,rst,L1,L2,new,conc; expr:=args[1]: ### ###01/08/00: add following if .. fi ### if type(expr,symbol)=true or type(expr,rational)=true then RETURN(expr); else na:=nargs; if na=1 then qtmp:=x->qfopexp(x); else rst:=seq(args[k],k=2..nargs); qtmp:=x->qfopexp(x,rst); fi: ### ###01/08/00: add following if .. fi ### conc:=0: if type(expr,polynom)=true and type(expr,`+`)=true then RETURN(qtmp(expr)): else L1:=[op(expr)]; L2:=map(qtmp,L1); if type(expr,`^`)=true then new:=L2[1]^L2[2]; if nops(L2)>2 then ERROR(`nops(L2)>2 in bigqfac`); fi: else ##new:=convert(L2,`*`); new:=convert(L2,whattype(expr)); fi: RETURN(new); fi: fi: ### WARNING: `rst` is a lexically scoped local end; ####################################################################### # 2ND MAIN FUNCTION qseries[qfac] ####################################################################### #++++++++++++++++++++++++++++++++++++++++++++++++++++++ qfac:=proc() local f,T; f:=args[1]: if nargs=1 then if type(f,ratpoly)=true then if type(f,polynom) then RETURN(qpfac(f)); else RETURN(qpfac(numer(f))/qpfac(denom(f))); fi: else ERROR(`f must be ratpoly`); fi: else T:=args[2]: if type(f,ratpoly)=true then if type(f,polynom) then RETURN(qpfac(f,T)); else RETURN(qpfac(numer(f),T)/qpfac(denom(f),T)); fi: else ERROR(`f must be ratpoly`); fi: fi: end: ####################################################################### # THE MAIN FUNCTION qseries[qfactor] ####################################################################### ## #++++++++++++++++++++++++++++++++++++++++++++++++++++++ qseries[qfactor]:=proc() local f,T,k,n,newargs1,newargs2; f:=factor(args[1]): ## This part added 10/19/99 ### WARNING: the definition of the type `symbol` has changed'; see help page for ### details if type(f,symbol)=true or type(f,rational)=true then RETURN(f); else if type(f,ratpoly)=true then if type(f,polynom) then RETURN(bigqpfac(f)); else n:=nargs; if n=1 then RETURN(bigqpfac(numer(f))/bigqpfac(denom(f))); else newargs1:=numer(f),seq(args[k],k=2..n); newargs2:=denom(f),seq(args[k],k=2..n); RETURN(bigqpfac(newargs)/bigqpfac(newargs)); fi: fi: else ERROR(`f must be ratpoly`); fi: fi: end: macro(qsplit = qsplit, qpfac = qpfac, qfac=qfac,qfopexp=qfopexp, bigqpfac=bigqpfac); #++++++++++++++++++++++++++++++++++++++++++++++++++++ qseries[qs2jaccombo]:=proc() # This proc tries to write qseries as a linear combination # of jacprods. local xx,nn,j,yy,qs,q,T,PP; if nargs<>3 and nargs<>4 then ERROR("nargs = 3 or 4"); fi: qs:=args[1]: q:=args[2]: T:=args[3]: if nargs=4 then PP:=args[4]: fi: if not(type(qs,`+`)) then ERROR("qs not of + type"); fi: xx:=0: nn:=nops(qs): if nargs=3 then for j from 1 to nn do yy:=jacprodmake(op(j,qs),q,T): xx:=xx+yy: od: else for j from 1 to nn do yy:=jacprodmake(op(j,qs),q,T,PP): xx:=xx+yy: od: fi: RETURN(xx): end: qseries[quinprod]:=proc(z,q,T) local x,i,j,lasti,leftid,x1,x2,rightid; # 06.10.20: corrected type in seriesid version # If T = prodid # then a product form of the identity is returned. # If T = seriesid # then a series form of the identity is returned. # If T is a positive integer then a series to O(q^T) # is returned. # Determine output form if type(T,posint) then x:=0: lasti:=trunc( 7/6+1/6*(73+24*T)^(1/2))+1: for i from -lasti to lasti do x:=x + ( (-z)^(-3*i)-(-z)^(3*i+1) ) *q^(i*(3*i+1)/2): od: RETURN(x): else if T=prodid or T=seriesid then leftid:=` `(-z,q)[infinity] *` `(-q/z,q)[infinity] *` `(z^2*q,q^2)[infinity] *` `(1/z^2*q,q^2)[infinity] *` `(q,q)[infinity]: if T=prodid then x1:=` `(q^2/z^3,q^3)[infinity] *` `(q*z^3,q^3)[infinity] *` `(q^3,q^3)[infinity]: x2:=` `(q/z^3,q^3)[infinity] *` `(q^2*z^3,q^3)[infinity] *` `(q^3,q^3)[infinity]: x:= x1+z*x2: RETURN(leftid=x): else #old: rightid:=sum(( (-z)^(-3*m)-(-z)^(3*m-1) ) # *q^(m*(3*m+1)/2),m=-infinity..infinity): #06.10.20: corrected "(3*m-1)" --> "(3*m+1)" rightid:=sum(( (-z)^(-3*m)-(-z)^(3*m+1) ) *q^(m*(3*m+1)/2),m=-infinity..infinity): RETURN(leftid=rightid): fi: else fi: fi: end: qseries[sift]:=proc(s,q,n,k,T) # # sum a_i q^i --> sum a_[ni+k] q^i # 09.04.15: new version of sift can now handle negative exponents # See oldsift for oldversion local y,i,st,lasti,sp,firsti: st:=series(s,q,T+5): if whattype(st)=series then sp:=convert(st,polynom): y:=0: lasti:=floor((T-k)/n): ## NOTE: 09.23.15 lqdegree and lqdegree0 borrowed ## from thetaids package. firsti:=ceil((lqdegree(sp)-k)/n): ##print("firsti=",firsti,"lasti=",lasti); for i from firsti to lasti do ##y:=y+coeff(s,q,(n*i+k))*q^i: ##fixed 11-16-06 ##print("**** i=",i,"y=",y); y:=y+coeff(st,q,(n*i+k))*q^i: od: RETURN(y): else ERROR(`s must be a series`); fi: end: qseries[theta]:=proc(z,q,T) local x,i: x:=0: for i from -T to T do x := x + z^i*q^(i*i): od: RETURN(x): end: qseries[theta2]:=proc(q,T) local N: N:=trunc(sqrt(T))+2: RETURN(qseries[theta](q,q,N)*q^(1/4)): end: qseries[theta3]:=proc(q,T) local N: N:=trunc(sqrt(T))+1: RETURN(qseries[theta](1,q,N)): end: qseries[theta4]:=proc(q,T) local N: N:=trunc(sqrt(T))+1: RETURN(qseries[theta](-1,q,N)): end: qseries[tripleprod]:=proc(z,q,T) local x,lasti,i,leftid,rightid; # If T = seriesid # then a series form of the identity is returned. # If T is a positive integer then a series to O(q^T) # is returned. # Determine output form if type(T,posint) then x:=0: lasti:=trunc( sqrt(2*T+1/4)+1/2)+1: for i from -lasti to lasti do x:=x + (-1)^i*z^i*q^(i*(i-1)/2): od: RETURN(x): else if T=seriesid then leftid:=` `(z,q)[infinity] *` `(q/z,q)[infinity] *` `(q,q)[infinity]: rightid:=sum((-1)^m*z^m*q^(m*(m-1)/2), m=-infinity..infinity): RETURN(leftid=rightid): else ERROR(`Invalid T. T must either be a positive integer or the string seriesid`); fi: fi: end: qseries[winquist]:=proc(a,b,q,T) local x,i,j,lasti: x:=0: lasti:=trunc( 7/6+1/6*(25+24*T)^(1/2))+1: for i from 0 to lasti do for j from -lasti to lasti do x:=x + (-1)^(i+j)*( (a^(-3*i)-a^(3*i+3))*(b^(-3*j)-b^(3*j+1)) + (a^(-3*j+1)-a^(3*j+2))*(b^(3*i+2)-b^(-3*i-1))) *q^( 3*i*(i+1)/2 + j*(3*j+1)/2 ): od: od: RETURN(x): end: #++++++++++++++++++++++++++++++++++++++++++++++++++++++ qseries[zqfactor]:=proc() local NF,G,numt,numlim,c,FF,TT,LL,ld,tt,zqf,buglim,F,z,q,N; if nargs>5 or nargs<4 then ERROR(`zqfactor takes 4 or 5 args.`); fi: if nargs=5 then buglim:=args[5]: else buglim:=1000: fi: F:=args[1]: z:=args[2]: q:=args[3]: N:=args[4]: # #Factor F into a product of terms (1 - a[i,j] z^i q^j) #N = largest j #buglim = max number of terms (default is 1000 but can be assigned) # ## ## ##EXAMPLE: L1:=tripleprod(-z^2*q^3,q^4,40); ## L2:=tripleprod(-z^2*q,q^4,40); ## zqfactor(L1-L2/z,q,20); ## G:=1: NF:=F: numt:=0: numlim:=buglim: while NF<>1 and numt<=numlim do c:=coeff(NF,q,0): if c<>1 then NF:=NF/c: G:=G/c: numt:=numt+1: fi: FF:=normal(series(NF,q,N+1)): FF:=convert(FF,polynom): TT:=expand(tcoeff(FF-1,q)): LL:=[op(TT)]: ld:=ldegree(FF-1,q): for tt in LL do if type(tt,integer) and tt<>(-1) then zqf:=(1-q^ld)^(-tt): else zqf:=1+tt*q^ld: fi: numt:=numt+1: G:=G/zqf: NF:=NF/zqf: NF:=normal(series(NF,q,N+1)); NF:=convert(NF,polynom): od; od; RETURN(1/G); end; #++++++++++++++++++++++++++++++++++++++++++++++++++++ printf("TABLE TYPE qseries = %a\n",type(qseries,table)); savelib( qseries, `jacprodmake/jaccheck` , `jacprodmake/periodfind` , `jacprodmake/periodfind2` , `jacprodmake/jacmake` , `jac2prod/jac` , `jac2J/jacJ` , `jac2series/tripleprod2` , `jac2series/qjac` , `qfactor/qsplit` , `qfactor/qpfac` , `qfactor/qfac` , `qfactor/qfopexp` , `qfactor/bigqpfac` , "c:\\cygwin64/home/fgarv/maple/mylib/qseries.mla"); printf("END qseries package\n"); ## mylib above must be changed to the name of the directory ## in which you want stuff stored