25
25
from .drinfeld_module import DrinfeldModule
26
26
27
27
from sage .rings .integer_ring import ZZ
28
+ from sage .rings .infinity import Infinity
28
29
29
30
from sage .misc .cachefunc import cached_method
30
31
from sage .misc .lazy_import import lazy_import
31
32
32
33
lazy_import ('sage.rings.lazy_series_ring' , 'LazyPowerSeriesRing' )
34
+ lazy_import ('sage.rings.power_series_ring' , 'PowerSeriesRing' )
33
35
34
36
35
37
class DrinfeldModule_charzero (DrinfeldModule ):
@@ -149,7 +151,7 @@ def _compute_coefficient_exp(self, k):
149
151
c += self ._compute_coefficient_exp (i )* self ._compute_coefficient_log (j )** (q ** i )
150
152
return - c
151
153
152
- def exponential (self , name = 'z' ):
154
+ def exponential (self , prec = Infinity , name = 'z' ):
153
155
r"""
154
156
Return the exponential of this Drinfeld module.
155
157
@@ -158,28 +160,38 @@ def exponential(self, name='z'):
158
160
159
161
INPUT:
160
162
163
+ - ``prec`` -- an integer or ``Infinity`` (default: ``Infinity``);
164
+ the precision at which the series is returned; if ``Infinity``,
165
+ a lazy power series in returned, else, a classical power series
166
+ is returned.
167
+
161
168
- ``name`` -- string (default: ``'z'``); the name of the
162
169
generator of the lazy power series ring
163
170
164
- OUTPUT: a lazy power series over the base field
165
-
166
171
EXAMPLES::
167
172
168
173
sage: A = GF(2)['T']
169
174
sage: K.<T> = Frac(A)
170
175
sage: phi = DrinfeldModule(A, [T, 1])
171
176
sage: q = A.base_ring().cardinality()
172
- sage: exp = phi.exponential(); exp
173
- z + ((1/(T^2+T))*z^2) + ((1/(T^8+T^6+T^5+T^3))*z^4) + O(z^8)
174
177
175
- The exponential is returned as a lazy power series, meaning that
176
- any of its coefficients can be computed on demands::
178
+ When ``prec`` is ``Infinity`` (which is the default),
179
+ the exponential is returned as a lazy power series, meaning
180
+ that any of its coefficients can be computed on demands::
177
181
182
+ sage: exp = phi.exponential(); exp
183
+ z + ((1/(T^2+T))*z^2) + ((1/(T^8+T^6+T^5+T^3))*z^4) + O(z^8)
178
184
sage: exp[2^4]
179
185
1/(T^64 + T^56 + T^52 + ... + T^27 + T^23 + T^15)
180
186
sage: exp[2^5]
181
187
1/(T^160 + T^144 + T^136 + ... + T^55 + T^47 + T^31)
182
188
189
+ On the contrary, when ``prec`` is a finite number, all the
190
+ required coefficients are computed at once::
191
+
192
+ sage: phi.exponential(prec=10)
193
+ z + (1/(T^2 + T))*z^2 + (1/(T^8 + T^6 + T^5 + T^3))*z^4 + (1/(T^24 + T^20 + T^18 + T^17 + T^14 + T^13 + T^11 + T^7))*z^8 + O(z^10)
194
+
183
195
Example in higher rank::
184
196
185
197
sage: A = GF(5)['T']
@@ -216,7 +228,6 @@ def exponential(self, name='z'):
216
228
See section 4.6 of [Gos1998]_ for the definition of the
217
229
exponential.
218
230
"""
219
- L = LazyPowerSeriesRing (self ._base , name )
220
231
zero = self ._base .zero ()
221
232
q = self ._Fq .cardinality ()
222
233
@@ -228,7 +239,12 @@ def coeff_exp(k):
228
239
return self ._compute_coefficient_exp (v )
229
240
else :
230
241
return zero
231
- return L (coeff_exp , valuation = 1 )
242
+
243
+ if prec is Infinity :
244
+ L = LazyPowerSeriesRing (self ._base , name )
245
+ return L (coeff_exp , valuation = 1 )
246
+ L = PowerSeriesRing (self ._base , name , default_prec = prec )
247
+ return L ([0 ] + [coeff_exp (i ) for i in range (1 ,prec )], prec = prec )
232
248
233
249
@cached_method
234
250
def _compute_coefficient_log (self , k ):
@@ -264,7 +280,7 @@ def _compute_coefficient_log(self, k):
264
280
c += self ._compute_coefficient_log (i )* self ._gen [j ]** (q ** i )
265
281
return c / (T - T ** (q ** k ))
266
282
267
- def logarithm (self , name = 'z' ):
283
+ def logarithm (self , prec = Infinity , name = 'z' ):
268
284
r"""
269
285
Return the logarithm of the given Drinfeld module.
270
286
@@ -275,27 +291,36 @@ def logarithm(self, name='z'):
275
291
276
292
INPUT:
277
293
294
+ - ``prec`` -- an integer or ``Infinity`` (default: ``Infinity``);
295
+ the precision at which the series is returned; if ``Infinity``,
296
+ a lazy power series in returned
297
+
278
298
- ``name`` -- string (default: ``'z'``); the name of the
279
299
generator of the lazy power series ring
280
300
281
- OUTPUT: a lazy power series over the base field
282
-
283
301
EXAMPLES::
284
302
285
303
sage: A = GF(2)['T']
286
304
sage: K.<T> = Frac(A)
287
305
sage: phi = DrinfeldModule(A, [T, 1])
288
- sage: log = phi.logarithm(); log
289
- z + ((1/(T^2+T))*z^2) + ((1/(T^6+T^5+T^3+T^2))*z^4) + O(z^8)
290
306
291
- The logarithm is returned as a lazy power series, meaning that
292
- any of its coefficients can be computed on demands::
307
+ When ``prec`` is ``Infinity`` (which is the default),
308
+ the logarithm is returned as a lazy power series, meaning
309
+ that any of its coefficients can be computed on demands::
293
310
311
+ sage: log = phi.logarithm(); log
312
+ z + ((1/(T^2+T))*z^2) + ((1/(T^6+T^5+T^3+T^2))*z^4) + O(z^8)
294
313
sage: log[2^4]
295
314
1/(T^30 + T^29 + T^27 + ... + T^7 + T^5 + T^4)
296
315
sage: log[2^5]
297
316
1/(T^62 + T^61 + T^59 + ... + T^8 + T^6 + T^5)
298
317
318
+ If ``prec`` is a finite number, all the
319
+ required coefficients are computed at once::
320
+
321
+ sage: phi.logarithm(prec=10)
322
+ z + (1/(T^2 + T))*z^2 + (1/(T^6 + T^5 + T^3 + T^2))*z^4 + (1/(T^14 + T^13 + T^11 + T^10 + T^7 + T^6 + T^4 + T^3))*z^8 + O(z^10)
323
+
299
324
Example in higher rank::
300
325
301
326
sage: A = GF(5)['T']
@@ -317,7 +342,6 @@ def logarithm(self, name='z'):
317
342
sage: log[2**3] == -1/((T**q - T)*(T**(q**2) - T)*(T**(q**3) - T)) # expected value
318
343
True
319
344
"""
320
- L = LazyPowerSeriesRing (self ._base , name )
321
345
q = self ._Fq .cardinality ()
322
346
323
347
def coeff_log (k ):
@@ -328,7 +352,12 @@ def coeff_log(k):
328
352
return self ._compute_coefficient_log (v )
329
353
else :
330
354
return self ._base .zero ()
331
- return L (coeff_log , valuation = 1 )
355
+
356
+ if prec is Infinity :
357
+ L = LazyPowerSeriesRing (self ._base , name )
358
+ return L (coeff_log , valuation = 1 )
359
+ L = PowerSeriesRing (self ._base , name , default_prec = prec )
360
+ return L ([0 ] + [coeff_log (i ) for i in range (1 , prec )], prec = prec )
332
361
333
362
@cached_method
334
363
def _compute_goss_polynomial (self , n , q , poly_ring , X ):
0 commit comments