I'm want a method to get the symbolic coefficients of polynomial p \in
GF(2^pp)[X0,...,X_{nvars-1}] translate to GF(2)[t]. For example for pp = 2.
The polynomial p = X0*X1 = (x_00+x_01*t)*(x_10+x_11*t) =
(x_00*x_10+x_01*x_11) + (x_01*x_11+x_01*x_10 + x_00*x_11)*t then the method
get [(x_00*x_10+x_01*x_11),(x_01*x_11+x_01*x_10 + x_00*x_11)]. In code
below py problem is when I want collect the coefficients of t, How I will
be able to collect that coefficients in **efficient way**?
q = 2
nvars = 2
k.<t> = GF(2^q)
Xi = []
xij = []
for i in range(nvars):
Xi.append(var('X'+str(i)))
for j in range(q):
xij.append(var('x'+str(i)+''+str(j)))
Xi.append(t)
P = PolynomialRing(k,names=Xi)
R = PolynomialRing(k,names=xij)
S = PolynomialRing(R,'t')
p = P.random_element(degree=2)
subsvar = [sum((t^i*R.gen(i+q*j) for i in range(q))) for j in
range(nvars)]
subsvar.append(t)
p = p(subsvar)
p
(t + 1)*x00*x10 + x01*x10 + x00*x11 + (t)*x01*x11 + (t)*x10 + (t +
1)*x11 + (t + 1)
--
---------------------------------------------------------------------
MSc. Juan del Carmen Grados Vásquez
Laboratório Nacional de Computação Científica
Tel: +55 21 97633 3228
(http://www.lncc.br/)
http://juaninf.blogspot.com
---------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.