Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Refactor point counting code for hyperelliptic curves.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Pierre Flori committed Sep 26, 2013
1 parent 86261b1 commit 55cdcf3
Show file tree
Hide file tree
Showing 2 changed files with 802 additions and 80 deletions.
22 changes: 5 additions & 17 deletions src/sage/schemes/generic/scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,23 +720,11 @@ def count_points(self, n):
if not q.is_prime():
raise NotImplementedError("Point counting only implemented for schemes over prime fields")
a = []
if q <= (2*self.genus()+1)*(2*self._frobenius_coefficient_bound() - 1) or n > 2*self.genus():
for i in range(1, n+1):
F1 = GF(q**i, name='z')
S1 = self.base_extend(F1)
a.append(len(S1.rational_points()))
else:
coeffs = self.frobenius_polynomial().coefficients()
coeffs.reverse()
S = [coeffs[1]]
a.append(q+1 + S[0])
for k in range(2, n+1):
res = 0
for i in range(1, k):
res = res + coeffs[i]*S[k-i-1]
S.append(k*coeffs[k] - res)
a.append(q**k + 1 + S[k-1])
return a
for i in range(1, n+1):
F1 = GF(q**i, name='z')
S1 = self.base_extend(F1)
a.append(len(S1.rational_points()))
return(a)

def zeta_series(self, n, t):
"""
Expand Down
Loading

0 comments on commit 55cdcf3

Please sign in to comment.