Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

r""" 

q-expansion of j-invariant 

""" 

from __future__ import absolute_import 

from .eis_series import eisenstein_series_qexp 

from .vm_basis import delta_qexp 

from sage.rings.all import QQ 

 

def j_invariant_qexp(prec=10, K=QQ): 

r""" 

Return the `q`-expansion of the `j`-invariant to 

precision ``prec`` in the field `K`. 

 

.. SEEALSO:: 

 

If you want to evaluate (numerically) the `j`-invariant at 

certain points, see the special function :func:`elliptic_j`. 

 

.. WARNING:: 

 

Stupid algorithm -- we divide by Delta, which is slow. 

 

EXAMPLES:: 

 

sage: j_invariant_qexp(4) 

q^-1 + 744 + 196884*q + 21493760*q^2 + 864299970*q^3 + O(q^4) 

sage: j_invariant_qexp(2) 

q^-1 + 744 + 196884*q + O(q^2) 

sage: j_invariant_qexp(100, GF(2)) 

q^-1 + q^7 + q^15 + q^31 + q^47 + q^55 + q^71 + q^87 + O(q^100) 

""" 

if prec <= -1: 

raise ValueError("the prec must be nonnegative.") 

prec += 2 

g6 = -504*eisenstein_series_qexp(6, prec, K=QQ) 

Delta = delta_qexp(prec).change_ring(QQ) 

j = (g6*g6) * (~Delta) + 1728 

if K != QQ: 

return j.change_ring(K) 

else: 

return j 

 

 

# NOTE: this needs to be sped up. The pari code src/basemath/trans3.c is 

# faster.