1 | /////////////////////////////////////////////////////////////////////////////// |
---|
2 | version="version ellipticcovers.lib 4.1.2.0 Feb_2019 "; |
---|
3 | category="Commutative algebra"; |
---|
4 | info=" |
---|
5 | LIBRARY: ellipticCovers.lib Gromov-Witten numbers of elliptic curves |
---|
6 | |
---|
7 | AUTHORS: J. Boehm, boehm @ mathematik.uni-kl.de |
---|
8 | A. Buchholz, buchholz @ math.uni-sb.de |
---|
9 | H. Markwig hannah @ math.uni-sb.de |
---|
10 | |
---|
11 | OVERVIEW: |
---|
12 | |
---|
13 | We implement a formula for computing the number of covers of elliptic curves. |
---|
14 | It has beed obtained by proving mirror symmetry |
---|
15 | for arbitrary genus by tropical methods in [BBM]. A Feynman graph of genus |
---|
16 | g is a trivalent, connected graph of genus g (with 2g-2 vertices |
---|
17 | and 3g-3 edges). The branch type b=(b_1,...,b_(3g-3)) of a stable map is the |
---|
18 | multiplicity of the the edge i over a fixed base point. |
---|
19 | |
---|
20 | Given a Feynman graph G and a branch type b, we obtain the number |
---|
21 | N_(G,b) of stable maps of branch type b from a genus g curve of topological type G |
---|
22 | to the elliptic curve by computing a path integral |
---|
23 | over a rational function. The path integral is computed as a residue. |
---|
24 | |
---|
25 | The sum of N_(G,b) over all branch types b of sum d gives N_(G,d)*|Aut(G)|, with the |
---|
26 | Gromov-Witten invariant N_(G,d) of degree d stable maps from a genus g curve |
---|
27 | of topological type G to the elliptic curve. |
---|
28 | |
---|
29 | The sum of N_(G,d) over all such graphs gives the usual Gromov-Witten invariant N_(g,d) |
---|
30 | of degree d stable maps from a genus g curve to the elliptic curve. |
---|
31 | |
---|
32 | The key function computing the numbers N_(G,b) and N_(G,d) is gromovWitten. |
---|
33 | |
---|
34 | REFERENCES: |
---|
35 | |
---|
36 | [BBM] J. Boehm, A. Buchholz, H. Markwig: Tropical mirror symmetry for elliptic curves, arXiv:1309.5893 (2013). |
---|
37 | |
---|
38 | KEYWORDS: |
---|
39 | tropical geometry; mirror symmetry; tropical mirror symmetry; Gromov-Witten invariants; elliptic curves; propagator; Feynman graph; path integral |
---|
40 | |
---|
41 | TYPES: |
---|
42 | |
---|
43 | graph |
---|
44 | |
---|
45 | PROCEDURES: |
---|
46 | |
---|
47 | makeGraph(list, list) generate a graph from a list of vertices and a lsit of edges |
---|
48 | printGraph(graph) print procedure for graphs |
---|
49 | propagator(list,int) propagator factor of degree d in the quotient of two variables, or |
---|
50 | propagator for fixed graph and branch type |
---|
51 | computeConstant(number, number) constant coefficient in the Laurent series expansion of a rational function in a given variable |
---|
52 | evalutateIntegral(number, list) path integral for a given propagator and ordered sequence of variables |
---|
53 | gromovWitten(number) sum of path integrals for a given propagator over all orderings of the variables, or |
---|
54 | Gromov Witten invariant for a given graph and a fixed branch type, or |
---|
55 | list of Gromov Witten invariants for a given graph and all branch types |
---|
56 | computeGromovWitten(graph, int, int) compute the Gromov Witten invariants for a given graph and some branch types |
---|
57 | generatingFunction (graph, int) multivariate generating function for the Gromov Witten invariants of a graph up to fixed degree |
---|
58 | |
---|
59 | partitions(int, int) partitions of an integer into a fixed number of summands |
---|
60 | permute(list) all permutations of a list |
---|
61 | lsum(list) sum of the elements of a list |
---|
62 | |
---|
63 | "; |
---|
64 | |
---|
65 | |
---|
66 | LIB "parallel.lib"; |
---|
67 | |
---|
68 | |
---|
69 | static proc mod_init() |
---|
70 | { |
---|
71 | newstruct("graph","list vertices, list edges"); |
---|
72 | newstruct("Net","list rows"); |
---|
73 | |
---|
74 | system("install","graph","print",printGraph,1); |
---|
75 | system("install","Net","print",printNet,1); |
---|
76 | system("install","Net","+",catNet,2); |
---|
77 | } |
---|
78 | |
---|
79 | static proc catNet(Net N, Net M) |
---|
80 | { |
---|
81 | list L; |
---|
82 | list LN=N.rows; |
---|
83 | list LM=M.rows; |
---|
84 | int widthN=size(LN[1]); |
---|
85 | int widthM=size(LM[1]); |
---|
86 | int nm=max(size(LN),size(LM)); |
---|
87 | for (int j=1; j<=nm; j++) |
---|
88 | { |
---|
89 | if (j>size(LN)){LN[j]=emptyString(widthN);} |
---|
90 | if (j>size(LM)){LM[j]=emptyString(widthM);} |
---|
91 | L[j]=LN[j]+LM[j]; |
---|
92 | } |
---|
93 | Net NM; |
---|
94 | NM.rows=L; |
---|
95 | return(NM); |
---|
96 | } |
---|
97 | |
---|
98 | |
---|
99 | static proc netList(list L1) |
---|
100 | { |
---|
101 | Net N=net("["); |
---|
102 | for (int j=1; j<=size(L1)-1; j++) |
---|
103 | { |
---|
104 | N=N+net(L1[j])+net(", "); |
---|
105 | } |
---|
106 | N=N+net(L1[size(L1)])+net("]"); |
---|
107 | return(N); |
---|
108 | } |
---|
109 | |
---|
110 | static proc printNet(Net N) |
---|
111 | { |
---|
112 | list L = N.rows; |
---|
113 | for (int j=1; j<=size(L); j++) |
---|
114 | { |
---|
115 | print(L[j]); |
---|
116 | } |
---|
117 | } |
---|
118 | |
---|
119 | static proc net(def M) |
---|
120 | { |
---|
121 | if (typeof(M)=="list") |
---|
122 | { |
---|
123 | return(netList(M)); |
---|
124 | } |
---|
125 | Net N; |
---|
126 | list L; |
---|
127 | L[1]=string(M); |
---|
128 | N.rows=L; |
---|
129 | return(N); |
---|
130 | } |
---|
131 | |
---|
132 | |
---|
133 | |
---|
134 | proc printGraph(graph G) |
---|
135 | "USAGE: printGraph(G); G graph@* |
---|
136 | ASSUME: G is a graph. |
---|
137 | THEORY: This is the print function used by Singular to print a graph. |
---|
138 | KEYWORDS: graph |
---|
139 | EXAMPLE: example printGraph; shows an example |
---|
140 | " |
---|
141 | { |
---|
142 | print(netList(G.edges)); |
---|
143 | print("Graph with "+string(size(G.vertices))+" vertices and "+string(size(G.edges))+" edges") |
---|
144 | } |
---|
145 | example |
---|
146 | { "EXAMPLE:"; echo=2; |
---|
147 | ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp; |
---|
148 | graph G = makeGraph(list(1,2,3,4),list(list(1,3),list(1,2),list(1,2),list(2,4),list(3,4),list(3,4))); |
---|
149 | G; |
---|
150 | } |
---|
151 | |
---|
152 | proc makeGraph(list v, list e) |
---|
153 | "USAGE: makeGraph(v,e); v list, e list@* |
---|
154 | ASSUME: v is a list of integers, e is a list of two element lists of v. |
---|
155 | RETURN: graph with vertices v and edges e |
---|
156 | THEORY: Creates a graph from a list of vertices and edges. The vertices can be any type. |
---|
157 | KEYWORDS: graph |
---|
158 | EXAMPLE: example printGraph; shows an example |
---|
159 | " |
---|
160 | { |
---|
161 | graph G; |
---|
162 | G.vertices = v; |
---|
163 | G.edges = e; |
---|
164 | return(G); |
---|
165 | } |
---|
166 | example |
---|
167 | { "EXAMPLE:"; echo=2; |
---|
168 | ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp; |
---|
169 | graph G = makeGraph(list(1,2,3,4),list(list(1,3),list(1,2),list(1,2),list(2,4),list(3,4),list(3,4))); |
---|
170 | G; |
---|
171 | } |
---|
172 | |
---|
173 | proc propagator(def xy, def d) |
---|
174 | "USAGE: propagator(xy,d); xy list, d int@* |
---|
175 | propagator(G,b); G graph, b list@* |
---|
176 | ASSUME: xy is a list of two numbers x and y in a rational function field, d non-negative integer.@* |
---|
177 | G is a Feynman graph, a is a list of integers of length equal to the number of edges of G.@* |
---|
178 | We assume that the coefficient ring has one rational variable for each vertex of G. |
---|
179 | RETURN: number, the propagator associated to the input data. |
---|
180 | THEORY: If xy and d are specified, then the function returns x^2*y^2/(x^2-y^2)^2) for d=0, which |
---|
181 | is a associated to an edge with vertices x and y not passing above the base point. |
---|
182 | For d>0 it returns the sum of (j*x^(4*j)+j*y^(4*j))/(x*y)^(2*j) over all divisors j of d, |
---|
183 | which is associated to an edge with vertices x and y passing with multiplicity d above the base point. |
---|
184 | |
---|
185 | Essentially the variables x and y stand for the position of the base points. |
---|
186 | |
---|
187 | In the second way of using this function, G is a Feynman graph and b is a branch type |
---|
188 | over a fixed base point of a cover with source G and target an elliptic curve. It returns the |
---|
189 | product of propagator(list(v[i],w[i]),b[i]) over all edges i with multiplicity b[i] over the base point |
---|
190 | and vertices v[i] and w[i]. |
---|
191 | |
---|
192 | KEYWORDS: elliptic curve |
---|
193 | EXAMPLE: example propagator; shows an example |
---|
194 | " |
---|
195 | { |
---|
196 | if ((typeof(xy)=="list")||(typeof(d)=="int")) |
---|
197 | { |
---|
198 | number x = xy[1]; |
---|
199 | number y = xy[2]; |
---|
200 | if (d<0) {ERROR("expected non-negative degree");} |
---|
201 | if (d==0) {return(x^2*y^2/(x^2-y^2)^2);} |
---|
202 | number p=0; |
---|
203 | for (int j=1; j<=d; j++) |
---|
204 | { |
---|
205 | if (d%j==0){p=p+(j*x^(4*j)+j*y^(4*j))/(x*y)^(2*j);} |
---|
206 | } |
---|
207 | return(p); |
---|
208 | } |
---|
209 | if ((typeof(xy)=="graph")||(typeof(d)=="list")) |
---|
210 | { |
---|
211 | list xl = ringlist(basering)[1][2]; |
---|
212 | list ed = xy.edges; |
---|
213 | number f=1; |
---|
214 | for (int j=1; j<=size(ed); j++) |
---|
215 | { |
---|
216 | execute("number xx1 = "+xl[ed[j][1]]); |
---|
217 | execute("number xx2 = "+xl[ed[j][2]]); |
---|
218 | f=f*propagator(list(xx1,xx2),d[j]); |
---|
219 | kill xx1; |
---|
220 | kill xx2; |
---|
221 | } |
---|
222 | return(f); |
---|
223 | } |
---|
224 | if ((typeof(xy)=="graph")||(typeof(d)=="int")) |
---|
225 | { |
---|
226 | } |
---|
227 | ERROR("wrong input type"); |
---|
228 | } |
---|
229 | example |
---|
230 | { "EXAMPLE:"; echo=2; |
---|
231 | ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp; |
---|
232 | graph G = makeGraph(list(1,2,3,4),list(list(1,3),list(1,2),list(1,2),list(2,4),list(3,4),list(3,4))); |
---|
233 | propagator(list(x1,x2),0); |
---|
234 | propagator(list(x1,x2),2); |
---|
235 | propagator(G,list(1,1,1,0,0,0)); |
---|
236 | } |
---|
237 | |
---|
238 | proc computeConstant(number f,number xx) |
---|
239 | "USAGE: computeConstant(f,x); f number, x number@* |
---|
240 | ASSUME: f is a number in a rational function field, x is a variable of the field.@* |
---|
241 | RETURN: number, the constant coefficient of the Laurent series of f in the variable x. |
---|
242 | THEORY: Computes the constant coefficient of the Laurent series by iterative differentiation. |
---|
243 | KEYWORDS: Laurent series |
---|
244 | EXAMPLE: example computeConstant; shows an example |
---|
245 | " |
---|
246 | { |
---|
247 | int tst=0; |
---|
248 | number ff=f; |
---|
249 | int k; |
---|
250 | int j; |
---|
251 | poly de; |
---|
252 | while (tst==0) |
---|
253 | { |
---|
254 | ff=f*xx^k; |
---|
255 | for (j=1; j<=k; j++)i |
---|
256 | { |
---|
257 | ff=diff(ff,xx)/j; |
---|
258 | } |
---|
259 | de = subst(denominator(ff),xx,0); |
---|
260 | if (de!=0) |
---|
261 | { |
---|
262 | poly nu = subst(numerator(ff),xx,0); |
---|
263 | return(number(nu/de)); |
---|
264 | } |
---|
265 | k++; |
---|
266 | } |
---|
267 | ERROR("error in computeConstant"); |
---|
268 | } |
---|
269 | example |
---|
270 | { "EXAMPLE:"; echo=2; |
---|
271 | ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp; |
---|
272 | graph G = makeGraph(list(1,2,3,4),list(list(1,3),list(1,2),list(1,2),list(2,4),list(3,4),list(3,4))); |
---|
273 | number P = propagator(G,list(1,1,1,0,0,0)); |
---|
274 | computeConstant(P,x2); |
---|
275 | } |
---|
276 | |
---|
277 | proc evaluateIntegral(number P, list xL) |
---|
278 | "USAGE: evaluateIntegral(P,xx); P number, xx list@* |
---|
279 | ASSUME: P is a number in a rational function field, xx is a list of variables of the field@* |
---|
280 | RETURN: number, the constant coefficient of the Laurent series of f in the variables in the list xx. |
---|
281 | THEORY: Computes the constant coefficient of the Laurent series iteratively for the elements of xx. |
---|
282 | |
---|
283 | In the setting of covers of elliptic curves this is the path integral over the |
---|
284 | propagator divided by the product of all variables (corresponding to the vertices) |
---|
285 | computed as a residue. |
---|
286 | |
---|
287 | KEYWORDS: residue; Laurent series |
---|
288 | EXAMPLE: example evaluateIntegral; shows an example |
---|
289 | " |
---|
290 | { |
---|
291 | number p = P; |
---|
292 | for(int j=1; j<=size(xL); j++) |
---|
293 | { |
---|
294 | p=computeConstant(p,xL[j]); |
---|
295 | } |
---|
296 | return(p); |
---|
297 | } |
---|
298 | example |
---|
299 | { "EXAMPLE:"; echo=2; |
---|
300 | ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp; |
---|
301 | graph G = makeGraph(list(1,2,3,4),list(list(1,3),list(1,2),list(1,2),list(2,4),list(3,4),list(3,4))); |
---|
302 | number p = propagator(G,list(0,2,1,0,0,1)); |
---|
303 | evaluateIntegral(p,list(x1,x3,x4,x2)); |
---|
304 | } |
---|
305 | |
---|
306 | proc permute (list N) |
---|
307 | "USAGE: permute(N); N list@* |
---|
308 | ASSUME: N is a list@* |
---|
309 | RETURN: list with all permutations of N. |
---|
310 | THEORY: Computes all permutations of N. |
---|
311 | |
---|
312 | This will eventually be deleted and become a more efficient kernel function. |
---|
313 | |
---|
314 | KEYWORDS: permutations |
---|
315 | EXAMPLE: example permute; shows an example |
---|
316 | " |
---|
317 | { |
---|
318 | int i,j,k; |
---|
319 | list L,L1; |
---|
320 | if (size(N)==1) |
---|
321 | { |
---|
322 | return(list(N)); |
---|
323 | } |
---|
324 | else |
---|
325 | { |
---|
326 | k=1; |
---|
327 | for (i=1; i<=size(N); i++) |
---|
328 | { |
---|
329 | L=permute(delete(N,i)); |
---|
330 | for (j=1; j<=size(L); j++) |
---|
331 | { |
---|
332 | L1[k]=L[j]+list(N[i]); |
---|
333 | k=k+1; |
---|
334 | } |
---|
335 | } |
---|
336 | } |
---|
337 | return(L1); |
---|
338 | } |
---|
339 | example |
---|
340 | { "EXAMPLE:"; echo=2; |
---|
341 | ring R=(0,x1,x2,x3,x4),(q),dp; |
---|
342 | permute(list(x1,x2,x3,x4)); |
---|
343 | } |
---|
344 | |
---|
345 | |
---|
346 | |
---|
347 | proc partitions(int n, int a) |
---|
348 | "USAGE: partitions(n,a); n int, a int@* |
---|
349 | ASSUME: n and a are positive integers@* |
---|
350 | RETURN: list of all partitions of a into n summands. |
---|
351 | THEORY: Computes all partitions of a into n summands. |
---|
352 | |
---|
353 | This may eventually be deleted and become a more efficient kernel function. |
---|
354 | |
---|
355 | KEYWORDS: partitions |
---|
356 | EXAMPLE: example partitions; shows an example |
---|
357 | " |
---|
358 | { |
---|
359 | ring R = 2,(x(1..n)),dp; |
---|
360 | ideal I = maxideal(a); |
---|
361 | list L; |
---|
362 | for (int j=1;j<=size(I);j++)i |
---|
363 | { |
---|
364 | L[j]=leadexp(I[j]); |
---|
365 | } |
---|
366 | return(L); |
---|
367 | } |
---|
368 | example |
---|
369 | { "EXAMPLE:"; echo=2; |
---|
370 | partitions(3,7); |
---|
371 | } |
---|
372 | |
---|
373 | proc gromovWitten(def P,list #) |
---|
374 | "USAGE: gromovWitten(P); P number@* |
---|
375 | gromovWitten(G,d); G graph, d int@* |
---|
376 | gromovWitten(G,b); G graph, b list@* |
---|
377 | ASSUME: P is a propagator, or @* |
---|
378 | G is a Feynman graph and d a non-negative integer, or@* |
---|
379 | G is a Feynman graph and b is a list of integers of length equal to the number of edges of G@* |
---|
380 | We assume that the coefficient ring has one rational variable for each vertex of G.@* |
---|
381 | RETURN: Gromov-Witten invariant. |
---|
382 | THEORY: Computes @* |
---|
383 | |
---|
384 | - the Gromov-Witten invariant of a given propagator P, or @* |
---|
385 | |
---|
386 | - the invariant N_(G,d)*|Aut(G)| where d is the degree of the covering, or @* |
---|
387 | |
---|
388 | - the number N_(G,b) of coverings with source G and target an elliptic curves with branch type a over a |
---|
389 | fixed base point (that is, the i-th edge passes over the base point with multiplicity b[i]).@* |
---|
390 | |
---|
391 | KEYWORDS: Gromov-Witten invariants; elliptic curves; coverings; Hurwitz numbers |
---|
392 | EXAMPLE: example gromovWitten; shows an example |
---|
393 | " |
---|
394 | { |
---|
395 | if (typeof(P)=="number") |
---|
396 | { |
---|
397 | list xl = ringlist(basering)[1][2]; |
---|
398 | int j; |
---|
399 | for(j=1; j<=size(xl); j++) |
---|
400 | { |
---|
401 | execute("number n= "+xl[j]); |
---|
402 | xl[j]=n; |
---|
403 | kill n; |
---|
404 | } |
---|
405 | list pxl = permute(xl); |
---|
406 | number p = 0; |
---|
407 | for(j=1; j<=size(pxl); j++) |
---|
408 | { |
---|
409 | p=p+evaluateIntegral(P,pxl[j]); |
---|
410 | } |
---|
411 | return(p); |
---|
412 | } |
---|
413 | if (typeof(P)=="graph") |
---|
414 | { |
---|
415 | if (size(#)>1) |
---|
416 | { |
---|
417 | return(gromovWitten(propagator(P,#))); |
---|
418 | } |
---|
419 | else |
---|
420 | { |
---|
421 | int d =#[1]; |
---|
422 | list pa = partitions(size(P.edges),d); |
---|
423 | list re; |
---|
424 | int ti; |
---|
425 | for (int j=1; j<=size(pa); j++) |
---|
426 | { |
---|
427 | ti=timer; |
---|
428 | re[j]=gromovWitten(propagator(P,pa[j])); |
---|
429 | ti=timer-ti; |
---|
430 | //print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(sum(re))+" "+string(ti)); |
---|
431 | } |
---|
432 | return(lsum(re)); |
---|
433 | } |
---|
434 | } |
---|
435 | } |
---|
436 | example |
---|
437 | { "EXAMPLE:"; echo=2; |
---|
438 | ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp; |
---|
439 | graph G = makeGraph(list(1,2,3,4),list(list(1,3),list(1,2),list(1,2),list(2,4),list(3,4),list(3,4))); |
---|
440 | number P = propagator(G,list(0,2,1,0,0,1)); |
---|
441 | gromovWitten(P); |
---|
442 | gromovWitten(G,list(0,2,1,0,0,1)); |
---|
443 | gromovWitten(G,2); |
---|
444 | } |
---|
445 | |
---|
446 | proc computeGromovWitten(graph P,int d, int st, int en, list #) |
---|
447 | "USAGE: computeGromovWitten(G, d, st, en [, vb] ); G graph, d int, st int, en int, optional: vb int@* |
---|
448 | ASSUME: G is a Feynman graph, d a non-negative integer, st specified the start- and en the end partition |
---|
449 | in the list pa = partition(d). Specifying a positive optional integer vb leads to intermediate printout.@* |
---|
450 | We assume that the coefficient ring has one rational variable for each vertex of G.@* |
---|
451 | RETURN: list L, where L[i] is gromovWitten(G,pa[i]) and all others are zero. |
---|
452 | THEORY: This function does essentially the same as the function gromovWitten, but is designed for handling complicated examples. |
---|
453 | Eventually it will also run in parallel.@* |
---|
454 | |
---|
455 | KEYWORDS: Gromov-Witten invariants; elliptic curves; coverings; Hurwitz numbers |
---|
456 | EXAMPLE: example computeGromovWitten; shows an example |
---|
457 | " |
---|
458 | { |
---|
459 | number s =0; |
---|
460 | list pararg; |
---|
461 | list re; |
---|
462 | list pa = partitions(size(P.edges),d); |
---|
463 | int vb=0; |
---|
464 | if (size(#)>0){vb=#[1];} |
---|
465 | int ti; |
---|
466 | if (vb>0){print(size(pa));} |
---|
467 | for (int j=1; j<=size(pa); j++) |
---|
468 | { |
---|
469 | if ((j>=st)&(j<=en)) |
---|
470 | { |
---|
471 | ti=timer; |
---|
472 | //pararg[j]=list(propagator(G,pa[j])); |
---|
473 | re[j]=gromovWitten(propagator(P,pa[j])); |
---|
474 | ti=timer-ti; |
---|
475 | if (vb>0){print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(lsum(re))+" "+string(ti));} |
---|
476 | } |
---|
477 | else |
---|
478 | {re[j]=s;} |
---|
479 | } |
---|
480 | //list re = parallelWaitAll("gromovWitten", pararg, list(list(list(2)))); |
---|
481 | return(re); |
---|
482 | } |
---|
483 | example |
---|
484 | { "EXAMPLE:"; echo=2; |
---|
485 | ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp; |
---|
486 | graph G = makeGraph(list(1,2,3,4),list(list(1,3),list(1,2),list(1,2),list(2,4),list(3,4),list(3,4))); |
---|
487 | partitions(6,2); |
---|
488 | computeGromovWitten(G,2,3,7); |
---|
489 | computeGromovWitten(G,2,3,7,1); |
---|
490 | } |
---|
491 | |
---|
492 | proc lsum(list L) |
---|
493 | "USAGE: lsum(L); L list@* |
---|
494 | ASSUME: L is a list of things with the binary operator + defined.@* |
---|
495 | RETURN: The sum of the elements of L. |
---|
496 | THEORY: Sums the elements of a list. |
---|
497 | |
---|
498 | Eventually this will be deleted and become a more efficient kernel function.@* |
---|
499 | |
---|
500 | EXAMPLE: example lsum; shows an example |
---|
501 | " |
---|
502 | { |
---|
503 | execute(typeof(L[1])+" s"); |
---|
504 | for(int j=1; j<=size(L); j++) |
---|
505 | { |
---|
506 | s=s+L[j]; |
---|
507 | } |
---|
508 | return(s); |
---|
509 | } |
---|
510 | example |
---|
511 | { "EXAMPLE:"; echo=2; |
---|
512 | list L = 1,2,3,4,5; |
---|
513 | lsum(L); |
---|
514 | } |
---|
515 | |
---|
516 | proc generatingFunction(graph G, int d) |
---|
517 | "USAGE: generatingFunction(G, d); G graph, d int@* |
---|
518 | ASSUME: G is a Feynman graph, d a non-negative integer. The basering has one polynomial variable for each |
---|
519 | edge, and the coefficient ring has one rational variable for each vertex.@* |
---|
520 | RETURN: poly. |
---|
521 | THEORY: This function compute the multivariate generating function of all Gromov-Witten invariants up to |
---|
522 | degree d, that is, the sum of all gromovWitten(G,b)*q^b.@* |
---|
523 | |
---|
524 | KEYWORDS: generating function; Gromov-Witten invariants; elliptic curves; coverings; Hurwitz numbers |
---|
525 | EXAMPLE: example generatingFunction; shows an example |
---|
526 | " |
---|
527 | { |
---|
528 | poly s =0; |
---|
529 | int j,jj; |
---|
530 | list pa,L; |
---|
531 | for (j=1; j<=d; j++) |
---|
532 | { |
---|
533 | pa = partitions(size(G.edges),j); |
---|
534 | L = computeGromovWitten(G,j,1,size(pa)); |
---|
535 | for (jj=1; jj<=size(pa); jj++) |
---|
536 | { |
---|
537 | s=s+L[jj]*monomial(pa[jj]); |
---|
538 | } |
---|
539 | } |
---|
540 | return(s); |
---|
541 | } |
---|
542 | example |
---|
543 | { "EXAMPLE:"; echo=2; |
---|
544 | ring R=(0,x1,x2),(q1,q2,q3),dp; |
---|
545 | graph G = makeGraph(list(1,2),list(list(1,2),list(1,2),list(1,2))); |
---|
546 | generatingFunction(G,3); |
---|
547 | } |
---|
548 | |
---|