Suppose I take a polynomial from $R[x]$ say $x^2+5x$ and another polynomial from $R[y]$ say $y^3$. I want to formally multiply them and print $x^2y^3 +5xy^3$ as the output.
How can I do that?
Note: K is finite field of size 4 in 'a'
My efforts:
R_1=PolynomialRing(K,['z%s'%p for p in range(1,3)])
R_2=PolynomialRing(K,['x%s'%p for p in range(1,3)])
pp=R_1.random_element()
(a + 1)*z1^2 + (a)*z1*z2 + (a + 1)*z2 + (a)
qq=R_2.random_element()
x1*x2 + (a + 1)*x2^2 + x1 + 1
When I do pp*qq
I get the following output
unsupported operand parent(s) for *: 'Multivariate Polynomial Ring in z1, z2 over Finite Field in a of size 2^2' and 'Multivariate Polynomial Ring in x1, x2 over Finite Field in a of size 2^2'