Dears members I need doing substitution of values vars_gf2subs in vars_GF
variables on p polynomial. I'm trying p.subs(vars_GF[i]=vars_gf2subs[i]) bu
tI get error. How I will be able to doing that?

p = 3
k.<t> = GF(2^p)
nvars = 4
vars_GF = []
vars_gf2 = []
vars_gf2subs = []
l = 0
for i in range(nvars):
    vars_GF.append(var("X"+str(i)))
    sum1 = 0
    for j in range(p):
        vars_gf2.append(var("x"+str(i)+str(j)))
        sum1 = sum1 + vars_gf2[i*p+j]*(t^j)
        l = l + 1
    vars_gf2subs.append(sum1)

PR = PolynomialRing(k, nvars, names = vars_GF)
p = PR.random_element(degree=2)
for i in range(nvars):
    print vars_GF[i]
    p.subs(vars_GF[i]=vars_gf2subs[i])

-- 
---------------------------------------------------------------------
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to