ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 06 Dec 2010 07:06:29 -0600subfields in finite fieldshttps://ask.sagemath.org/question/7778/subfields-in-finite-fields/Hello! I have another problem with finitefields. I create a field, for example, GF(103^2) and later I use an element from it, which will be also an element of the subfield GF(103), i.e. a=99 is an element of both GF(103) and GF(103^2). But then the program doesn't convert "a" to an element of GF(103)... Do you know a method for this? Mon, 06 Dec 2010 01:40:48 -0600https://ask.sagemath.org/question/7778/subfields-in-finite-fields/Comment by niles for <p>Hello! I have another problem with finitefields. I create a field, for example, GF(103^2) and later I use an element from it, which will be also an element of the subfield GF(103), i.e. a=99 is an element of both GF(103) and GF(103^2). But then the program doesn't convert "a" to an element of GF(103)... Do you know a method for this? </p>
https://ask.sagemath.org/question/7778/subfields-in-finite-fields/?comment=22455#post-id-22455can you update your question with a sample of the code you're using (and what fails to work)?Mon, 06 Dec 2010 02:01:57 -0600https://ask.sagemath.org/question/7778/subfields-in-finite-fields/?comment=22455#post-id-22455Answer by Mike Hansen for <p>Hello! I have another problem with finitefields. I create a field, for example, GF(103^2) and later I use an element from it, which will be also an element of the subfield GF(103), i.e. a=99 is an element of both GF(103) and GF(103^2). But then the program doesn't convert "a" to an element of GF(103)... Do you know a method for this? </p>
https://ask.sagemath.org/question/7778/subfields-in-finite-fields/?answer=11821#post-id-11821Sage does not try to automatically put elements in the smallest subfield that they belong to. You need to do that explicitly. You can use something like the line `g = P(f)` below which converts an element `f` from `GF(103^2)` to an element `g` of `GF(103)` :
sage: R.<a> = GF(103^2)
sage: P.<b> = GF(103)
sage: sage: f = R(99); f
99
sage: f.parent()
Finite Field in a of size 103^2
sage: g = P(f); g
99
sage: g.parent()
Finite Field of size 103
Mon, 06 Dec 2010 07:06:29 -0600https://ask.sagemath.org/question/7778/subfields-in-finite-fields/?answer=11821#post-id-11821