-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhodge.sage
More file actions
390 lines (280 loc) · 8.95 KB
/
Copy pathhodge.sage
File metadata and controls
390 lines (280 loc) · 8.95 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
"""
hodge_numbers.sage
Author: J. Carlson
Date: March 28, 2013
URL: www.math.utah.edu/~carlson
Compute hodge numbers of hypersurfaces
in weighted projective spaces, and of cyclic covers.
For the latter, compute also the hodge numbers of the
eigenspaces of the covering automorphisms.
For examples, see the tests at the end of this file.
To load this package:
# sage: load('hodge_numbers.sage')
Then to ask for help/documentation:
# sage: hodge?
# sage: moduli?
The functions 'hodge' and 'moduli' are the
main functions in this module.
To run the tests, do this:
$ sage -t whodge.sage
"""
var('t')
def poincare_f(d,q):
return simplify((1-t^d)/(1-t^q))
def poincare_function(L):
"""
Poincare polynomial for a regular sequence where
L = [[d1, w1], [d2, w2], .. ] is a list of
degrees and weight
"""
p = 1
for pair in L:
a, b = pair
p = p*poincare_f(a,b)
return expand(p)
def jacobian_weights(d,W):
"""
jacobian_weights(d,W ) is the list of degrees and weights for
the regular sequence obtained from a weighted homogeneous
form of degree where W is the list of weights
"""
L = []
for weight in W:
L.append( [d-weight, weight] )
return L
def pj(d,W):
"""
pj(d,W) = Poincare polynomial for Jacobian ring of poly of degre d
"""
return poincare_function(jacobian_weights(d,W))
def moduli(d,w):
"""
moduli(d,w) is the dimension of the moduli space of hypersurfaces of degree d
w can be a list of weights, e.g., moduli(6, [1,2,3]), or it can be a number,
e.g., moduli(3,1).
In the first case, moduli(d,w) is the number of moduli of a hypersurface
of degree d in a weighted projective spaces with weights w.
In the second case, it is the number of moduli of a hypersurface of degree d
and dimension n.
Examples:
moduli(4,2) = 19 -- the number of moduli of quartic surfaces
moduli(4, [1,1,1,1]) = 19 -- as above
moduli(6, [1,1,3]) = 3 -- double coversof P^1 branched at six points
moduli(6, [1, 2, 3]) = 1 -- elliptic curves in weighted projective space
"""
if (type(w) == sage.rings.integer.Integer): # case of X of dim n in P^(n+1)
w = [1 for r in range(0,w+2)]
P = pj(d,w)
T = P.taylor(t,0,d+1)
return T.coefficient(t,d)
def HODGE(d,W,s=0):
"""
HODGE(d,W): return vector of Hodge numbers for hypersurfce
of degree d and weight vector W.
"""
P = pj(d,W) # Poincare polynomial
n = len(W) # number of homogeneous variables
vdeg = sum(W)
tdeg = (n+1)*d - vdeg + 1
T = P.taylor(t,0,tdeg)
H = [ ]
if s > 0: # KLUDGE / HACK
n = n + 1
for q in range(0,n-1):
c = T.coefficient(t,(q+1)*d - vdeg - s) # Hodge number h(p,q)
H.append(c)
return H
def hodge(d, w, k=0, i=0):
"""
hodge(d,n) = hodge vector for hypersurface of degree d and dimension n
hodge(d,W) = hodge vector for hypersurface of degree d and weight vector W
hodge(d,n,k) = hodge vector for k-to-1 cyclic cover of hypersurface
of degree d and dimension n.
hodge(d,n,k,i) = hodge vector for k-to-1 cyclic cover of P^n branched along
a hypersurface of degree d.
Examples:
hodge(4,2) = [1,19,1] -- K3 surface
hodge(4,[1,1,1,1]) = [1,19,1] -- as above
hodge(6, [1, 2, 3]) = [1,1] -- elliptic curves in P(1,2,3)
hodge(6,2,2) = [1,19,1] -- double covers of P^2 branched on a sextic curve
hodge(3,3,3) = [0, 5, 5, 0] -- cyclic cubic threefold: branched cover of P^3
hodge(3,3,3,1) = [0, 4, 1, 0] -- hodge numbers of an eigenspace of previous threefold
hodge(3,3,3,2) = [0, 1, 4, 0] -- the other eigenspace
hodge(12,[1,2,3], 2) = [1, 13, 1] -- double cover of P(1,2,3) branched along a curve of degree 12
"""
if (type(w) == sage.rings.integer.Integer): # we construct the weight vector
if k==0: # case of X of dim n in P^(n+1)
W = [1 for r in range(0,w+2)]
if k>0: # k-sheeted cyclic cover of P^n
W = [1 for r in range(0,w+1)]
W.append(d//k)
if i>0: # k-sheeted cyclic cover of P^n
W = [1 for r in range(0,w+1)]
i = i*(d//k)
else: # the weight vector is given
W = w
if (k > 0) & (i==0): # k-sheeted cyclic cover of P(w)
W.append(d/k)
if i > 0: # compute i-th eigenspace of covering automorphism
i = (d//k)*i
return HODGE(d,W,i)
def betti(d,n):
"""Dimension of middle cohomology group
for a hypersurface of degree d and dimenstion n.
"""
b = sum(hodge(d,n)) # primitive middel cohomology
if n % 2 == 1:
return b
else:
return b + 1
def euler_char(d,n):
"""Euler characteristic of a hypersuerface of degree n
and dimension n.
"""
if n == 0:
return d
else:
return d*(n+1 - euler_char(d,n-1)) + euler_char(d,n-1)
def dim_so(n):
"""
Dimension of special orthogonal group.
"""
return n*(n-1)//2
def dim_u(n):
"""
Dimension of the unitary group.
"""
return n*n
def dim_perdom(hv):
"""Complex dimension of a period domain with given Hodge vector. """
n = sum(hv)
if len(hv) == 3:
p,q,r = hv
dim = dim_so(n) - dim_u(p) - dim_so(q)
return dim//2
else:
return -1
def dim_horizontal(hv):
"""Complex dimension of horiziontal tangent bundle."""
n = sum(hv)
if len(hv) == 3:
p,q,r = hv
return p*q
else:
return -1
def dim_uherm(p,q):
"""Complex dimension of U(p,q)/U(p)xU(q)"""
dim = dim_u(p+q) - dim_u(p) - dim_u(q)
return dim//2
################################################################
#
# Abbreviations
#
################################################################
ech = euler_char
dim_h = dim_horizontal
################################################################
#
# TESTS AND EXAMPLES:
#
################################################################
r"""
################################################################
#
# Moduli
#
################################################################
sage: moduli(3, [1,1,1]) # moduli of cubic curves
1
sage: moduli(3, 1) # moduli of cubic curves
1
sage: moduli(4,2) # moduli of quartic surfaces
19
sage: moduli(4, [1,1,1,1]) # as above
19
sage: moduli(6, [1,1,3]) # double coversof P^1 branched at six points
3
sage: moduli(6, [1, 2, 3]) # elliptic curves in P(1,2,3)
1
################################################################
#
# Hodge numbers
#
################################################################
sage: hodge(3,[1,1,1]) # hodge numbers of a cubic curve
[1, 1]
sage: hodge(3,1) # hodge numbers of a cubic curve
[1, 1]
sage: hodge(4,[1,1,1,1]) # hodge numbers of a quartic surface
[1, 19, 1]
sage: hodge(4,2) # as above
[1, 19, 1]
sage: hodge(6, [1, 2, 3]) # elliptic curves in P(1,2,3)
[1, 1]
sage: hodge(6,2,2) # double covers of P^2 branched on a sextic curve
[1, 19, 1]
sage: hodge(3,3,3) # 3-sheeted cyclic cover of P^3
[0, 5, 5, 0]
sage: hodge(3,3,3,1) # cyclic cubic threefold
[0, 4, 1, 0]
sage: hodge(3,3,3,2) # cyclic cubic threefold
[0, 1, 4, 0]
sage: hodge(12,[1,2,3], 2) # double cover of P(1,2,3) branched along a curve of degree 12
[1, 13, 1]
sage: hodge(12,[1,2,3], 3) # triple cover of P(1,2,3) branched along a curve of degree 12
[2, 24, 2]
sage: hodge(12,[1,2,3],3,1) # as above, first eigenspace
[2, 12, 0]
sage: hodge(12,[1,2,3],3,2) # as above, second eigenspace
[0, 12, 2]
################################################################
#
# Topogy
#
################################################################
sage: betti(3,1) # cubic curve
2
sage: betti(4,2) # quartic surface
22
sage: euler_char(3,1) # cubic curve
0
sage: ech(3,1) # the same (^)
0
sage: ech(4,2) # 24 (XX: ALREADY?)
24
################################################################
#
# Period domains
#
################################################################
sage: dim_so(3)
3
sage: dim_so(2)
1
sage: dim_u(2)
4
sage: dim_u(1)
1
sage: dim_perdom([1,19,1])
19
sage: dim_perdom([2,3,2])
7
sage: dim_uherm(1,4)
4
################################################################
#
# Helper functions
#
################################################################
sage: poincare_f(4,2) # Poincare function
(t^4 - 1)/(t^2 - 1)
sage: jacobian_weights(4,[1,1,1])
[[3, 1], [3, 1], [3, 1]]
sage: jacobian_weights(6,[1,2,3])
[[5, 1], [4, 2], [3, 3]]
sage: pj(3,[1,1,1])
t^6/(t - 1)^3 - 3*t^4/(t - 1)^3 + 3*t^2/(t - 1)^3 - 1/(t - 1)^3
sage: pj(6,[1,2,3])
t^9/((t - 1)*(t^2 - 1)) - t^5/((t - 1)*(t^2 - 1)) - t^4/((t - 1)*(t^2 - 1)) + 1/((t - 1)*(t^2 - 1))
################################################################
"""