1 | initial version |
Here is a way:
sage: p = 2
sage: n = 4
sage: F.<a> = GF(p^n)
sage: R = PolynomialRing(F, n, names='c')
sage: c = R.gens()
sage: f = sum(c[i]*a^i for i in range(n)); f
c0 + a*c1 + (a^2)*c2 + (a^3)*c3
sage: I = R.ideal([g^2 - g for g in c])
sage: P = sum(vector(c)*m.reduce(I) for c,m in f^3); P
(c0*c2 + c1*c2 + c1*c3 + c0, c0*c1 + c0*c2 + c2*c3 + c3, c0*c1 + c0*c2 + c1*c2 + c0*c3 + c1*c3 + c2*c3 + c2, c1*c3 + c2*c3 + c1 + c2 + c3)
Confirmation:
sage: for z in F:
....: print([P[k](z.list()) for k in range(n)] == (z^3).list())
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
2 | No.2 Revision |
Here is a way:
sage: p = 2
sage: n = 4
sage: F.<a> = GF(p^n)
sage: R = PolynomialRing(F, n, names='c')
sage: c = R.gens()
sage: f = sum(c[i]*a^i for i in range(n)); f
c0 + a*c1 + (a^2)*c2 + (a^3)*c3
sage: I = R.ideal([g^2 - g for g in c])
sage: P = sum(vector(c)*m.reduce(I) sum(vector(b)*m.reduce(I) for c,m b,m in f^3); P
(c0*c2 + c1*c2 + c1*c3 + c0, c0*c1 + c0*c2 + c2*c3 + c3, c0*c1 + c0*c2 + c1*c2 + c0*c3 + c1*c3 + c2*c3 + c2, c1*c3 + c2*c3 + c1 + c2 + c3)
Confirmation:
sage: for z in F:
....: print([P[k](z.list()) for k in range(n)] == (z^3).list())
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
3 | No.3 Revision |
Here is a way:
sage: p = 2
sage: n = 4
sage: F.<a> = GF(p^n)
sage: R = PolynomialRing(F, n, names='c')
sage: c = R.gens()
sage: f = sum(c[i]*a^i for i in range(n)); f
c0 + a*c1 + (a^2)*c2 + (a^3)*c3
sage: I = R.ideal([g^2 R.ideal([g^p - g for g in c])
sage: P = sum(vector(b)*m.reduce(I) for b,m in f^3); P
(c0*c2 + c1*c2 + c1*c3 + c0, c0*c1 + c0*c2 + c2*c3 + c3, c0*c1 + c0*c2 + c1*c2 + c0*c3 + c1*c3 + c2*c3 + c2, c1*c3 + c2*c3 + c1 + c2 + c3)
Confirmation:
sage: for z in F:
....: print([P[k](z.list()) for k in range(n)] == (z^3).list())
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True
True