Shared2018-08-08-Gibbons.sagewsOpen in CoCalc
ZZ_7[i] stuff
#p = 7
#p = 11
p = 19
K = GF(p); K
# https://ask.sagemath.org/question/40568/quadratic-extension-field-of-a-finite-field/
#following these instructions we get what we want, woohoo!
R.<x> = PolynomialRing(K); R
F = K.extension(x^2+1,'i'); F
i = F.gens()[0]
Finite Field of size 19 Univariate Polynomial Ring in x over Finite Field of size 19 Finite Field in i of size 19^2
(2*i+1)^p
17*i + 1


# get the order of all the elements in F* in a terrible way
L = [] 
for a in F:
    for m in range(1,p^2+1):
        if a^m == 1:
            L.append([a,m])
            break
### get elts of order p+1
LL = []
for j in range (len(L)):
    if L[j][1] == p+1:
        LL.append(L[j][0])
LL  ### This misses half of the elements of order p+1 somehow, 
    ### but it looks like it doesn't really matter if you switch the real and imaginary parts? 
    ### I'm confused.
[12*i + 16, 2*i + 15, 2*i + 4, 12*i + 3, 7*i + 3, 17*i + 4, 17*i + 15, 7*i + 16]
len(L)
360 361
LLL = LL
for j in range (len(LL)):
    LLL.append(LL[j]*i)
LLL = uniq(LLL); LLL
[2*i + 4, 2*i + 15, 3*i + 7, 3*i + 12, 4*i + 2, 4*i + 17, 7*i + 3, 7*i + 16, 12*i + 3, 12*i + 16, 15*i + 2, 15*i + 17, 16*i + 7, 16*i + 12, 17*i + 4, 17*i + 15]
# test pairs... but first try to find them, ugh. I can't figure out how to isolate coefficients :\
LLL[0]*LLL[14]
LLL[1]*LLL[15]
LLL[2]*LLL[12]
LLL[3]*LLL[13]
LLL[4]*LLL[10]
LLL[5]*LLL[11]
LLL[6]*LLL[8]
LLL[7]*LLL[9]
1 1 1 1 1 1 1 1
#### IGNORE, this isn't working :( :( :(
# get the elements of F* of order 48
LLLL = [];
for j in range (len(L)):
    if L[j][1] == (p^2 - 1):
        LLLL.append(L[j][0])

LLLLL = [];
for j in range (len(LLLL)):
     LLLLL.append(LLLL[j]^(p-1))
set(LLLLL) ### still only picking up half :\
set([17*i + 4, 7*i + 3, 2*i + 4, 12*i + 3, 17*i + 15, 12*i + 16, 7*i + 16, 2*i + 15])