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

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

r""" 

Run difficult calculations that test the modular forms 

functionality. 

 

There is currently no good system for timing these doctests across 

all platforms, so I am turning these all into comments (so that they 

are not counted against are doctest coverage), noting that we should 

use these when (if?) we one day have a good regression testing 

system in place. 

 

Craig Citro 

 

 

from sage.all import * 

 

m=0; t=0; tw=0 

 

def pre(): 

global m, t, tw 

m = get_memory_usage() 

t = cputime() 

tw = walltime() 

 

 

def post(): 

global m,t 

print("total time: %s (wall: %.2f); memory usage diff: %sMB"%(cputime(t), 

walltime(tw), get_memory_usage() - m)) 

 

def test1(): 

pre() 

for N in range(1,75): 

M = ModularForms(N,2) 

print(M) 

print(M.basis()) 

post() 

 

def test2(): 

pre() 

for N in range(1,30): 

M = ModularForms(Gamma1(N),2) 

print(M) 

print(M.basis()) 

post() 

 

def test3(): 

pre() 

for k in range(2,100): 

M = ModularForms(1,k) 

print(M) 

print(M.basis()) 

post() 

 

def test4(): 

pre() 

for N in range(1,30): 

M = ModularForms(N,4, prec=20) 

print(M) 

print(M.basis()) 

post() 

 

def test5(): 

pre() 

for N in range(1,50): 

M = ModularForms(N,2, prec=30) 

print(M) 

print(M.basis()) 

post() 

 

def test6(): 

pre() 

for N in range(225,230): 

M = ModularForms(N,2,prec=40) 

print(M) 

print(M.basis()) 

post() 

 

def test7(): 

pre() 

for k in range(2,30): 

M = ModularForms(2,k) 

print(M) 

print(M.basis()) 

post() 

 

def test8(): 

pre() 

for k in range(2,20): 

M = ModularForms(Gamma1(3),k) 

print(M) 

print(M.basis()) 

post() 

 

def test9(): 

pre() 

for k in range(2,11): 

M = ModularForms(Gamma1(8),k) 

M.set_precision(M.dimension()+2) 

print(M) 

print(M.basis()) 

post() 

 

def test10(): 

pre() 

for k in range(2,11): 

M = ModularForms(k,k) 

M.set_precision(M.dimension()+2) 

print(M) 

print(M.basis()) 

post() 

 

def test11(): 

pre() 

for i in range(100): 

M = ModularForms(randint(1,100),randint(2,6)) 

print(M) 

print(M.basis()) 

post() 

 

def test12(): 

S = CuspForms(23,2) 

print(S) 

print(S.hecke_operator(2)) 

print(S.hecke_operator(2).matrix()) 

"""