Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241818 views
1
"""
2
Theta constants
3
"""
4
5
6
def _compute_theta_char_poly(char_dict, f):
7
r"""
8
Return the coefficient at ``f`` of the Siegel modular form
9
10
.. math:
11
12
\sum_{l \in\text{char_dict}} \alpha[l] * \prod_i \theta_l[i](8Z).
13
14
INPUT:
15
16
- ``char_dict`` -- a dictionary whose keys are *tuples* of theta
17
characteristics and whose values are in some ring.
18
- ``f`` -- a triple `(a,b,c)` of rational numbers such that the
19
quadratic form `[a,b,c]` is semi positive definite
20
(i.e. `a,c \geq 0` and `b^2-4ac \leq 0`).
21
22
EXAMPLES::
23
24
sage: from sage.modular.siegel.theta_constant import _multiply_theta_char
25
sage: from sage.modular.siegel.theta_constant import _compute_theta_char_poly
26
sage: theta_constants = {((1, 1, 0, 0), (0, 0, 1, 1), (1, 1, 0, 0), (0, 0, 1, 1)): 1}
27
sage: _compute_theta_char_poly(theta_constants, [2, 0, 10])
28
32
29
sage: _compute_theta_char_poly(theta_constants, [2, 0, 2])
30
8
31
sage: _compute_theta_char_poly(theta_constants, [0, 0, 0])
32
0
33
"""
34
return sum(_multiply_theta_char(list(l), f)*char_dict[l] for l in char_dict)
35
36
37
38
def _multiply_theta_char(l, f):
39
r"""
40
Return the coefficient at ``f`` of the theta series `\prod_t \theta_t`
41
where `t` runs through the list ``l`` of theta characteristics.
42
43
INPUT:
44
45
- ``l`` -- a list of quadruples `t` in `{0,1}^4`
46
- ``f`` -- a triple `(a,b,c)` of rational numbers such that the
47
quadratic form `[a,b,c]` is semi positive definite
48
(i.e. `a,c \geq 0` and `b^2-4ac \leq 0`).
49
50
EXAMPLES::
51
52
sage: from sage.modular.siegel.theta_constant import _multiply_theta_char
53
sage: from sage.modular.siegel.theta_constant import _compute_theta_char_poly
54
sage: tc = [(1, 1, 0, 0), (0, 0, 1, 1), (1, 1, 0, 0), (0, 0, 1, 1)]
55
sage: _multiply_theta_char(tc, [2, 0, 6])
56
-32
57
sage: _multiply_theta_char(tc, [2, 0, 10])
58
32
59
sage: _multiply_theta_char(tc, [0, 0, 0])
60
0
61
"""
62
if 0 == len(l):
63
return (1 if (0, 0, 0) == f else 0)
64
a, b, c = f
65
m1, m2, m3, m4 = l[0]
66
# if the characteristic is not even:
67
if 1 == (m1*m3 + m2*m4)%2:
68
return 0
69
coeff = 0
70
from sage.misc.all import isqrt, xsrange
71
for u in xsrange(m1, isqrt(a)+1, 2):
72
for v in xsrange(m2, isqrt(c)+1, 2):
73
if 0 == u and 0 == v:
74
coeff += _multiply_theta_char(l[1:], (a, b, c))
75
continue
76
ap, bp, cp = (a-u*u, b-2*u*v, c-v*v)
77
if bp*bp-4*ap*cp <= 0:
78
val = (2 if 0 == (u*m3 + v*m4)%4 else -2)
79
coeff += val * _multiply_theta_char(l[1:], (ap, bp, cp))
80
if u != 0 and v != 0:
81
ap, bp, cp = (a-u*u, b+2*u*v, c-v*v)
82
if bp*bp-4*ap*cp <= 0:
83
val = (2 if 0 == (u*m3 - v*m4)%4 else -2)
84
coeff += val * _multiply_theta_char(l[1:], (ap, bp, cp))
85
return coeff
86
87