This file is indexed.

/usr/share/singular/LIB/ellipticcovers.lib is in singular-data 4.0.3+ds-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
///////////////////////////////////////////////////////////////////////////////
version="version ellipticcovers.lib 4.0.0.0 Dec_2013 ";
category="Commutative Algebra";
info="
LIBRARY:  ellipticCovers.lib    Gromov-Witten numbers of elliptic curves

AUTHORS:  J. Boehm, boehm @ mathematik.uni-kl.de
          A. Buchholz, buchholz @ math.uni-sb.de
          H. Markwig   hannah @ math.uni-sb.de

OVERVIEW:

We implement a formula for computing the number of covers of elliptic curves.
It has beed obtained by proving mirror symmetry
for arbitrary genus by tropical methods in [BBM]. A Feynman graph of genus
g is a trivalent, connected graph of genus g (with 2g-2 vertices
and 3g-3 edges). The branch type b=(b_1,...,b_(3g-3)) of a stable map is the
multiplicity of the the edge i over a fixed base point.

Given a Feynman graph G and a branch type b, we obtain the number
N_(G,b) of stable maps of branch type b from a genus g curve of topological type G
to the elliptic curve by computing a path integral
over a rational function. The path integral is computed as a residue.

The sum of N_(G,b) over all branch types b of sum d gives N_(G,d)*|Aut(G)|, with the
Gromov-Witten invariant N_(G,d) of degree d stable maps from a genus g curve
of topological type G to the elliptic curve.

The sum of N_(G,d) over all such graphs gives the usual Gromov-Witten invariant N_(g,d)
of degree d stable maps from a genus g curve to the elliptic curve.

The key function computing the numbers N_(G,b) and N_(G,d) is gromovWitten.

REFERENCES:

[BBM] J. Boehm, A. Buchholz, H. Markwig: Tropical mirror symmetry for elliptic curves, arXiv:1309.5893 (2013).

KEYWORDS:
tropical geometry; mirror symmetry; tropical mirror symmetry; Gromov-Witten invariants; elliptic curves; propagator; Feynman graph; path integral

TYPES:

graph

PROCEDURES:

makeGraph(list, list)                     generate a graph from a list of vertices and a lsit of edges
printGraph(graph)                         print procedure for graphs
propagator(list,int)                      propagator factor of degree d in the quotient of two variables, or
                                          propagator for fixed graph and branch type
computeConstant(number, number)           constant coefficient in the Laurent series expansion of a rational function in a given variable
evalutateIntegral(number, list)           path integral for a given propagator and ordered sequence of variables
gromovWitten(number)                      sum of path integrals for a given propagator over all orderings of the variables, or
                                          Gromov Witten invariant for a given graph and a fixed branch type, or
                                          list of Gromov Witten invariants for a given graph and all branch types
computeGromovWitten(graph, int, int)      compute the Gromov Witten invariants for a given graph and some branch types
generatingFunction (graph, int)           multivariate generating function for the Gromov Witten invariants of a graph up to fixed degree

partitions(int, int)                      partitions of an integer into a fixed number of summands
permute(list)                             all permutations of a list
lsum(list)                                sum of the elements of a list

";


LIB "parallel.lib";


proc mod_init()
{
newstruct("graph","list vertices, list edges");
newstruct("Net","list rows");

system("install","graph","print",printGraph,1);
system("install","Net","print",printNet,1);
system("install","Net","+",catNet,2);

}


static proc catNet(Net N, Net M)
{
list L;
list LN=N.rows;
list LM=M.rows;
int widthN=size(LN[1]);
int widthM=size(LM[1]);
int nm=max(size(LN),size(LM));
for (int j=1; j<=nm; j++)
{
    if (j>size(LN)){LN[j]=emptyString(widthN);}
    if (j>size(LM)){LM[j]=emptyString(widthM);}
    L[j]=LN[j]+LM[j];
}
Net NM;
NM.rows=L;
return(NM);}


static proc netList(list L1)
{
  Net N=net("[");
  for (int j=1; j<=size(L1)-1; j++)
  {
     N=N+net(L1[j])+net(", ");
  }
  N=N+net(L1[size(L1)])+net("]");
  return(N);
}

static proc printNet(Net N)
{
list L = N.rows;
for (int j=1; j<=size(L); j++)
{
   print(L[j]);
}
}

static proc net(def M){
  if (typeof(M)=="list"){
    return(netList(M));
  }
  Net N;
  list L;
  L[1]=string(M);
  N.rows=L;
return(N);}



proc printGraph(graph G)
"USAGE:  printGraph(G); G graph@*
ASSUME:  G is a graph.
THEORY:  This is the print function used by Singular to print a graph.
KEYWORDS: graph
EXAMPLE:  example printGraph; shows an example
"
{
  print(netList(G.edges));
  print("Graph with "+string(size(G.vertices))+" vertices and "+string(size(G.edges))+" edges")
}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
  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)));
  G;
}



proc makeGraph(list v, list e)
"USAGE:  makeGraph(v,e); v list, e list@*
ASSUME:  v is a list of integers, e is a list of two element lists of v.
RETURN:  graph with vertices v and edges e
THEORY:  Creates a graph from a list of vertices and edges. The vertices can be any type.
KEYWORDS: graph
EXAMPLE:  example printGraph; shows an example
"
{
  graph G;
  G.vertices = v;
  G.edges = e;
  return(G);
}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
  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)));
  G;
}


proc propagator(def xy, def d)
"USAGE:  propagator(xy,d); xy list, d int@*
         propagator(G,b); G graph, b list@*
ASSUME:  xy is a list of two numbers x and y in a rational function field, d non-negative integer.@*
         G is a Feynman graph, a is a list of integers of length equal to the number of edges of G.@*
         We assume that the coefficient ring has one rational variable for each vertex of G.
RETURN:  number, the propagator associated to the input data.
THEORY:  If xy and d are specified, then the function returns x^2*y^2/(x^2-y^2)^2) for d=0, which
         is a associated to an edge with vertices x and y not passing above the base point.
         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,
         which is associated to an edge with vertices x and y passing with multiplicity d above the base point.

         Essentially the variables x and y stand for the position of the base points.

         In the second way of using this function, G is a Feynman graph and b is a branch type
         over a fixed base point of a cover with source G and target an elliptic curve. It returns the
         product of propagator(list(v[i],w[i]),b[i]) over all edges i with multiplicity b[i] over the base point
         and vertices v[i] and w[i].

KEYWORDS: elliptic curve
EXAMPLE:  example propagator; shows an example
"
{
  if ((typeof(xy)=="list")||(typeof(d)=="int")) {
    number x = xy[1];
    number y = xy[2];
    if (d<0) {ERROR("expected non-negative degree");}
    if (d==0) {return(x^2*y^2/(x^2-y^2)^2);}
    number p=0;
    for (int j=1; j<=d; j++){
       if (d%j==0){p=p+(j*x^(4*j)+j*y^(4*j))/(x*y)^(2*j);}
    }
    return(p);
  }
  if ((typeof(xy)=="graph")||(typeof(d)=="list"))  {
    list xl = ringlist(basering)[1][2];
    list ed = xy.edges;
    number f=1;
    for (int j=1; j<=size(ed); j++){
       execute("number xx1 = "+xl[ed[j][1]]);
       execute("number xx2 = "+xl[ed[j][2]]);
       f=f*propagator(list(xx1,xx2),d[j]);
       kill xx1;
       kill xx2;
    }
    return(f);
  }
  if ((typeof(xy)=="graph")||(typeof(d)=="int"))  {
  }
ERROR("wrong input type");}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
  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)));
  propagator(list(x1,x2),0);
  propagator(list(x1,x2),2);
  propagator(G,list(1,1,1,0,0,0));
}





proc computeConstant(number f,number xx)
"USAGE:  computeConstant(f,x); f number, x number@*
ASSUME:  f is a number in a rational function field, x is a variable of the field.@*
RETURN:  number, the constant coefficient of the Laurent series of f in the variable x.
THEORY:  Computes the constant coefficient of the Laurent series by iterative differentiation.

KEYWORDS: Laurent series
EXAMPLE:  example computeConstant; shows an example
"
{
  int tst=0;
  number ff=f;
  int k;
  int j;
  poly de;
  while (tst==0){
     ff=f*xx^k;
     for (j=1; j<=k; j++){
        ff=diff(ff,xx)/j;
     }
  de = subst(denominator(ff),xx,0);
  if (de!=0){
     poly nu = subst(numerator(ff),xx,0);
     return(number(nu/de));
  }
  k=k+1;
  }
ERROR("error in computeConstant");}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
  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)));
  number P = propagator(G,list(1,1,1,0,0,0));
  computeConstant(P,x2);
}




proc evaluateIntegral(number P, list xL)
"USAGE:  evaluateIntegral(P,xx); P number, xx list@*
ASSUME:  P is a number in a rational function field, xx is a list of variables of the field@*
RETURN:  number, the constant coefficient of the Laurent series of f in the variables in the list xx.
THEORY:  Computes the constant coefficient of the Laurent series iteratively for the elements of xx.

         In the setting of covers of elliptic curves this is the path integral over the
         propagator divided by the product of all variables (corresponding to the vertices)
         computed as a residue.

KEYWORDS: residue; Laurent series
EXAMPLE:  example evaluateIntegral; shows an example
"
{
  number p = P;
  for(int j=1; j<=size(xL); j++){
     p=computeConstant(p,xL[j]);
  }
return(p);}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
  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)));
  number p = propagator(G,list(0,2,1,0,0,1));
  evaluateIntegral(p,list(x1,x3,x4,x2));
}


proc permute (list N)
"USAGE:  permute(N); N list@*
ASSUME:  N is a list@*
RETURN:  list with all permutations of N.
THEORY:  Computes all permutations of N.

         This will eventually be deleted and become a more efficient kernel function.

KEYWORDS: permutations
EXAMPLE:  example permute; shows an example
"
{
   int i,j,k;
   list L,L1;
   if (size(N)==1){
     return(list(N));
   } else {
     k=1;
     for (i=1; i<=size(N); i++){
       L=permute(delete(N,i));
       for (j=1; j<=size(L); j++){
          L1[k]=L[j]+list(N[i]);
          k=k+1;
       }
     }
   }
return(L1);}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2,x3,x4),(q),dp;
  permute(list(x1,x2,x3,x4));
}



proc partitions(int n, int a)
"USAGE:  partitions(n,a); n int, a int@*
ASSUME:  n and a  are positive integers@*
RETURN:  list of all partitions of a into n summands.
THEORY:  Computes all partitions of a into n summands.

         This may eventually be deleted and become a more efficient kernel function.

KEYWORDS: partitions
EXAMPLE:  example partitions; shows an example
"
{
ring R = 2,(x(1..n)),dp;
ideal I = maxideal(a);
list L;
for (int j=1;j<=size(I);j++){
  L[j]=leadexp(I[j]);
}
return(L);}
example
{ "EXAMPLE:"; echo=2;
  partitions(3,7);
}



proc gromovWitten(def P,list #)
"USAGE:  gromovWitten(P); P number@*
         gromovWitten(G,d); G graph, d int@*
         gromovWitten(G,b); G graph, b list@*
ASSUME:  P is a propagator, or @*
         G is a Feynman graph and d a non-negative integer, or@*
         G is a Feynman graph and b is a list of integers of length equal to the number of edges of G@*
         We assume that the coefficient ring has one rational variable for each vertex of G.@*
RETURN:  Gromov-Witten invariant.
THEORY:  Computes @*

         - the Gromov-Witten invariant of a given propagator P, or @*

         - the invariant N_(G,d)*|Aut(G)| where d is the degree of the covering, or @*

         - the number N_(G,b) of coverings with source G and target an elliptic curves with branch type a over a
         fixed base point (that is, the i-th edge passes over the base point with multiplicity b[i]).@*

KEYWORDS: Gromov-Witten invariants; elliptic curves; coverings; Hurwitz numbers
EXAMPLE:  example gromovWitten; shows an example
"
{
  if (typeof(P)=="number") {
  list xl = ringlist(basering)[1][2];
  int j;
  for(j=1; j<=size(xl); j++){
     execute("number n= "+xl[j]);
     xl[j]=n;
     kill n;
  }
  list pxl = permute(xl);
  number p = 0;
  for(j=1; j<=size(pxl); j++){
     p=p+evaluateIntegral(P,pxl[j]);
  }
  return(p);
  }
  if (typeof(P)=="graph"){
     if (size(#)>1){
       return(gromovWitten(propagator(P,#)));
     } else {
      int d =#[1];
      list pa = partitions(size(P.edges),d);
      list re;
      int ti;
      for (int j=1; j<=size(pa); j++) {
       ti=timer;
       re[j]=gromovWitten(propagator(P,pa[j]));
       ti=timer-ti;
       //print(string(j)+" / "+string(size(pa))+"    "+string(pa[j])+"     "+string(re[j])+"      "+string(sum(re))+"     "+string(ti));
      }
     return(lsum(re));
     }
  }
}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
  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)));
  number P = propagator(G,list(0,2,1,0,0,1));
  gromovWitten(P);
  gromovWitten(G,list(0,2,1,0,0,1));
  gromovWitten(G,2);
}



proc computeGromovWitten(graph P,int d, int st, int en, list #)
"USAGE:  computeGromovWitten(G, d, st, en [, vb] ); G graph, d int, st int, en  int, optional: vb int@*
ASSUME:  G is a Feynman graph, d a non-negative integer, st specified the start- and en the end partition
         in the list pa = partition(d). Specifying a positive optional integer vb leads to intermediate printout.@*
         We assume that the coefficient ring has one rational variable for each vertex of G.@*
RETURN:  list L, where L[i] is gromovWitten(G,pa[i]) and all others are zero.
THEORY:  This function does essentially the same as the function gromovWitten, but is designed for handling complicated examples.
         Eventually it will also run in parallel.@*

KEYWORDS: Gromov-Witten invariants; elliptic curves; coverings; Hurwitz numbers
EXAMPLE:  example computeGromovWitten; shows an example
"
{
     number s =0;
     list pararg;
     list re;
     list pa = partitions(size(P.edges),d);
     int vb=0;
     if (size(#)>0){vb=#[1];}
     int ti;
     if (vb>0){print(size(pa));}
     for (int j=1; j<=size(pa); j++) {
      if ((j>=st)&(j<=en)){
       ti=timer;
       //pararg[j]=list(propagator(G,pa[j]));
       re[j]=gromovWitten(propagator(P,pa[j]));
       ti=timer-ti;
       if (vb>0){print(string(j)+" / "+string(size(pa))+"    "+string(pa[j])+"     "+string(re[j])+"      "+string(lsum(re))+"     "+string(ti));}
      } else {re[j]=s;}
     }
     //list re = parallelWaitAll("gromovWitten", pararg, list(list(list(2))));
     return(re);
}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
  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)));
  partitions(6,2);
  computeGromovWitten(G,2,3,7);
  computeGromovWitten(G,2,3,7,1);
}


proc lsum(list L)
"USAGE:  lsum(L); L list@*
ASSUME:  L is a list of things with the binary operator + defined.@*
RETURN:  The sum of the elements of L.
THEORY:  Sums the elements of a list.

         Eventually this will be deleted and become a more efficient kernel function.@*

EXAMPLE:  example lsum; shows an example
"
{
  execute(typeof(L[1])+" s");
  for(int j=1; j<=size(L); j++){
     s=s+L[j];
  }
return(s);}
example
{ "EXAMPLE:"; echo=2;
  list L = 1,2,3,4,5;
  lsum(L);
}



proc generatingFunction(graph G, int d)
"USAGE:  generatingFunction(G, d); G graph, d int@*
ASSUME:  G is a Feynman graph, d a non-negative integer. The basering has one polynomial variable for each
         edge, and the coefficient ring has one rational variable for each vertex.@*
RETURN:  poly.
THEORY:  This function compute the multivariate generating function of all Gromov-Witten invariants up to
         degree d, that is, the sum of all gromovWitten(G,b)*q^b.@*

KEYWORDS: generating function; Gromov-Witten invariants; elliptic curves; coverings; Hurwitz numbers
EXAMPLE:  example generatingFunction; shows an example
"
{
  poly  s =0;
  int j,jj;
  list pa,L;
  for (j=1; j<=d; j++){
    pa = partitions(size(G.edges),j);
    L = computeGromovWitten(G,j,1,size(pa));
    for (jj=1; jj<=size(pa); jj++) {
       s=s+L[jj]*monomial(pa[jj]);
    }
  }
return(s);}
example
{ "EXAMPLE:"; echo=2;
  ring R=(0,x1,x2),(q1,q2,q3),dp;
  graph G = makeGraph(list(1,2),list(list(1,2),list(1,2),list(1,2)));
  generatingFunction(G,3);
}