1 | //////////////////////////////////////////////////////////////// |
---|
2 | version = "version goettsche.lib 4.1.1.0 Sep_2017 "; // $Id$ |
---|
3 | category = "Betti numbers"; |
---|
4 | info=" |
---|
5 | LIBRARY: goettsche.lib Drezet's formula for the Betti numbers of the moduli space |
---|
6 | of Kronecker modules, |
---|
7 | Goettsche's formula for the Betti numbers of the Hilbert scheme |
---|
8 | of points on a surface, |
---|
9 | Macdonald's formula for the symmetric product |
---|
10 | |
---|
11 | AUTHOR: Oleksandr Iena, o.g.yena@gmail.com |
---|
12 | |
---|
13 | REFERENCES: |
---|
14 | [1] Drezet, Jean-Marc Cohomologie des varie'te's de modules de hauter nulle. |
---|
15 | Mathematische Annalen: 281, 43-85, (1988). |
---|
16 | |
---|
17 | [2] Goettsche, Lothar, The Betti numbers of the Hilbert scheme of ponts |
---|
18 | on a smooth projective surface. |
---|
19 | Mathematische Annalen: 286, 193-208, (1990). |
---|
20 | |
---|
21 | [3] Macdonald, I. G., The Poincare polynomial of a symmetric product, |
---|
22 | Mathematical proceedings of the Cambridge Philosophical Society: |
---|
23 | 58, 563 - 568, (1962). |
---|
24 | |
---|
25 | PROCEDURES: |
---|
26 | GoettscheF(z, t, n, b); The Goettsche's formula up to n-th degree |
---|
27 | PPolyH(z, n, b); Poincare Polynomial of the Hilbert scheme of n points on a surface |
---|
28 | BettiNumsH(n, b); Betti numbers of the Hilbert scheme of n points on a surface |
---|
29 | MacdonaldF(z, t, n, b); The Macdonald's formula up to n-th degree |
---|
30 | PPolyS(z, n, b); Poincare Polynomial of the n-th symmetric power of a variety |
---|
31 | BettiNumsS(n, b); Betti numbers of the n-th symmetric power of a variety |
---|
32 | PPolyN(t, q, m, n); Poincare Polynomial of the moduli space |
---|
33 | of Kronecker modules N (q; m, n) |
---|
34 | BettiNumsN(q, m, n); Betti numbers of the moduli space |
---|
35 | of Kronecker modules N (q; m, n) |
---|
36 | |
---|
37 | KEYWORDS: betti number; Goettsche's formula; Macdonald's formula;Kronecker modules |
---|
38 | "; |
---|
39 | //---------------------------------------------------------- |
---|
40 | |
---|
41 | proc GoettscheF(poly z, poly t, int n, list b) |
---|
42 | "USAGE: GoettscheF(z, t, n, b); z, t polynomials, n integer, b list of non-negative integers |
---|
43 | RETURN: polynomial in z and t |
---|
44 | PURPOSE: computes the Goettsche's formula up to degree n in t |
---|
45 | EXAMPLE: example GoettscheF; shows an example |
---|
46 | NOTE: zero is returned if n<0 or b is not a list of non-negative integers |
---|
47 | or if there are not enough Betti numbers |
---|
48 | " |
---|
49 | { |
---|
50 | // check the input data |
---|
51 | if( !checkBetti(b) ) |
---|
52 | { |
---|
53 | print("the Betti numbers must be non-negative integers"); |
---|
54 | print("zero polynomial is returned"); |
---|
55 | return( poly(0) ); |
---|
56 | } |
---|
57 | if(n<0) |
---|
58 | { |
---|
59 | print("the number of points must be non-negative"); |
---|
60 | print("zero polynomial is returned"); |
---|
61 | return( poly(0) ); |
---|
62 | } |
---|
63 | // now is non-negative and b is a list of non-negative integers |
---|
64 | if(size(b) < 5) // if there are not enough Betti numbers |
---|
65 | { |
---|
66 | print("a surface must habe 5 Betti numbers b_0, b_1, b_2, b_3, b_4"); |
---|
67 | print("zero polynomial is returned"); |
---|
68 | return( poly(0) ); |
---|
69 | } |
---|
70 | // now there are at least 5 non-negative Betti numbers b_0, b_1, b_2, b_3, b_4 |
---|
71 | def br@=basering; // remember the base ring |
---|
72 | // add additional variables z@, t@ to the base ring |
---|
73 | execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;" ); |
---|
74 | execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings |
---|
75 | // compute the generating function by the Goettsche's formula up to degree n in t@ |
---|
76 | poly rez=1; |
---|
77 | int k,i; |
---|
78 | ideal I=std(t@^(n+1)); |
---|
79 | for(k=1;k<=n;k++) |
---|
80 | { |
---|
81 | for(i=0;i<=4;i++) |
---|
82 | { |
---|
83 | rez=NF( rez*generFactor( z@^(2*k-2+i)*t@^k, k, i, b[i+1], n), I); |
---|
84 | } |
---|
85 | } |
---|
86 | setring br@; // come back to the initial base ring |
---|
87 | // define the specialization homomorphism z@=z, t@=t |
---|
88 | execute( "map FF= r@,"+varstr(br@)+", z, t;" ); |
---|
89 | poly rez=FF(rez); // bring the result to the base ring |
---|
90 | return(rez); |
---|
91 | } |
---|
92 | example |
---|
93 | { |
---|
94 | "EXAMPLE:"; echo=2; |
---|
95 | ring r=0, (t, z), ls; |
---|
96 | // consider the projective plane with Betti numbers 1,0,1,0,1 |
---|
97 | list b=1,0,1,0,1; |
---|
98 | // get the Goettsche's formula up to degree 3 |
---|
99 | print( GoettscheF(z, t, 3, b) ); |
---|
100 | } |
---|
101 | //---------------------------------------------------------- |
---|
102 | |
---|
103 | proc PPolyH(poly z, int n, list b) |
---|
104 | "USAGE: PPolyH(z, n, b); z polynomial, n integer, b list of non-negative integers |
---|
105 | RETURN: polynomial in z |
---|
106 | PURPOSE: computes the Poincare polynomial of the Hilbert scheme |
---|
107 | of n points on a surface with Betti numbers b |
---|
108 | EXAMPLE: example PPolyH; shows an example |
---|
109 | NOTE: zero is returned if n<0 or b is not a list of non-negative integers |
---|
110 | or if there are not enough Betti numbers |
---|
111 | " |
---|
112 | { |
---|
113 | // check the input data |
---|
114 | if( !checkBetti(b) ) |
---|
115 | { |
---|
116 | print("the Betti numbers must be non-negative integers"); |
---|
117 | print("zero polynomial is returned"); |
---|
118 | return( poly(0) ); |
---|
119 | } |
---|
120 | if(n<0) |
---|
121 | { |
---|
122 | print("the number of points must be non-negative"); |
---|
123 | print("zero polynomial is returned"); |
---|
124 | return( poly(0) ); |
---|
125 | } |
---|
126 | // now is non-negative and b is a list of non-negative integers |
---|
127 | if(size(b) < 5) // if there are not enough Betti numbers |
---|
128 | { |
---|
129 | print("a surface must habe 5 Betti numbers b_0, b_1, b_2, b_3, b_4"); |
---|
130 | print("zero polynomial is returned"); |
---|
131 | return( poly(0) ); |
---|
132 | } |
---|
133 | // now there are at least 5 non-negative Betti numbers b_0, b_1, b_2, b_3, b_4 |
---|
134 | def br@=basering; // remember the base ring |
---|
135 | // add additional variables z@, t@ to the base ring |
---|
136 | execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;" ); |
---|
137 | execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings |
---|
138 | // compute the generating function by the Goettsche's formula up to degree n in t@ |
---|
139 | poly rez=1; |
---|
140 | int k,i; |
---|
141 | ideal I=std(t@^(n+1)); |
---|
142 | for(k=1;k<=n;k++) |
---|
143 | { |
---|
144 | for(i=0;i<=4;i++) |
---|
145 | { |
---|
146 | rez=NF(rez*generFactor( z@^(2*k-2+i)*t@^k, k, i, b[i+1], n), I); |
---|
147 | } |
---|
148 | } |
---|
149 | rez= coeffs(rez, t@)[n+1, 1]; // take the coefficient of the n-th power of t@ |
---|
150 | setring br@; // come back to the initial base ring |
---|
151 | // define the specialization homomorphism z@=z, t@=0 |
---|
152 | execute( "map FF= r@,"+varstr(br@)+",z, 0;" ); |
---|
153 | poly rez=FF(rez); // bring the result to the base ring |
---|
154 | return(rez); |
---|
155 | } |
---|
156 | example |
---|
157 | { |
---|
158 | "EXAMPLE:"; echo=2; |
---|
159 | ring r=0, (z), ls; |
---|
160 | // consider the projective plane P_2 with Betti numbers 1,0,1,0,1 |
---|
161 | list b=1,0,1,0,1; |
---|
162 | // get the Poincare polynomial of the Hilbert scheme of 3 points on P_2 |
---|
163 | print( PPolyH(z, 3, b) ); |
---|
164 | } |
---|
165 | //---------------------------------------------------------- |
---|
166 | |
---|
167 | proc BettiNumsH(int n, list b) |
---|
168 | "USAGE: BettiNumsH(n, b); n integer, b list of non-negative integers |
---|
169 | RETURN: list of non-negative integers |
---|
170 | PURPOSE: computes the Betti numbers of the Hilbert scheme |
---|
171 | of n points on a surface with Betti numbers b |
---|
172 | EXAMPLE: example BettiNumsH; shows an example |
---|
173 | NOTE: an empty list is returned if n<0 or b is not a list of non-negative integers |
---|
174 | or if there are not enough Betti numbers |
---|
175 | " |
---|
176 | { |
---|
177 | // check the input data |
---|
178 | if( !checkBetti(b) ) |
---|
179 | { |
---|
180 | print("the Betti numbers must be non-negative integers"); |
---|
181 | print("an empty list is returned"); |
---|
182 | return( list() ); |
---|
183 | } |
---|
184 | if(n<0) |
---|
185 | { |
---|
186 | print("the number of points must be non-negative"); |
---|
187 | print("an empty list is returned"); |
---|
188 | return(list()); |
---|
189 | } |
---|
190 | // now is non-negative and b is a list of non-negative integers |
---|
191 | if(size(b) < 5) // if there are not enough Betti numbers |
---|
192 | { |
---|
193 | print("a surface must habe 5 Betti numbers b_0, b_1, b_2, b_3, b_4"); |
---|
194 | print("an empty list is returned"); |
---|
195 | return( list() ); |
---|
196 | } |
---|
197 | // now there are at least 5 non-negative Betti numbers b_0, b_1, b_2, b_3, b_4 |
---|
198 | def br@=basering; // remember the base ring |
---|
199 | // add additional variables z@, t@ to the base ring |
---|
200 | execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;" ); |
---|
201 | execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings |
---|
202 | poly rez=1; |
---|
203 | int k,i; |
---|
204 | ideal I=std(t@^(n+1)); |
---|
205 | for(k=1;k<=n;k++) |
---|
206 | { |
---|
207 | for(i=0;i<=4;i++) |
---|
208 | { |
---|
209 | rez=NF(rez*generFactor( z@^(2*k-2+i)*t@^k, k, i, b[i+1], n), I); |
---|
210 | } |
---|
211 | } |
---|
212 | rez= coeffs(rez, t@)[n+1, 1]; // take the coefficient of the n-th power of t@ |
---|
213 | matrix CF=coeffs(rez, z@); // take the matrix of the coefficients |
---|
214 | list res; // and transform it to a list |
---|
215 | int d=size(CF); |
---|
216 | for(i=1; i<=d; i++) |
---|
217 | { |
---|
218 | res=res+ list(int(CF[i, 1])) ; |
---|
219 | } |
---|
220 | setring br@; // come back to the initial base ring |
---|
221 | return(res); |
---|
222 | } |
---|
223 | example |
---|
224 | { |
---|
225 | "EXAMPLE:"; echo=2; |
---|
226 | ring r=0, (z), ls; |
---|
227 | // consider the projective plane P_2 with Betti numbers 1,0,1,0,1 |
---|
228 | list b=1,0,1,0,1; |
---|
229 | // get the Betti numbers of the Hilbert scheme of 3 points on P_2 |
---|
230 | print( BettiNumsH(3, b) ); |
---|
231 | } |
---|
232 | //---------------------------------------------------------- |
---|
233 | |
---|
234 | proc MacdonaldF(poly z, poly t, int n, list b) |
---|
235 | "USAGE: MacdonaldF(z, t, n, b); z, t polynomials, n integer, b list of non-negative integers |
---|
236 | RETURN: polynomial in z and t with integer coefficients |
---|
237 | PURPOSE: computes the Macdonalds's formula up to degree n in t |
---|
238 | EXAMPLE: example MacdonaldF; shows an example |
---|
239 | NOTE: zero is returned if n<0 or b is not a list of non-negative integers |
---|
240 | " |
---|
241 | { |
---|
242 | // check the input data |
---|
243 | if( !checkBetti(b) ) |
---|
244 | { |
---|
245 | print("the Betti numbers must be non-negative integers"); |
---|
246 | print("zero polynomial is returned"); |
---|
247 | return( poly(0) ); |
---|
248 | } |
---|
249 | if(n<0) |
---|
250 | { |
---|
251 | print("the exponent of the symmetric power must be non-negative"); |
---|
252 | print("zero polynomial is returned"); |
---|
253 | return( poly(0) ); |
---|
254 | } |
---|
255 | int d=size(b); |
---|
256 | def br@=basering; // remember the base ring |
---|
257 | // add additional variables z@, t@ to the base ring |
---|
258 | execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;" ); |
---|
259 | execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings |
---|
260 | poly rez=1; |
---|
261 | int i; |
---|
262 | ideal I=std(t@^(n+1)); |
---|
263 | for(i=0;i<d;i++) |
---|
264 | { |
---|
265 | rez=NF(rez*generFactor( z@^i*t@, 1, i, b[i+1], n), I); |
---|
266 | } |
---|
267 | setring br@; // come back to the initial base ring |
---|
268 | // define the specialization homomorphism z@=z, t@=t |
---|
269 | execute( "map FF= r@,"+varstr(br@)+",z, t;" ); |
---|
270 | poly rez=FF(rez); // bring the result to the base ring |
---|
271 | return(rez); |
---|
272 | } |
---|
273 | example |
---|
274 | { |
---|
275 | "EXAMPLE:"; echo=2; |
---|
276 | ring r=0, (t, z), ls; |
---|
277 | // consider the projective plane with Betti numbers 1,0,1,0,1 |
---|
278 | list b=1,0,1,0,1; |
---|
279 | // get the Macdonald's formula up to degree 3 |
---|
280 | print( MacdonaldF(z, t, 3, b) ); |
---|
281 | } |
---|
282 | //---------------------------------------------------------- |
---|
283 | |
---|
284 | proc PPolyS(poly z, int n, list b) |
---|
285 | "USAGE: PPolyS(z, n, b); z polynomial, n integer, b list of non-negative integers |
---|
286 | RETURN: polynomial in z with integer coefficients |
---|
287 | PURPOSE: computes the Poincare polynomial of the n-th symmetric power |
---|
288 | of a variety with Betti numbers b |
---|
289 | EXAMPLE: example PPolyS; shows an example |
---|
290 | NOTE: zero is returned if n<0 or b is not a list of non-negative integers |
---|
291 | " |
---|
292 | { |
---|
293 | // check the input data |
---|
294 | if( !checkBetti(b) ) |
---|
295 | { |
---|
296 | print("the Betti numbers must be non-negative integers"); |
---|
297 | print("zero polynomial is returned"); |
---|
298 | return( poly(0) ); |
---|
299 | } |
---|
300 | if(n<0) |
---|
301 | { |
---|
302 | print("the exponent of the symmetric power must be non-negative"); |
---|
303 | print("zero polynomial is returned"); |
---|
304 | return( poly(0) ); |
---|
305 | } |
---|
306 | int d=size(b); |
---|
307 | def br@=basering; // remember the base ring |
---|
308 | // add additional variables z@, t@ to the base ring |
---|
309 | execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;" ); |
---|
310 | execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings |
---|
311 | poly rez=1; |
---|
312 | int i; |
---|
313 | ideal I=std(t@^(n+1)); |
---|
314 | for(i=0;i<d;i++) |
---|
315 | { |
---|
316 | rez=NF(rez*generFactor( z@^i*t@, 1, i, b[i+1], n), I); |
---|
317 | } |
---|
318 | rez= coeffs(rez, t@)[n+1, 1]; // take the coefficient of the n-th power of t@ |
---|
319 | setring br@; // come back to the initial base ring |
---|
320 | // define the specialization homomorphism z@=z, t@=0 |
---|
321 | execute( "map FF= r@,"+varstr(br@)+",z, 0;" ); |
---|
322 | poly rez=FF(rez); // bring the result to the base ring |
---|
323 | return(rez); |
---|
324 | } |
---|
325 | example |
---|
326 | { |
---|
327 | "EXAMPLE:"; echo=2; |
---|
328 | ring r=0, (z), ls; |
---|
329 | // consider the projective plane P_2 with Betti numbers 1,0,1,0,1 |
---|
330 | list b=1,0,1,0,1; |
---|
331 | // get the Poincare polynomial of the third symmetric power of P_2 |
---|
332 | print( PPolyS(z, 3, b) ); |
---|
333 | } |
---|
334 | //---------------------------------------------------------- |
---|
335 | |
---|
336 | proc BettiNumsS(int n, list b) |
---|
337 | "USAGE: BettiNumsS(n, b); n integer, b list of non-negative integers |
---|
338 | RETURN: list of non-negative integers |
---|
339 | PURPOSE: computes the Betti numbers of the n-th symmetric power of a variety with Betti numbers b |
---|
340 | EXAMPLE: example BettiNumsS; shows an example |
---|
341 | NOTE: an empty list is returned if n<0 or b is not a list of non-negative integers |
---|
342 | " |
---|
343 | { |
---|
344 | // check the input data |
---|
345 | if( !checkBetti(b) ) |
---|
346 | { |
---|
347 | print("the Betti numbers must be non-negative integers"); |
---|
348 | print("an empty list is returned"); |
---|
349 | return( list() ); |
---|
350 | } |
---|
351 | if(n<0) |
---|
352 | { |
---|
353 | print("the exponent of the symmetric power must be non-negative"); |
---|
354 | print("an empty list is returned"); |
---|
355 | return(list()); |
---|
356 | } |
---|
357 | int d=size(b); |
---|
358 | def br@=basering; // remember the base ring |
---|
359 | // add additional variables z@, t@ to the base ring |
---|
360 | execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;" ); |
---|
361 | execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings |
---|
362 | poly rez=1; |
---|
363 | int i; |
---|
364 | ideal I=std(t@^(n+1)); |
---|
365 | for(i=0;i<d;i++) |
---|
366 | { |
---|
367 | rez=NF(rez*generFactor( z@^i*t@, 1, i, b[i+1], n), I); |
---|
368 | } |
---|
369 | rez= coeffs(rez, t@)[n+1, 1]; // take the coefficient of the n-th power of t@ |
---|
370 | matrix CF=coeffs(rez, z@); // take the matrix of the coefficients |
---|
371 | list res; // and transform it to a list |
---|
372 | d=size(CF); |
---|
373 | for(i=1; i<=d; i++) |
---|
374 | { |
---|
375 | res=res+ list(int(CF[i, 1])) ; |
---|
376 | } |
---|
377 | setring br@; // come back to the initial base ring |
---|
378 | return(res); |
---|
379 | } |
---|
380 | example |
---|
381 | { |
---|
382 | "EXAMPLE:"; echo=2; |
---|
383 | ring r=0, (z), ls; |
---|
384 | // consider a complex torus T (elliptic curve) with Betti numbers 1,2,1 |
---|
385 | list b=1,2,1; |
---|
386 | // get the Betti numbers of the second symmetric power of T |
---|
387 | print( BettiNumsS(2, b) ); |
---|
388 | // consider a projective plane P_2 with Betti numbers 1,0,1,0,1 |
---|
389 | b=1,0,1,0,1; |
---|
390 | // get the Betti numbers of the third symmetric power of P_2 |
---|
391 | print( BettiNumsS(3, b) ); |
---|
392 | } |
---|
393 | //---------------------------------------------------------- |
---|
394 | |
---|
395 | proc PPolyN(poly t, int q, int m, int n) |
---|
396 | "USAGE: PPolyN(t, q, m, n); t polynomial, q, m, n integers |
---|
397 | RETURN: polynomial in t |
---|
398 | PURPOSE: computes the Poincare polynomial of the moduli space |
---|
399 | of Kronecker modules N(q; m, n) |
---|
400 | EXAMPLE: example PPolyN; shows an example |
---|
401 | NOTE: if m and n are not coprime, the result does not necessary make sense |
---|
402 | " |
---|
403 | { |
---|
404 | int d=dimKron(q, m, n); |
---|
405 | if(d<0) |
---|
406 | { |
---|
407 | return(0); |
---|
408 | } |
---|
409 | if(gcd(m, n)!=1) |
---|
410 | { |
---|
411 | "You are trying to compute the Poincare polynomial"; |
---|
412 | "of the moduli space of Kronecker modules N("+string(q)+"; "+string(m)+", "+string(n)+")."; |
---|
413 | "Notice that gcd(m,n)=1 is expected to get the correct Poincare polynomial"; |
---|
414 | "of the moduli space N(q; m, n)!"; |
---|
415 | } |
---|
416 | def br@=basering; // remember the base ring |
---|
417 | // add additional variable t@ to the base ring |
---|
418 | execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", t@), dp;" ); |
---|
419 | execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings |
---|
420 | poly rez=(1-t@^2)*PPolyW(q, m, n, t@, d); |
---|
421 | ideal I=t@^(2*d+1); |
---|
422 | rez=NF(rez, I); |
---|
423 | setring br@; // come back to the initial base ring |
---|
424 | // define the specialization homomorphism t@=t |
---|
425 | execute( "map FF= r@,"+varstr(br@)+", t;" ); |
---|
426 | poly rez=FF(rez); // bring the result to the base ring |
---|
427 | return(rez); |
---|
428 | } |
---|
429 | example |
---|
430 | { |
---|
431 | "EXAMPLE:"; echo=2; |
---|
432 | ring r=0, (t), ls; |
---|
433 | // get the Poincare polynomial of N(3; 2, 3) |
---|
434 | print( PPolyN(t, 3, 2, 3) ); |
---|
435 | } |
---|
436 | //---------------------------------------------------------- |
---|
437 | |
---|
438 | proc BettiNumsN(int q, int m, int n) |
---|
439 | "USAGE: BettiNumsN(q, m, n); q, m, n integers |
---|
440 | RETURN: list of integers |
---|
441 | PURPOSE: computes the Betti numbers of the moduli space |
---|
442 | of Kronecker modules N(q; m, n) |
---|
443 | EXAMPLE: example BettiNumsN; shows an example |
---|
444 | NOTE: if m and n are not coprime, the result does not necessary make sense |
---|
445 | " |
---|
446 | { |
---|
447 | int d=dimKron(q, m, n); |
---|
448 | if(d<0) |
---|
449 | { |
---|
450 | return(0); |
---|
451 | } |
---|
452 | if(gcd(m, n)!=1) |
---|
453 | { |
---|
454 | "You are trying to compute the Poincare polynomial"; |
---|
455 | "of the moduli space of Kronecker modules N("+string(q)+"; "+string(m)+", "+string(n)+")."; |
---|
456 | "Notice that gcd(m,n)=1 is expected to get the correct Poincare polynomial"; |
---|
457 | "of the moduli space N(q; m, n)!"; |
---|
458 | } |
---|
459 | def br@=basering; // remember the base ring |
---|
460 | // add additional variable t@ to the base ring |
---|
461 | execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", t@), dp;" ); |
---|
462 | execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings |
---|
463 | poly rez=(1-t@^2)*PPolyW(q, m, n, t@, d); |
---|
464 | ideal I=t@^(2*d+1); |
---|
465 | rez=NF(rez, I); |
---|
466 | matrix CF=coeffs(rez, t@); // take the matrix of the coefficients |
---|
467 | list res; // and transform it to a list |
---|
468 | d=size(CF); |
---|
469 | int i; |
---|
470 | for(i=1; i<=d; i++) |
---|
471 | { |
---|
472 | res=res + list(int(CF[i, 1])) ; |
---|
473 | } |
---|
474 | setring br@; // come back to the initial base ring |
---|
475 | return(res); |
---|
476 | } |
---|
477 | example |
---|
478 | { |
---|
479 | "EXAMPLE:"; echo=2; |
---|
480 | ring r=0, (t), dp; |
---|
481 | // get the Betti numbers of N(3; 2, 3) |
---|
482 | print( BettiNumsN(3, 2, 3) ); |
---|
483 | } |
---|
484 | //---------------------------------------------------------------------------------------- |
---|
485 | // The procedures below are for the internal usage only |
---|
486 | //---------------------------------------------------------------------------------------- |
---|
487 | |
---|
488 | static proc checkBetti(list b) |
---|
489 | "USAGE: checkBetti(b); b list of integers |
---|
490 | RETURN: integer 1 or 0 |
---|
491 | PURPOSE: checks whether all entries of b are non-negative integers |
---|
492 | EXAMPLE: example checkBetti; shows an example |
---|
493 | NOTE: |
---|
494 | " |
---|
495 | { |
---|
496 | int i; |
---|
497 | int sz=size(b); |
---|
498 | for(i=1;i<=sz;i++) |
---|
499 | { |
---|
500 | if( typeof(b[i])!="int" ) |
---|
501 | { |
---|
502 | return(int(0)); |
---|
503 | } |
---|
504 | if( b[i]<0 ) |
---|
505 | { |
---|
506 | return(int(0)); |
---|
507 | } |
---|
508 | } |
---|
509 | return(int(1)); |
---|
510 | } |
---|
511 | example |
---|
512 | { |
---|
513 | "EXAMPLE:"; echo=2; |
---|
514 | ring r=0, (t), dp; |
---|
515 | // not all entries are integers |
---|
516 | list b=1,0,t,0,1; |
---|
517 | print(checkBetti(b)); |
---|
518 | // all entries are integers but not all are non-negative |
---|
519 | list b=1,0,-1,0,1; |
---|
520 | print(checkBetti(b)); |
---|
521 | // all entries are non-negative integers |
---|
522 | list b=1,0,1,0,1; |
---|
523 | print(checkBetti(b)); |
---|
524 | } |
---|
525 | //---------------------------------------------------------- |
---|
526 | |
---|
527 | static proc generFactor(poly X, int k, int i, int b, int n) |
---|
528 | "USAGE: generFactor; X polynomial, k, b, n integers |
---|
529 | RETURN: polynomial |
---|
530 | PURPOSE: computes the corresponding factor from Goettsche's formula |
---|
531 | EXAMPLE: example generFactor; shows an example |
---|
532 | NOTE: |
---|
533 | " |
---|
534 | { |
---|
535 | poly rez=0; |
---|
536 | int j; |
---|
537 | int pow; |
---|
538 | pow=(-1)^(i+1)*b; |
---|
539 | if(pow > 0) |
---|
540 | { |
---|
541 | rez=(1+X)^pow; |
---|
542 | } |
---|
543 | else |
---|
544 | { |
---|
545 | int m=n div k + 1; |
---|
546 | for(j=0;j<m;j++) |
---|
547 | { |
---|
548 | rez=rez+ X^j; |
---|
549 | } |
---|
550 | rez=rez^(-pow); |
---|
551 | } |
---|
552 | return(rez); |
---|
553 | } |
---|
554 | example |
---|
555 | { |
---|
556 | "EXAMPLE:"; echo=2; |
---|
557 | ring r=0, (t), ds; |
---|
558 | // get the polynomial expansion of 1/(1-t)^2 |
---|
559 | // using the Taylor expansion of 1/(1-t) up to degree 11 |
---|
560 | // and assuming that the degree of t is 3 |
---|
561 | print( generFactor(t, 3, 0, 2, 11) ); |
---|
562 | } |
---|
563 | //---------------------------------------------------------------------------------------- |
---|
564 | // The procedures below are related to the Kronecker modules |
---|
565 | //---------------------------------------------------------------------------------------- |
---|
566 | |
---|
567 | static proc PPolyW(int q, int m, int n, poly t, int d, list #) |
---|
568 | { |
---|
569 | // without loss of generality assume that m >= n |
---|
570 | int N; |
---|
571 | int M; |
---|
572 | if(n>m) |
---|
573 | { |
---|
574 | M = n; |
---|
575 | N = m; |
---|
576 | } |
---|
577 | else |
---|
578 | { |
---|
579 | M = m; |
---|
580 | N = n; |
---|
581 | } |
---|
582 | // now M >= N; |
---|
583 | int i; |
---|
584 | int j; |
---|
585 | list plg;// will be the matrix-list with all the data |
---|
586 | list newPlg;// will be used for computation of new entries of plg |
---|
587 | // initial intitialization of plg, M entries |
---|
588 | for(i=1;i<=M;i++) |
---|
589 | { |
---|
590 | plg = plg + list( list() ); |
---|
591 | } |
---|
592 | int ii; |
---|
593 | int jj; |
---|
594 | int st; |
---|
595 | list P; |
---|
596 | list PP; |
---|
597 | int c; |
---|
598 | int sz; |
---|
599 | int pow; |
---|
600 | poly pterm; |
---|
601 | poly rez;// to be the result |
---|
602 | ideal I=t^(2*d+1); |
---|
603 | // starting in the bottom row, moving from left to right and from the bottom upwards |
---|
604 | for(j=0;j<=N;j++) |
---|
605 | { |
---|
606 | for(i=max(j, 1);i<=M;i++) |
---|
607 | { |
---|
608 | // for each entry compute the relevant data inductively |
---|
609 | // add the trivial polygon |
---|
610 | newPlg = list( list( list( list(int(0), int(0)), list(i, j)) , poly(0), int(0) ) ); |
---|
611 | // first summand in the Drezet's formula |
---|
612 | if(j==0)// if in the bottom row |
---|
613 | { |
---|
614 | if(i==1) |
---|
615 | { |
---|
616 | rez=geomS(t^2, d); |
---|
617 | } |
---|
618 | else |
---|
619 | { |
---|
620 | rez=plg[i-1][1][1][2]*geomS(t^(2*i), d div i ); |
---|
621 | } |
---|
622 | } |
---|
623 | else// otherwise use the values from the bottom row |
---|
624 | { |
---|
625 | rez=plg[i][1][1][2]*plg[j][1][1][2]; |
---|
626 | } |
---|
627 | rez=NF(rez, I);// throw away the higher powers |
---|
628 | //inductively compute the polygons |
---|
629 | for(ii = 0; ii <= i; ii++) |
---|
630 | { |
---|
631 | st= ((j*ii) div i) + 1; |
---|
632 | for(jj = st; jj <= j; jj++) |
---|
633 | { |
---|
634 | PP=list();// to be the list of polygons that will be added |
---|
635 | P = plg[i-ii][j-jj+1];// list of smaller polygons |
---|
636 | sz=size(P); |
---|
637 | for(c=1;c<=sz;c++)// for every smaller polygon |
---|
638 | { |
---|
639 | if( jj*P[c][1][2][1]-P[c][1][2][2]*ii > 0 )// if the slopes fit |
---|
640 | { |
---|
641 | pow = P[c][3]+ jj*( q*(i-ii)-(j-jj) )-ii*(i-ii);// get the corresponding power |
---|
642 | // and the corresponding product |
---|
643 | pterm = NF(P[c][2]* plg[max(ii,jj)][min(ii,jj)+1][1][2], I); |
---|
644 | // and add the data to PP |
---|
645 | PP = PP + list(list(list(list(int(0),int(0))) + shift(P[c][1],ii,jj),pterm,pow)); |
---|
646 | // throw away the summands from the polygons with non-admissible slopes and pow<0 |
---|
647 | if(pterm!=0) |
---|
648 | { |
---|
649 | rez=rez-t^(2*pow) * pterm;// add the next summand |
---|
650 | } |
---|
651 | } |
---|
652 | } |
---|
653 | newPlg=newPlg + PP;// add the new polygons to the list |
---|
654 | } |
---|
655 | } |
---|
656 | rez=NF(rez, I);// throw away the higher powers |
---|
657 | newPlg[1][2]=rez;// set the polynomial corresponding to the trivial polygon |
---|
658 | plg[i]=plg[i]+list(newPlg);// add the new data |
---|
659 | // now all the data for (i, j) have been computed |
---|
660 | } |
---|
661 | } |
---|
662 | if(size(#)==0)// if there are no optional parameters |
---|
663 | { |
---|
664 | return(plg[M][N+1][1][2]);// return the polynomial of the upper right entry |
---|
665 | } |
---|
666 | else// otherwise return all the computed data |
---|
667 | { |
---|
668 | return(plg); |
---|
669 | } |
---|
670 | } |
---|
671 | //---------------------------------------------------------- |
---|
672 | |
---|
673 | static proc dimKron(int q, int m, int n) |
---|
674 | { |
---|
675 | if( (q<3)||(m<0)||(n<0) ) |
---|
676 | { |
---|
677 | "Check the input data!"; |
---|
678 | "It is expected that for the moduli space of Kronecker modules N(q; m, n)"; |
---|
679 | "q >= 3, m >= 0, n >= 0."; |
---|
680 | return(int(-1)); |
---|
681 | } |
---|
682 | int ph=m^2+n^2-q*m*n; |
---|
683 | if(ph<0) |
---|
684 | { |
---|
685 | return(1-ph); |
---|
686 | } |
---|
687 | int g=gcd(m, n); |
---|
688 | if(g==0) |
---|
689 | { |
---|
690 | return(int(-1)); |
---|
691 | } |
---|
692 | m = m div g; |
---|
693 | n = n div g; |
---|
694 | ph = m^2+n^2-q*m*n; |
---|
695 | if(ph==1) |
---|
696 | { |
---|
697 | return(int(0)); |
---|
698 | } |
---|
699 | else |
---|
700 | { |
---|
701 | return(int(-1)); |
---|
702 | } |
---|
703 | } |
---|
704 | //---------------------------------------------------------- |
---|
705 | |
---|
706 | static proc shift(list l, int a, int b) |
---|
707 | { |
---|
708 | int sz=size(l); |
---|
709 | int i; |
---|
710 | for(i=1;i<=sz;i++) |
---|
711 | { |
---|
712 | l[i][1]=l[i][1]+a; |
---|
713 | l[i][2]=l[i][2]+b; |
---|
714 | } |
---|
715 | return(l); |
---|
716 | } |
---|
717 | //---------------------------------------------------------- |
---|
718 | |
---|
719 | static proc geomS(poly t, int d) |
---|
720 | { |
---|
721 | poly rez=1; |
---|
722 | int i; |
---|
723 | for(i=1;i<=d;i++) |
---|
724 | { |
---|
725 | rez=rez+t^i; |
---|
726 | } |
---|
727 | return(rez); |
---|
728 | } |
---|
729 | //---------------------------------------------------------- |
---|
730 | |
---|