ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 15 Aug 2017 19:22:23 +0200How to list all elements of finite field (e.g., GF(2^5)) with trace 1.https://ask.sagemath.org/question/38520/how-to-list-all-elements-of-finite-field-eg-gf25-with-trace-1/ Note that trace is defined over finite field GF(2^n) as
Tr(x)=\sum_{ i=1}^{k} X^{2^{n-1}}.Mon, 14 Aug 2017 14:26:19 +0200https://ask.sagemath.org/question/38520/how-to-list-all-elements-of-finite-field-eg-gf25-with-trace-1/Comment by vdelecroix for <p>Note that trace is defined over finite field GF(2^n) as
Tr(x)=\sum_{ i=1}^{k} X^{2^{n-1}}.</p>
https://ask.sagemath.org/question/38520/how-to-list-all-elements-of-finite-field-eg-gf25-with-trace-1/?comment=38522#post-id-38522What did you try? Do you know how to list all elements of GF(2^5) in SageMath?Mon, 14 Aug 2017 19:51:20 +0200https://ask.sagemath.org/question/38520/how-to-list-all-elements-of-finite-field-eg-gf25-with-trace-1/?comment=38522#post-id-38522Comment by dan_fulea for <p>Note that trace is defined over finite field GF(2^n) as
Tr(x)=\sum_{ i=1}^{k} X^{2^{n-1}}.</p>
https://ask.sagemath.org/question/38520/how-to-list-all-elements-of-finite-field-eg-gf25-with-trace-1/?comment=38536#post-id-38536The lines
sage: K.<a> = GF( 2^5 )
sage: K
Finite Field in a of size 2^5
initialize the field $K$. Since the generator $a$ has minimal polynomial
sage: a.minpoly()
x^5 + x^2 + 1
its trace, resp. norm are unsurprisingly (coefficients in degrees four and zero)
sage: a.trace()
0
sage: a.norm()
1
The list of the elements of **norm** one can be computed by list comprehension, just take a glance at:
sage: [ x for x in K if x.norm() == 1 ]
and the mathematical version of it:
$$\{ \ x \ : \ x\in K\text{ with norm}(x) = 1\ \}\ .$$
Which is the command line for the list of elements of trace one in $K$?
How many elements of trace one are in $K$?
How many elements of norm one are in $K$?Tue, 15 Aug 2017 19:22:23 +0200https://ask.sagemath.org/question/38520/how-to-list-all-elements-of-finite-field-eg-gf25-with-trace-1/?comment=38536#post-id-38536