@@ -2120,59 +2120,66 @@ cdef class FiniteField(Field):
2120
2120
python_int = int .from_bytes(input_bytes, byteorder = byteorder)
2121
2121
return self .from_integer(python_int)
2122
2122
2123
- def _roots_univariate_polynomial (self , f , ring , multiplicities , ** kwargs ):
2123
+ def _roots_univariate_polynomial (self , f , ring , multiplicities , algorithm = None ):
2124
2124
r """
2125
2125
Return the roots of the univariate polynomial ``f``.
2126
2126
2127
2127
INPUT:
2128
2128
2129
- - ``f`` - a polynomial defined over this field
2129
+ - ``f`` -- a polynomial defined over this field
2130
2130
2131
- - ``ring`` - the ring to find roots in.
2131
+ - ``ring`` -- the ring to find roots in.
2132
2132
2133
- - ``multiplicities`` - bool ( default: ``True``) . If ``True``, return
2133
+ - ``multiplicities`` -- bool ( default: ``True``) . If ``True``, return
2134
2134
list of pairs `( r, n) `, where `r` is a root and `n` is its
2135
2135
multiplicity. If ``False``, just return the unique roots, with no
2136
2136
information about multiplicities.
2137
2137
2138
- - ``kwargs `` - ignored
2138
+ - ``algorithm `` - - ignored
2139
2139
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) ]
2148
2150
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 ]
2156
2159
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 ]
2166
2170
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
2176
2183
2177
2184
K = f.base_ring()
2178
2185
L = K if ring is None else ring
0 commit comments