Skip to content

Commit bcabe95

Browse files
author
Release Manager
committed
Trac #34723: elliptic_curves/hom_velusqrt.py: random test failure
Sage 9.7 on x86_64: {{{ sage -t --long --random-seed=190440690778015682984135421278300846991 /nix/store/jv3l7isa1hf4bjvf40lmrflzmyd696kz-sage- src-9.7/src/sage/schemes/elliptic_curves/hom_velusqrt.py ********************************************************************** File "/nix/store/jv3l7isa1hf4bjvf40lmrflzmyd696kz-sage- src-9.7/src/sage/schemes/elliptic_curves/hom_velusqrt.py", line 1089, in sage.schemes.elliptic_curves.hom_velusqrt.EllipticCurveHom_velusqrt._eva l Failed example: E, K = _random_example_for_testing() Exception raised: Traceback (most recent call last): File "/nix/store/g4h4aagj23nf3br90zn0545s8aqgbvxd- python3-3.10.8-env/lib/python3.10/site-packages/sage/doctest/forker.py", line 695, in _run self.compile_and_execute(example, compiler, test.globs) File "/nix/store/g4h4aagj23nf3br90zn0545s8aqgbvxd- python3-3.10.8-env/lib/python3.10/site-packages/sage/doctest/forker.py", line 1101, in compile_and_execute exec(compiled, globs) File "<doctest sage.schemes.elliptic_curves.hom_velusqrt.EllipticC urveHom_velusqrt._eval[16]>", line 1, in <module> E, K = _random_example_for_testing() File "/nix/store/g4h4aagj23nf3br90zn0545s8aqgbvxd- python3-3.10.8-env/lib/python3.10/site- packages/sage/schemes/elliptic_curves/hom_velusqrt.py", line 1225, in _random_example_for_testing assert K.order() == deg AssertionError }}} URL: https://trac.sagemath.org/34723 Reported by: gh-collares Ticket author(s): Lorenz Panny Reviewer(s): Frédéric Chapoton
2 parents 8e1b55b + 2402ce0 commit bcabe95

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sage/schemes/elliptic_curves/hom_velusqrt.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ def _random_example_for_testing():
13891389
sage: 5 <= K.order()
13901390
True
13911391
"""
1392-
from sage.all import prime_range, choice, randrange, GF, gcd
1392+
from sage.all import prime_range, choice, randrange, GF, lcm, Mod
13931393
while True:
13941394
p = choice(prime_range(2, 100))
13951395
e = randrange(1,5)
@@ -1411,9 +1411,10 @@ def _random_example_for_testing():
14111411
deg = choice(ds)
14121412
break
14131413
G = A.torsion_subgroup(deg)
1414+
os = G.generator_orders()
14141415
while True:
1415-
v = [randrange(deg) for _ in range(G.ngens())]
1416-
if gcd([deg] + v) == 1:
1416+
v = [randrange(o) for o in os]
1417+
if lcm(Mod(c,o).additive_order() for c,o in zip(v,os)) == deg:
14171418
break
14181419
K = G(v).element()
14191420
assert K.order() == deg

0 commit comments

Comments
 (0)