1 | def hyperoval(q): |
---|
2 | r""" |
---|
3 | Return an hyperoval in finite Desarguesian projective planes when q=2^n |
---|
4 | """ |
---|
5 | assert q%2==0 and is_prime_power(q) |
---|
6 | |
---|
7 | q2 = q*q |
---|
8 | K = FiniteField(q, 'x') |
---|
9 | zero = K.zero() |
---|
10 | one = K.one() |
---|
11 | K_to_int = {x:i for i,x in enumerate(K)} |
---|
12 | |
---|
13 | # affine plane are the points: K_to_int[x] + q*K_to_int[y] |
---|
14 | # the line at infinity : q2 + K_to_int[x] |
---|
15 | # the point at infinty : q2 + q |
---|
16 | |
---|
17 | # build the curve x**2 = yz |
---|
18 | oval = [K_to_int[x] + q*K_to_int[x**2] for x in K_to_int] |
---|
19 | oval.append(q2 + K_to_int[zero] + q*K_to_int[one]) |
---|
20 | |
---|
21 | # add the nucleus |
---|
22 | oval.append(K_to_int[zero]) |
---|
23 | |
---|
24 | return oval |
---|
25 | |
---|
26 | def is_arc(P, a): |
---|
27 | # build the dual |
---|
28 | a = set(a) |
---|
29 | for b in P.blocks(): |
---|
30 | if len(a.intersection(b)) > 2: |
---|
31 | return False |
---|
32 | return True |
---|
33 | |
---|
34 | |
---|
35 | def test(): |
---|
36 | for n in range(1,7): |
---|
37 | q = 2**n |
---|
38 | O = hyperoval(q) |
---|
39 | P = designs.DesarguesianProjectivePlaneDesign(q) |
---|
40 | assert is_arc(P,O) |
---|