Skip to content

Commit 755f48b

Browse files
committed
add test for faster roots
1 parent a8d720e commit 755f48b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sage/rings/finite_rings/integer_mod_ring.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,15 @@ def _roots_univariate_polynomial(self, f, ring=None, multiplicities=True, algori
19111911
sage: R.<x> = Zmod(100)[]
19121912
sage: (x^2 - 1).roots(Zmod(99), multiplicities=False) == (x^2 - 1).change_ring(Zmod(99)).roots(multiplicities=False)
19131913
True
1914+
1915+
We can find roots of high degree polynomials in a reasonable time:
1916+
1917+
sage: set_random_seed(31337)
1918+
sage: p = random_prime(2^128)
1919+
sage: R.<x> = GF(p)[]
1920+
sage: f = R.random_element(degree=5000)
1921+
sage: f.roots(multiplicities=False)
1922+
[107295314027801680550847462044796892009, 75545907600948005385964943744536832524]
19141923
"""
19151924

19161925
# This function only supports roots in an IntegerModRing

0 commit comments

Comments
 (0)