Skip to content

Commit 8eab62d

Browse files
committed
Add series precision for large p
1 parent 87923c2 commit 8eab62d

File tree

4 files changed

+179
-3
lines changed

4 files changed

+179
-3
lines changed

src/PrecisionEstimate.jl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,37 @@ function frobenius_precision(k, q)
2121
return r
2222
end
2323

24+
"""
25+
impreciselog(p,a)
26+
27+
log with any base, via the log rules,
28+
though I think there should be floating point error.
29+
"""
30+
impreciselog(p,a) = log(a) / log(p)
31+
32+
"""
33+
integral_basis_multiplier_bound(p,m,n)
34+
35+
Calculates the smallest integer t such that
36+
p^t* ω is in the integral latticee of the cohomology,
37+
for all ω in the griffiths-dwork basis of cohomology.
38+
Here, `m` is the pole order,
39+
and the bound we have depends only on p, m, and n.
40+
41+
This is called ϕ in Costa's thesis, and it is
42+
called f in Abbott-Kedlaya-Roe.
43+
This method implements theorem 3.4.6 only of
44+
Abbott-Kedlaya-Roe.
45+
"""
46+
function integral_basis_multiplier_bound(p,m,n)
47+
48+
sum = 0
49+
for i in 1:n
50+
sum += floor(Int,impreciselog(p,max(1,m-i)))
51+
end
52+
53+
sum
54+
end
2455

2556
"""
2657
calculate_relative_precision(HP, slope, hodge_numbers, weight, p)
@@ -67,6 +98,20 @@ function calculate_relative_precision(polygon, weight, p)
6798
return reverse(r_vector)
6899
end
69100

101+
function calculate_series_precision(p,n,r_m)
102+
103+
if p < 2*(n+1) + maximum(r_m)
104+
println("Unsupported p: $p. Returning nonsense.")
105+
return zeros(Int,n)
106+
end
107+
108+
# TODO update for small p
109+
N = [(r_m[i] == 0 ? 0 : n+1 + r_m[i] - (i+1)) for i in 1:n]
110+
111+
N
112+
end
113+
114+
70115
"""
71116
relative_precision()
72117

test/CurvesAndSurfaces.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ Data computed using Edgar Costa's `controlledreduction` library.
149149
function test_highergenus_1(p)
150150
n = 2
151151
d = 3
152-
series_precision = (4,4)
153-
abs_precision = 7
154152

155153
F = GF(p)
156154
R, (x,y,z) = polynomial_ring(F, ["x$i" for i in 0:n])

test/Precision.jl

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,125 @@ end
2020

2121
# TODO: copy of gpl license
2222

23-
function test_series_precision()
23+
function test_series_precision_example(p,n,d)
24+
r_m = DeRham.calculate_relative_precision(hodge_polygon(p,n,d),n-1,p)
25+
N = DeRham.calculate_series_precision(p,n,r_m)
2426

27+
if ( n == 2 && d == 3 )
28+
if ( p < 5)
29+
@test N == [2 3]
30+
elseif ( 5 <= p && p < 17 )
31+
@test N == [2,2]
32+
elseif ( 17 <= p )
33+
@test N == [0,1]
34+
end
35+
elseif ( n == 2 && d == 4 )
36+
if ( p < 5)
37+
@test N == [4,4]
38+
elseif ( 5 <= p && p < 17 )
39+
@test N == [3,3]
40+
elseif ( 17 <= p )
41+
@test N == [2,2]
42+
end
43+
elseif ( n == 2 && d == 5 )
44+
if ( p < 5)
45+
@test N == [6,6]
46+
elseif ( 5 <= p && p < 7 )
47+
@test N == [4,5]
48+
elseif ( 7 <= p )
49+
@test N == [4,4]
50+
end
51+
elseif ( n == 2 && d == 6 )
52+
if ( p < 5)
53+
@test N == [8,9]
54+
elseif ( 5 <= p && p < 7 )
55+
@test N == [7,7]
56+
elseif ( 7 <= p && p < 11 )
57+
@test N == [6,7]
58+
elseif ( 11 <= p )
59+
@test N == [6,6]
60+
end
61+
elseif ( n == 2 && d == 7 )
62+
if ( p < 5)
63+
@test N == [11,11]
64+
elseif ( 5 <= p && p < 7 )
65+
@test N == [10,10]
66+
elseif ( 7 <= p && p < 11 )
67+
@test N == [10,10]
68+
elseif ( 11 <= p && p < 17 )
69+
@test N == [9,9]
70+
elseif ( 17 <= p )
71+
@test N == [8,8]
72+
end
73+
elseif ( n == 2 && d == 8 )
74+
if ( p < 5)
75+
@test N == [14,14]
76+
elseif ( 5 <= p && p < 7 )
77+
@test N == [13,13]
78+
elseif ( 7 <= p && p < 13 )
79+
@test N == [13,13]
80+
elseif ( 13 <= p && p < 17 )
81+
@test N == [12,13]
82+
elseif ( 17 <= p )
83+
@test N == [11,11]
84+
end
85+
elseif ( n == 2 && d == 9 )
86+
if ( p < 5)
87+
@test N == [18,18]
88+
elseif ( 5 <= p && p < 7 )
89+
@test N == [16,16]
90+
elseif ( 7 <= p && p < 11 )
91+
@test N == [16,16]
92+
elseif ( 11 <= p && p < 17 )
93+
@test N == [16,16]
94+
elseif ( 17 <= p )
95+
@test N == [15,15]
96+
end
97+
elseif ( n == 3 && d == 4 )
98+
if ( p < 5)
99+
@test N == [7,7,8]
100+
elseif ( 5 <= p && p < 7 )
101+
@test N == [4,5,5]
102+
elseif ( 7 <= p && p < 23 )
103+
@test N == [4,4,3]
104+
elseif ( 23 <= p && p < 43 )
105+
@test N == [3,3,3]
106+
elseif ( 43 <= p )
107+
@test N == [3,3,2]
108+
end
109+
elseif ( n == 3 && d == 5 )
110+
if ( p < 5)
111+
@test N == [11,11,10]
112+
elseif ( 5 <= p && p < 7 )
113+
@test N == [8,8,9]
114+
elseif ( 7 <= p && p < 11 )
115+
@test N == [8,8,7]
116+
elseif ( 11 <= p && p < 23 )
117+
@test N == [7,7,6]
118+
elseif ( 23 <= p && p < 29 )
119+
@test N == [6,6,6]
120+
elseif ( 29 <= p )
121+
@test N == [6,6,5]
122+
end
123+
elseif ( n == 3 && d == 6 )
124+
if ( p < 5)
125+
@test N == [17,18,17]
126+
elseif ( 5 <= p && p < 7 )
127+
@test N == [15,15,14]
128+
elseif ( 7 <= p && p < 11 )
129+
@test N == [15,15,14]
130+
elseif ( 11 <= p && p < 17 )
131+
@test N == [14,14,13]
132+
elseif ( 17 <= p && p < 23 )
133+
@test N == [13,13,12]
134+
elseif ( 23 <= p )
135+
@test N == [12,12,11]
136+
end
137+
end
138+
25139
end
26140

141+
27142
function test_algorithm_precision_example(p,n,d)
28143

29144
r_m = DeRham.calculate_relative_precision(hodge_polygon(p,n,d),n-1,p)
@@ -183,9 +298,26 @@ function test_algorithm_precision()
183298
test_algorithm_precision_example(p,3,4)
184299
test_algorithm_precision_example(p,3,5)
185300
end
301+
end
186302

303+
function test_series_precision()
304+
#TODO: add the bound and fix for small p
305+
306+
# p = 11
307+
test_series_precision_example(11,2,3)
308+
test_series_precision_example(11,2,4)
309+
310+
# p = 13
311+
test_series_precision_example(13,2,3)
312+
test_series_precision_example(13,2,4)
313+
test_series_precision_example(13,2,5)
314+
315+
# k3 surfaces
316+
test_series_precision_example(11,3,4)
317+
test_series_precision_example(13,3,4)
187318
end
188319

320+
189321
function test_hodge_polygon_values()
190322
k3 = DeRham.SlopesPolygon([1,20,1])
191323

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ end
6969
test_hodge_polygon_values()
7070
test_hodge_polygon_examples()
7171
test_algorithm_precision()
72+
test_series_precision()
7273
end
7374

7475
#@testset "Elliptic curves" begin

0 commit comments

Comments
 (0)