Ask Your Question
0

Working with large finite fields of characteristic 2; how to coerce them?

asked 2025-06-23 16:18:26 +0200

anonymous user

Anonymous

Working over the prime field of size 2, I would like to define two high-degree extensions (say, each intermediate extension degree is 16, so that the total extension is of degree 256) which are also extensions of each other. Yet something seems to be going wrong with the coercion. The documentation found here seems to indicate that the coercion on generators should be automatic using Conway polynomials. It seems that even the prime field is not embedded in the extensions. Is the issue due to the large field sizes?

Of course this can be done with defining irreducible polynomials. The extension over the prime field can be easily found with tables, like this one, but this wouldn't always work for intermediate fields, and the process of finding defining polynomials by hand is obviously arduous.

sage: p = 2
sage: r = 2**4
sage: s = 2**4
sage: F_p = GF(p)
sage: F_r.<a> = GF(p**r); F_r
Finite Field in a of size 2^16
sage: F_s.<b> = GF(p**(r*s)); F_s
Finite Field in b of size 2^256
sage: F_p in F_r
False
sage: F_p in F_s
False
sage: F_r in F_s
False
sage: a + b
-----------------------------------------------------
TypeError: unsupported operand parent(s) for +: 'Finite Field in a of size 2^16' and 'Finite Field in b of size 2^256'
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2025-06-24 15:48:32 +0200

dan_fulea gravatar image

updated 2025-06-24 15:50:56 +0200

First of all that in does not translate (mathematically and/or pythonically) as an inclusion. The following works:

p, r, s, rs = 2, 16, 16, 256
Fp       = GF(p)
Fr.<a>  = GF(r)
Fs.<b>  = GF(s)
Frs.<c> = GF(rs)

Now we have some fields and ask for existent coercion maps.

sage: Fr.has_coerce_map_from(Fp)
True
sage: Fs.has_coerce_map_from(Fp)
True
sage: Frs.has_coerce_map_from(Fp)
True
sage: Frs.has_coerce_map_from(Fr)
False
sage: Frs.has_coerce_map_from(Fs)
False

Why False when false? Because for instance a is an element inside $\Bbb F_{16}=\Bbb F_2(a)$ and we do not have a canonical choice of it inside the field $\Bbb F_{256}$ realized as $\Bbb F_2(c)$. Explicitly, every root of the minimal polynomial of $a$ from the last field gives rise to a possible injection between fields, $\Bbb F_2(a)\to \Bbb F_2(c)$:

sage: a.minimal_polynomial().roots(ring=Frs)
[(c^6 + c^3 + c^2 + c, 1),
 (c^6 + c^3 + c^2 + c + 1, 1),
 (c^7 + c^4 + c^3, 1),
 (c^7 + c^4 + c^3 + 1, 1)]

So which coercion should sage or a friend chose for us?

Note: Posting as an Anonymous is possible, but the dialog suffers if there is a follow up...

For instance, which is here the question? How to coerce? Is it enough to work in the bigger field? (Thus defining $a$ as one of the root values above, and $b$ maybe an other one... Who knows?!)

edit flag offensive delete link more
1

answered 2025-06-24 10:18:05 +0200

tec gravatar image

Look like it works only with finite field omiting variable name.

sage: p=2
sage: r=16
sage: s=16
sage: F_p=GF(p)
sage: F_r=GF(p**r);F_r
Finite Field in z16 of size 2^16
sage: F_s=GF(p**(r*s));F_s
Finite Field in z256 of size 2^256
sage: F_p in F_r
False
sage: F_p in F_s
False
sage: F_r in F_s
False
sage: a,=F_r.gens()
sage: b,=F_s.gens()
sage: a+b
z256^253 + z256^251 + z256^248 + z256^246 + z256^243 + z256^239 + z256^236 + z256^235 + z256^234 + z256^233 + z256^231 + z256^229 + z256^226 + z256^225 + z256^223 + z256^222 + z256^220 + z256^218 + z256^215 + z256^213 + z256^211 + z256^210 + z256^209 + z256^206 + z256^205 + z256^203 + z256^202 + z256^199 + z256^195 + z256^192 + z256^191 + z256^190 + z256^185 + z256^182 + z256^180 + z256^179 + z256^176 + z256^175 + z256^172 + z256^170 + z256^169 + z256^167 + z256^165 + z256^163 + z256^162 + z256^161 + z256^160 + z256^156 + z256^155 + z256^153 + z256^151 + z256^150 + z256^149 + z256^148 + z256^145 + z256^144 + z256^143 + z256^141 + z256^139 + z256^138 + z256^135 + z256^133 + z256^131 + z256^127 + z256^126 + z256^123 + z256^122 + z256^120 + z256^119 + z256^118 + z256^116 + z256^114 + z256^113 + z256^110 + z256^107 + z256^105 + z256^101 + z256^99 + z256^96 + z256^94 + z256^92 + z256^91 + z256^88 + z256^84 + z256^79 + z256^78 + z256^75 + z256^73 + z256^72 + z256^68 + z256^66 + z256^64 + z256^61 + z256^59 + z256^58 + z256^56 + z256^54 + z256^52 + z256^50 + z256^46 + z256^43 + z256^42 + z256^40 + z256^36 + z256^35 + z256^33 + z256^31 + z256^29 + z256^22 + z256^21 + z256^20 + z256^19 + z256^14 + z256^9 + z256^8 + z256^7 + z256^6 + z256^4 + z256^2
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2025-06-23 16:18:26 +0200

Seen: 79 times

Last updated: Jun 24