Skip to content

Commit 49021a6

Browse files
committed
fix formatting in docstring && drop kwargs
1 parent f02f014 commit 49021a6

File tree

1 file changed

+45
-38
lines changed

1 file changed

+45
-38
lines changed

src/sage/rings/finite_rings/finite_field_base.pyx

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,59 +2120,66 @@ cdef class FiniteField(Field):
21202120
python_int = int.from_bytes(input_bytes, byteorder=byteorder)
21212121
return self.from_integer(python_int)
21222122

2123-
def _roots_univariate_polynomial(self, f, ring, multiplicities, **kwargs):
2123+
def _roots_univariate_polynomial(self, f, ring, multiplicities, algorithm=None):
21242124
r"""
21252125
Return the roots of the univariate polynomial ``f``.
21262126
21272127
INPUT:
21282128
2129-
- ``f`` - a polynomial defined over this field
2129+
- ``f`` -- a polynomial defined over this field
21302130
2131-
- ``ring`` - the ring to find roots in.
2131+
- ``ring`` -- the ring to find roots in.
21322132
2133-
- ``multiplicities`` - bool (default: ``True``). If ``True``, return
2133+
- ``multiplicities`` -- bool (default: ``True``). If ``True``, return
21342134
list of pairs `(r, n)`, where `r` is a root and `n` is its
21352135
multiplicity. If ``False``, just return the unique roots, with no
21362136
information about multiplicities.
21372137
2138-
- ``kwargs`` - ignored
2138+
- ``algorithm`` -- ignored
21392139
2140-
TESTS::
2141-
We can take the roots of a polynomial defined over a finite field
2142-
sage: set_random_seed(31337)
2143-
sage: p = random_prime(2^128)
2144-
sage: R.<x> = Zmod(p)[]
2145-
sage: f = R.random_element(degree=15)
2146-
sage: f.roots()
2147-
[(117558869610275297997958296126212805270, 1)]
2140+
TESTS:
2141+
2142+
We can take the roots of a polynomial defined over a finite field::
2143+
2144+
sage: set_random_seed(31337)
2145+
sage: p = random_prime(2^128)
2146+
sage: R.<x> = Zmod(p)[]
2147+
sage: f = R.random_element(degree=15)
2148+
sage: f.roots()
2149+
[(117558869610275297997958296126212805270, 1)]
21482150
2149-
We can take the roots of a polynomial defined over a finite field without multiplicities
2150-
sage: set_random_seed(31337)
2151-
sage: p = random_prime(2^128)
2152-
sage: R.<x> = Zmod(p)[]
2153-
sage: f = R.random_element(degree=150)
2154-
sage: f.roots(multiplicities=False)
2155-
[116560079209701720510648792531840294827]
2151+
We can take the roots of a polynomial defined over a finite field without multiplicities::
2152+
2153+
sage: set_random_seed(31337)
2154+
sage: p = random_prime(2^128)
2155+
sage: R.<x> = Zmod(p)[]
2156+
sage: f = R.random_element(degree=150)
2157+
sage: f.roots(multiplicities=False)
2158+
[116560079209701720510648792531840294827]
21562159
2157-
We can take the roots of a polynomial defined over a finite field extension
2158-
sage: set_random_seed(31337)
2159-
sage: F.<a> = GF((2, 10))
2160-
sage: R.<x> = F[]
2161-
sage: f = R.random_element(degree=10)
2162-
sage: f.roots()
2163-
[(a^9 + a^8 + a^6 + a^4 + a^2, 1)]
2164-
sage: f.roots(multiplicities=False)
2165-
[a^9 + a^8 + a^6 + a^4 + a^2]
2160+
We can take the roots of a polynomial defined over a finite field extension::
2161+
2162+
sage: set_random_seed(31337)
2163+
sage: F.<a> = GF((2, 10))
2164+
sage: R.<x> = F[]
2165+
sage: f = R.random_element(degree=10)
2166+
sage: f.roots()
2167+
[(a^9 + a^8 + a^6 + a^4 + a^2, 1)]
2168+
sage: f.roots(multiplicities=False)
2169+
[a^9 + a^8 + a^6 + a^4 + a^2]
21662170
2167-
We can take the roots of a high degree polynomial in a reasonable time
2168-
sage: set_random_seed(31337)
2169-
sage: p = random_prime(2^128)
2170-
sage: F = GF(p)
2171-
sage: R.<x> = F[]
2172-
sage: f = R.random_element(degree=10000)
2173-
sage: f.roots(multiplicities=False)
2174-
[65940671326230628578511607550463701471]
2175-
"""
2171+
We can take the roots of a high degree polynomial in a reasonable time::
2172+
2173+
sage: set_random_seed(31337)
2174+
sage: p = random_prime(2^128)
2175+
sage: F = GF(p)
2176+
sage: R.<x> = F[]
2177+
sage: f = R.random_element(degree=10000)
2178+
sage: f.roots(multiplicities=False)
2179+
[65940671326230628578511607550463701471]
2180+
"""
2181+
if algorithm is None:
2182+
raise NotImplementedError
21762183

21772184
K = f.base_ring()
21782185
L = K if ring is None else ring

0 commit comments

Comments
 (0)