Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 20b3d04

Browse files
committed
one more test and a try in charpoly
1 parent b1e0f99 commit 20b3d04

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

src/sage/schemes/cyclic_covers/charpoly_frobenius.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
r"""
2+
3+
Computation of the Frobenius polynomial using Newton's identities
4+
5+
"""
6+
7+
18
# *****************************************************************************
29
# Copyright (C) 2018 Edgar Costa <[email protected]>
310
# Distributed under the terms of the GNU General Public License (GPL)
@@ -186,7 +193,11 @@ def charpoly_frobenius(frob_matrix, charpoly_prec, p, weight, a=1, known_factor=
186193
187194
"""
188195
assert known_factor[-1] == 1
189-
cp = frob_matrix.change_ring(ZZ).charpoly().list()
196+
try:
197+
cp = frob_matrix.change_ring(ZZ).charpoly().list()
198+
except ValueError:
199+
# the given matrix wasn't integral
200+
cp = frob_matrix.charpoly().change_ring(ZZ).list()
190201
assert len(charpoly_prec) == len(cp) - (len(known_factor) - 1)
191202
assert cp[-1] == 1
192203

src/sage/schemes/cyclic_covers/cycliccover_finite_field.py

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
r"""
2+
23
Cyclic covers over a finite field
34
5+
The most interesting feature is computation of Frobenius matrix on
6+
Monsky-Washnitzer cohomology and the Frobenius polynomial.
7+
8+
REFERENCES::
9+
- [ABCMT2019]_
10+
411
EXAMPLES::
512
613
sage: p = 13
@@ -52,7 +59,7 @@
5259
# *****************************************************************************
5360
# Copyright (C) 2018 Vishal Arul <[email protected]>,
5461
# Alex Best <[email protected]>,
55-
# Edgar Costa <[email protected].edu>,
62+
# Edgar Costa <edgarc@mit.edu>,
5663
# Richard Magner <[email protected]>,
5764
# Nicholas Triantafillou <[email protected]>
5865
# Distributed under the terms of the GNU General Public License (GPL)
@@ -1054,6 +1061,7 @@ def _frobenius_matrix_p(N0):
10541061

10551062
self._init_frob(N)
10561063
FrobP = _frobenius_matrix_p(self._N0)
1064+
assert N == self._N0 or N is None
10571065
if self._n == 1:
10581066
return FrobP
10591067
else:
@@ -1064,6 +1072,7 @@ def _frobenius_matrix_p(N0):
10641072
[[entry.frobenius() for entry in row] for row in current]
10651073
)
10661074
total = total * current
1075+
total = matrix([[elt.add_bigoh(self._N0) for elt in row] for row in total])
10671076
return total
10681077

10691078
@cached_method
@@ -1073,7 +1082,6 @@ def frobenius_polynomial(self):
10731082
10741083
EXAMPLES:
10751084
1076-
10771085
Hyperelliptic curves::
10781086
10791087
sage: p = 11
@@ -1173,6 +1181,34 @@ def frobenius_polynomial(self):
11731181
x^12 + 299994*x^10 + 37498500015*x^8 + 2499850002999980*x^6 + 93742500224997000015*x^4 + 1874812507499850001499994*x^2 + 15623125093747500037499700001
11741182
11751183
1184+
TESTS::
1185+
1186+
sage: for _ in range(5): # long time
1187+
....: fail = False
1188+
....: p = random_prime(500, lbound=5)
1189+
....: for i in range(1, 4):
1190+
....: F = GF(p**i)
1191+
....: Fx = PolynomialRing(F, 'x')
1192+
....: b = F.random_element()
1193+
....: while b == 0:
1194+
....: b = F.random_element()
1195+
....: E = EllipticCurve(F, [0, b])
1196+
....: C1 = CyclicCover(3, Fx([-b, 0, 1]))
1197+
....: C2 = CyclicCover(2, Fx([b, 0, 0, 1]))
1198+
....: frob = [elt.frobenius_polynomial() for elt in [E, C1, C2]]
1199+
....: if len(set(frob)) != 1:
1200+
....: E
1201+
....: C1
1202+
....: C2
1203+
....: frob
1204+
....: fail = True
1205+
....: break
1206+
....: if fail:
1207+
....: break
1208+
....: else:
1209+
....: True
1210+
True
1211+
11761212
11771213
"""
11781214
self._init_frob()

0 commit comments

Comments
 (0)