Here's some "share-and-repair"-ware written in Maple to implement multiplications of polynomials in x and y, subject to the commutation rule yx=qxy.
# Multiply polynomials pmult := proc(F,G) local flist, glist, i, j, gather; if type(F,`+`) then flist := [op(F)] else flist := [F]; fi; if type(G,`+`) then glist := [op(G)] else glist := [G]; fi; gather := 0; for i from 1 to nops(F) do for j from 1 to nops(G) do gather := gather + mmult(flist[i],glist[j]); od; od; gather; end; # Multiply monomials mmult := proc(S,T) local sx, sy, sc, tx, ty, tc; sx := degree(S,x); sy := degree(S,y); sc := simplify(S/x^sx/y^sy); tx := degree(T,x); ty := degree(T,y); tc := simplify(T/x^tx/y^ty); simplify(sc*tc*q^(sy*tx)*x^(sx+tx)*y^(sy+ty)); end;If you find bugs, let me know!
Jim