Changeset 6ba2a39 in git for Singular


Ignore:
Timestamp:
Oct 14, 2013, 11:52:07 AM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ac665c6c03e4e4354b586d1fd770d8d5669253cf
Parents:
f29e226d38b79f8a047c6d968c419de9ce584fb7
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-10-14 11:52:07+02:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-10-14 11:55:23+02:00
Message:
chg: new version of schubert.lib
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/schubert.lib

    rf29e22 r6ba2a39  
    44category="Algebraic Geometry";
    55info="
    6 LIBRARY:    Schubert.lib   Proceduces for Intersection Theory
    7 
    8 AUTHOR:     Hiep Dang,  email: hiep@mathematik.uni-kl.de
     6LIBRARY:    Schubert.lib    Proceduces for Intersection Theory
     7
     8AUTHOR:     Hiep Dang,      email: hiep@mathematik.uni-kl.de
    99
    1010OVERVIEW:
    1111
    12     We implement two new classes (variety and sheaf) and methods for computing
    13     with them. Here a variety is represented by the dimension and the Chow ring.
    14     A sheaf on a variety is represented by the Chern character.
    15 
     12    We implement new classes (variety, sheaf, stack, graph) and methods for
     13    computing with them. Here a variety is represented by a nonnegative integer
     14    which is its dimension and a graded ring which is its Chow ring. A sheaf is
     15    represented by a variety and a polynomial which is its Chern character.
    1616    In particular, we implement the concrete varieties such as projective spaces
    17     , Grassmannians, and projective bundles. Finally, the most important thing
    18     is a method for computing the intersection numbers (degrees of 0-cycles).
    19 
     17    , Grassmannians, and projective bundles.
     18
     19<<<<<<< HEAD
    2020PROCEDURES:
    2121    makeVariety(int,ideal)            create a variety
     
    3939    minusSheaf(sheaf,sheaf)           the quotient of two sheaves
    4040    plusSheaf(sheaf,sheaf)            the direct sum of two sheaves
     41=======
     42    An important task of this library is related to the computation of
     43    Gromov-Witten invariants. In particular, we implement new tools for the
     44    computation in equivariant intersection theory. These tools are based on the
     45    localization of moduli spaces of stable maps and Bott's formula. They are
     46    useful for the computation of Gromov-Witten invariants. In order to do this,
     47    we have to deal with moduli spaces of stable maps, which were introduced by
     48    Kontsevich, and the graphs corresponding to the fixed point components of a
     49    torus action on the moduli spaces of stable maps.
     50>>>>>>> 2ba3231... chg: new version of schubert.lib
    4151
    4252REFERENCES:
     
    5262                intersection theory, 2010.
    5363
    54 KEYWORDS:        Intersection Theory, Enumerative Geometry, Schubert Calculus
     64    Maxim Kontsevich, Enumeration of rational curves via torus actions, 1995.
     65
     66PROCEDURES:
     67    mod_init()                          create new objects in this library
     68    makeVariety(int,ideal)              create a variety
     69    printVariety(variety)               print procedure for a variety
     70    productVariety(variety,variety)     make the product of two varieties
     71    ChowRing(variety)                   create the Chow ring of a variety
     72    Grassmannian(int,int)               create a Grassmannian as a variety
     73    projectiveSpace(int)                create a projective space as a variety
     74    projectiveBundle(sheaf)             create a projective bundle as a variety
     75    integral(variety,poly)              degree of a 0-cycle on a variety
     76    makeSheaf(variety,poly)             create a sheaf
     77    printSheaf(sheaf)                   print procedure for sheaves
     78    rankSheaf(sheaf)                    return the rank of a sheaf
     79    totalChernClass(sheaf)              compute the total Chern class of a sheaf
     80    ChernClass(sheaf,int)               compute the k-th Chern class of a sheaf
     81    topChernClass(sheaf)                compute the top Chern class of a sheaf
     82    totalSegreClass(sheaf)              compute the total Segre class of a sheaf
     83    dualSheaf(sheaf)                    make the dual of a sheaf
     84    tensorSheaf(sheaf,sheaf)            make the tensor of two sheaves
     85    symmetricPowerSheaf(sheaf,int)      make the k-th symmetric power of a sheaf
     86    quotSheaf(sheaf,sheaf)              make the quotient of two sheaves
     87    addSheaf(sheaf,sheaf)               make the direct sum of two sheaves
     88    makeGraph(list,list)                create a graph from a list of vertices
     89                                        and a list of edges
     90    printGraph(graph)                   print procedure for graphs
     91    moduliSpace(variety,int)            create a moduli space of stable maps as
     92                                        an algebraic stack
     93    printStack(stack)                   print procedure for stacks
     94    dimStack(stack)                     compute the dimension of a stack
     95    fixedPoints(stack)                  compute the list of graphs corresponding
     96                                        the fixed point components of a torus
     97                                        action on the stack
     98    contributionBundle(stack,graph)     compute the contribution bundle on a
     99                                        stack at a graph
     100    normalBundle(stack,graph)           compute the normal bundle on a stack at
     101                                        a graph
     102    multipleCover(int)                  compute the contribution of multiple
     103                                        covers of a smooth rational curve as a
     104                                        Gromov-Witten invariant
     105    linesHypersurface(int)              compute the number of lines on a general
     106                                        hypersurface
     107    rationalCurve(int,list)             compute the Gromov-Witten invariant
     108                                        corresponding the number of rational
     109                                        curves on a general Calabi-Yau threefold
     110    part(poly,int)                      compute a homogeneous component of a
     111                                        polynomial.
     112    parts(poly,int,int)                 compute the sum of homogeneous
     113                                        components of a polynomial
     114    logg(poly,int)                      compute Chern characters from total
     115                                        Chern classes.
     116    expp(poly,int)                      compute total Chern classes from Chern
     117                                        characters
     118    SchubertClass(list)                 compute the Schubert classes on a
     119                                        Grassmannian
     120    dualPartition(list)                 compute the dual of a partition
     121
     122KEYWORDS:       Intersection Theory; Enumerative Geometry; Schubert Calculus;
     123                Bott's formula.
     124
    55125";
    56126
     
    61131
    62132////////////////////////////////////////////////////////////////////////////////
    63 /// create new classes: varieties and sheaves //////////////////////////////////
     133/////////// create new objects in this library  ////////////////////////////////
    64134////////////////////////////////////////////////////////////////////////////////
    65135
    66136proc mod_init()
     137"USAGE:     mod_init();
     138THEORY:     This is to create new objects in this library such as variety,
     139            sheaf, stack, and graph.
     140KEYWORDS:   variety, sheaf, stack, graph
     141EXAMPLE:    example mod_init(); shows an example
     142"
    67143{
    68144    newstruct("variety","int dimension, ring baseRing, ideal relations");
    69145    newstruct("sheaf","variety currentVariety, poly ChernCharacter");
    70 
    71     system("install","variety","print",variety_print,1);
     146    newstruct("graph","list vertices, list edges");
     147    newstruct("stack","variety currentVariety, int degreeCurve");
     148
     149    system("install","variety","print",printVariety,1);
    72150    system("install","variety","*",productVariety,2);
    73     system("install","sheaf","print",sheaf_print,1);
     151    system("install","sheaf","print",printSheaf,1);
    74152    system("install","sheaf","*",tensorSheaf,2);
    75     system("install","sheaf","+",plusSheaf,2);
    76     system("install","sheaf","-",minusSheaf,2);
     153    system("install","sheaf","+",addSheaf,2);
     154    system("install","sheaf","-",quotSheaf,2);
     155    system("install","sheaf","^",symmetricPowerSheaf,2);
     156    system("install","graph","print",printGraph,1);
     157    system("install","stack","print",printStack,1);
     158}
     159example
     160{
     161    "EXAMPLE:"; echo=2;
     162    mod_init();
     163}
     164
     165////////////////////////////////////////////////////////////////////////////////
     166//////// Procedures concerned with moduli spaces of stable maps ////////////////
     167////////////////////////////////////////////////////////////////////////////////
     168
     169proc printStack(stack M)
     170"USAGE:     printStack(M); M stack
     171ASSUME:     M is a moduli space of stable maps.
     172THEORY:     This is the print function used by Singular to print a stack.
     173KEYWORDS:   stack, moduli space of stable maps
     174EXAMPLE:    example printStack; shows an example
     175"
     176{
     177    "A moduli space of dimension", dimStack(M);
     178}
     179example
     180{
     181    "EXAMPLE:"; echo=2;
     182    ring r = 0,(x),dp;
     183    variety P = projectiveSpace(4);
     184    stack M = moduliSpace(P,2);
     185    M;
     186}
     187
     188proc moduliSpace(variety V, int d)
     189"USAGE:     moduliSpace(V,d); V variety, d int
     190ASSUME:     V is a projective space and d is a positive integer.
     191THEORY:     This is the function used by Singular to create a moduli space of
     192            stable maps from a genus zero curve to a projective space.
     193KEYWORDS:   stack, moduli space of stable maps, rational curves
     194EXAMPLE:    example moduliSpace; shows an example
     195"
     196{
     197    stack M;
     198    M.currentVariety = V;
     199    M.degreeCurve = d;
     200    return(M);
     201}
     202example
     203{
     204    "EXAMPLE:"; echo=2;
     205    ring r = 0,(x),dp;
     206    variety P = projectiveSpace(4);
     207    stack M = moduliSpace(P,2);
     208    M;
     209}
     210
     211proc dimStack(stack M)
     212"USAGE:     dimStack(M); M stack
     213RETURN:     int
     214INPUT:      M is a moduli space of stable maps.
     215OUTPUT:     the dimension of moduli space of stable maps.
     216KEYWORDS:   dimension, moduli space of stable maps, rational curves
     217EXAMPLE:    example dimStack; shows an example
     218"
     219{
     220    variety V = M.currentVariety;
     221    int n = V.dimension;
     222    int d = M.degreeCurve;
     223    return (n*d+n+d-3);
     224}
     225example
     226{
     227    "EXAMPLE:"; echo=2;
     228    ring r = 0,(x),dp;
     229    variety P = projectiveSpace(4);
     230    stack M = moduliSpace(P,2);
     231    dimStack(M);
     232}
     233
     234proc fixedPoints(stack M)
     235"USAGE:     fixedPoints(M); M stack
     236RETURN:     list
     237INPUT:      M is a moduli space of stable maps.
     238OUTPUT:     a list of graphs corresponding the fixed point components of a torus
     239            action on a moduli space of stable maps.
     240KEYWORDS:   fixed points, moduli space of stable maps, graph
     241EXAMPLE:    example fixedPoints; shows an example
     242"
     243{
     244    int i,j,k,h,m,n,p;
     245    list l;
     246    int d = M.degreeCurve;
     247    variety V = M.currentVariety;
     248    int r = V.dimension;
     249    for (i=0;i<=r;i++)
     250    {
     251        for (j=0;j<=r;j++)
     252        {
     253            if (i <> j)
     254            {
     255                l = insert(l,list(graph1(d,i,j),2*d),size(l));
     256            }
     257        }
     258    }
     259    if (d == 2)
     260    {
     261        for (i=0;i<=r;i++)
     262        {
     263            for (j=0;j<=r;j++)
     264            {
     265                for (k=0;k<=r;k++)
     266                {
     267                    if (i <> j and j <> k)
     268                    {
     269                        l = insert(l,list(graph2(list(1,1),i,j,k),2),size(l));
     270                    }
     271                }
     272            }
     273        }
     274    }
     275    if (d == 3)
     276    {
     277        for (i=0;i<=r;i++)
     278        {
     279            for (j=0;j<=r;j++)
     280            {
     281                for (k=0;k<=r;k++)
     282                {
     283                    if (i <> j and j <> k)
     284                    {
     285                        l = insert(l,list(graph2(list(2,1),i,j,k),2),size(l));
     286                        for (h=0;h<=r;h++)
     287                        {
     288                            if (h <> k)
     289                            {
     290                                l = insert(l,list(graph31(list(1,1,1),i,j,k,h),2),size(l));
     291                            }
     292                            if (h <> j)
     293                            {
     294                                l = insert(l,list(graph32(list(1,1,1),i,j,k,h),6),size(l));
     295                            }
     296                        }
     297                    }
     298                }
     299            }
     300        }
     301    }
     302    if (d == 4)
     303    {
     304        for (i=0;i<=r;i++)
     305        {
     306            for (j=0;j<=r;j++)
     307            {
     308                for (k=0;k<=r;k++)
     309                {
     310                    if (i <> j and j <> k)
     311                    {
     312                        l = insert(l,list(graph2(list(3,1),i,j,k),3),size(l));
     313                        l = insert(l,list(graph2(list(2,2),i,j,k),8),size(l));
     314                        for (h=0;h<=r;h++)
     315                        {
     316                            if (h <> k)
     317                            {
     318                                l = insert(l,list(graph31(list(2,1,1),i,j,k,h),2),size(l));
     319                                l = insert(l,list(graph31(list(1,2,1),i,j,k,h),4),size(l));
     320                            }
     321                            if (h <> j)
     322                            {
     323                                l = insert(l,list(graph32(list(2,1,1),i,j,k,h),4),size(l));
     324                            }
     325                            for (m=0;m<=r;m++)
     326                            {
     327                                if (k <> h and m <> h)
     328                                {
     329                                    l = insert(l,list(graph41(list(1,1,1,1),i,j,k,h,m),2),size(l));
     330                                }
     331                                if (k <> h and m <> k)
     332                                {
     333                                    l = insert(l,list(graph42(list(1,1,1,1),i,j,k,h,m),2),size(l));
     334                                }
     335                                if (h <> j and m <> j)
     336                                {
     337                                    l = insert(l,list(graph43(list(1,1,1,1),i,j,k,h,m),24),size(l));
     338                                }
     339                            }
     340                        }
     341                    }
     342                }
     343            }
     344        }
     345    }
     346    if (d == 5)
     347    {
     348        for (i=0;i<=r;i++)
     349        {
     350            for (j=0;j<=r;j++)
     351            {
     352                for (k=0;k<=r;k++)
     353                {
     354                    if (i <> j and j <> k)
     355                    {
     356                        l = insert(l,list(graph2(list(4,1),i,j,k),4),size(l));
     357                        l = insert(l,list(graph2(list(3,2),i,j,k),6),size(l));
     358                        for (h=0;h<=r;h++)
     359                        {
     360                            if (k <> h)
     361                            {
     362                                l = insert(l,list(graph31(list(3,1,1),i,j,k,h),3),size(l));
     363                                l = insert(l,list(graph31(list(1,3,1),i,j,k,h),6),size(l));
     364                                l = insert(l,list(graph31(list(2,2,1),i,j,k,h),4),size(l));
     365                                l = insert(l,list(graph31(list(2,1,2),i,j,k,h),8),size(l));
     366                            }
     367                            if (j <> h)
     368                            {
     369                                l = insert(l,list(graph32(list(3,1,1),i,j,k,h),6),size(l));
     370                                l = insert(l,list(graph32(list(2,2,1),i,j,k,h),8),size(l));
     371                            }
     372                            for (m=0;m<=r;m++)
     373                            {
     374                                if (k <> h and h <> m)
     375                                {
     376                                    l = insert(l,list(graph41(list(2,1,1,1),i,j,k,h,m),2),size(l));
     377                                    l = insert(l,list(graph41(list(1,2,1,1),i,j,k,h,m),2),size(l));
     378                                }
     379                                if (k <> h and k <> m)
     380                                {
     381                                    l = insert(l,list(graph42(list(2,1,1,1),i,j,k,h,m),4),size(l));
     382                                    l = insert(l,list(graph42(list(1,2,1,1),i,j,k,h,m),4),size(l));
     383                                    l = insert(l,list(graph42(list(1,1,2,1),i,j,k,h,m),2),size(l));
     384                                }
     385                                if (j <> h and j <> m)
     386                                {
     387                                    l = insert(l,list(graph43(list(2,1,1,1),i,j,k,h,m),12),size(l));
     388                                }
     389                                for (n=0;n<=r;n++)
     390                                {
     391                                    if (k <> h and h <> m and m <> n)
     392                                    {
     393                                        l = insert(l,list(graph51(list(1,1,1,1,1),i,j,k,h,m,n),2),size(l));
     394                                    }
     395                                    if (k <> h and h <> m and h <> n)
     396                                    {
     397                                        l = insert(l,list(graph52(list(1,1,1,1,1),i,j,k,h,m,n),2),size(l));
     398                                    }
     399                                    if (k <> h and k <> m and k <> n)
     400                                    {
     401                                        l = insert(l,list(graph53(list(1,1,1,1,1),i,j,k,h,m,n),6),size(l));
     402                                    }
     403                                    if (j <> h and h <> m and h <> n)
     404                                    {
     405                                        l = insert(l,list(graph54(list(1,1,1,1,1),i,j,k,h,m,n),8),size(l));
     406                                    }
     407                                    if (k <> h and k <> m and h <> n)
     408                                    {
     409                                        l = insert(l,list(graph55(list(1,1,1,1,1),i,j,k,h,m,n),2),size(l));
     410                                    }
     411                                    if (j <> h and j <> m and j <> n)
     412                                    {
     413                                        l = insert(l,list(graph56(list(1,1,1,1,1),i,j,k,h,m,n),120),size(l));
     414                                    }
     415                                }
     416                            }
     417                        }
     418                    }
     419                }
     420            }
     421        }
     422    }
     423    if (d == 6)
     424    {
     425        for (i=0;i<=r;i++)
     426        {
     427            for (j=0;j<=r;j++)
     428            {
     429                for (k=0;k<=r;k++)
     430                {
     431                    if (i <> j and j <> k)
     432                    {
     433                        l = insert(l,list(graph2(list(5,1),i,j,k),5),size(l));
     434                        l = insert(l,list(graph2(list(4,2),i,j,k),8),size(l));
     435                        l = insert(l,list(graph2(list(3,3),i,j,k),18),size(l));
     436                        for (h=0;h<=r;h++)
     437                        {
     438                            if (k <> h)
     439                            {
     440                                l = insert(l,list(graph31(list(4,1,1),i,j,k,h),4),size(l));
     441                                l = insert(l,list(graph31(list(1,4,1),i,j,k,h),8),size(l));
     442                                l = insert(l,list(graph31(list(3,2,1),i,j,k,h),6),size(l));
     443                                l = insert(l,list(graph31(list(3,1,2),i,j,k,h),6),size(l));
     444                                l = insert(l,list(graph31(list(1,3,2),i,j,k,h),6),size(l));
     445                                l = insert(l,list(graph31(list(2,2,2),i,j,k,h),16),size(l));
     446                            }
     447                            if (j <> h)
     448                            {
     449                                l = insert(l,list(graph32(list(4,1,1),i,j,k,h),8),size(l));
     450                                l = insert(l,list(graph32(list(3,2,1),i,j,k,h),6),size(l));
     451                                l = insert(l,list(graph32(list(2,2,2),i,j,k,h),48),size(l));
     452                            }
     453                            for (m=0;m<=r;m++)
     454                            {
     455                                if (k <> h and h <> m)
     456                                {
     457                                    l = insert(l,list(graph41(list(3,1,1,1),i,j,k,h,m),3),size(l));
     458                                    l = insert(l,list(graph41(list(1,3,1,1),i,j,k,h,m),3),size(l));
     459                                    l = insert(l,list(graph41(list(2,2,1,1),i,j,k,h,m),4),size(l));
     460                                    l = insert(l,list(graph41(list(2,1,2,1),i,j,k,h,m),4),size(l));
     461                                    l = insert(l,list(graph41(list(2,1,1,2),i,j,k,h,m),8),size(l));
     462                                    l = insert(l,list(graph41(list(1,2,2,1),i,j,k,h,m),8),size(l));
     463                                }
     464                                if (k <> h and k <> m)
     465                                {
     466                                    l = insert(l,list(graph42(list(3,1,1,1),i,j,k,h,m),6),size(l));
     467                                    l = insert(l,list(graph42(list(1,3,1,1),i,j,k,h,m),6),size(l));
     468                                    l = insert(l,list(graph42(list(1,1,3,1),i,j,k,h,m),3),size(l));
     469                                    l = insert(l,list(graph42(list(2,2,1,1),i,j,k,h,m),8),size(l));
     470                                    l = insert(l,list(graph42(list(1,1,2,2),i,j,k,h,m),8),size(l));
     471                                    l = insert(l,list(graph42(list(2,1,2,1),i,j,k,h,m),4),size(l));
     472                                    l = insert(l,list(graph42(list(1,2,2,1),i,j,k,h,m),4),size(l));
     473                                }
     474                                if (j <> h and j <> m)
     475                                {
     476                                    l = insert(l,list(graph43(list(3,1,1,1),i,j,k,h,m),18),size(l));
     477                                    l = insert(l,list(graph43(list(2,2,1,1),i,j,k,h,m),16),size(l));
     478                                }
     479                                for (n=0;n<=r;n++)
     480                                {
     481                                    if (k <> h and h <> m and m <> n)
     482                                    {
     483                                        l = insert(l,list(graph51(list(2,1,1,1,1),i,j,k,h,m,n),2),size(l));
     484                                        l = insert(l,list(graph51(list(1,2,1,1,1),i,j,k,h,m,n),2),size(l));
     485                                        l = insert(l,list(graph51(list(1,1,2,1,1),i,j,k,h,m,n),4),size(l));
     486                                    }
     487                                    if (k <> h and h <> m and h <> n)
     488                                    {
     489                                        l = insert(l,list(graph52(list(2,1,1,1,1),i,j,k,h,m,n),4),size(l));
     490                                        l = insert(l,list(graph52(list(1,2,1,1,1),i,j,k,h,m,n),4),size(l));
     491                                        l = insert(l,list(graph52(list(1,1,2,1,1),i,j,k,h,m,n),4),size(l));
     492                                        l = insert(l,list(graph52(list(1,1,1,2,1),i,j,k,h,m,n),2),size(l));
     493                                    }
     494                                    if (k <> h and k <> m and k <> n)
     495                                    {
     496                                        l = insert(l,list(graph53(list(2,1,1,1,1),i,j,k,h,m,n),12),size(l));
     497                                        l = insert(l,list(graph53(list(1,2,1,1,1),i,j,k,h,m,n),12),size(l));
     498                                        l = insert(l,list(graph53(list(1,1,2,1,1),i,j,k,h,m,n),4),size(l));
     499                                    }
     500                                    if (j <> h and h <> m and h <> n)
     501                                    {
     502                                        l = insert(l,list(graph54(list(2,1,1,1,1),i,j,k,h,m,n),4),size(l));
     503                                        l = insert(l,list(graph54(list(1,1,2,1,1),i,j,k,h,m,n),16),size(l));
     504                                    }
     505                                    if (k <> h and k <> m and h <> n)
     506                                    {
     507                                        l = insert(l,list(graph55(list(2,1,1,1,1),i,j,k,h,m,n),2),size(l));
     508                                        l = insert(l,list(graph55(list(1,2,1,1,1),i,j,k,h,m,n),2),size(l));
     509                                        l = insert(l,list(graph55(list(1,1,1,2,1),i,j,k,h,m,n),4),size(l));
     510                                    }
     511                                    if (j <> h and j <> m and j <> n)
     512                                    {
     513                                        l = insert(l,list(graph56(list(2,1,1,1,1),i,j,k,h,m,n),48),size(l));
     514                                    }
     515                                    for (p=0;p<=r;p++)
     516                                    {
     517                                        if (k <> h and h <> m and m <> n and n <> p)
     518                                        {
     519                                            l = insert(l,list(graph61(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2),size(l));
     520                                        }
     521                                        if (k <> h and h <> m and m <> n and m <> p)
     522                                        {
     523                                            l = insert(l,list(graph62(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2),size(l));
     524                                        }
     525                                        if (k <> h and h <> m and h <> n and n <> p)
     526                                        {
     527                                            l = insert(l,list(graph63(list(1,1,1,1,1,1),i,j,k,h,m,n,p),1),size(l));
     528                                        }
     529                                        if (k <> h and h <> m and h <> n and h <> p)
     530                                        {
     531                                            l = insert(l,list(graph64(list(1,1,1,1,1,1),i,j,k,h,m,n,p),6),size(l));
     532                                        }
     533                                        if (k <> h and k <> m and k <> n and n <> p)
     534                                        {
     535                                            l = insert(l,list(graph65(list(1,1,1,1,1,1),i,j,k,h,m,n,p),4),size(l));
     536                                        }
     537                                        if (k <> h and k <> m and m <> p and h <> n)
     538                                        {
     539                                            l = insert(l,list(graph66(list(1,1,1,1,1,1),i,j,k,h,m,n,p),6),size(l));
     540                                        }
     541                                        if (j <> h and h <> m and m <> n and m <> p)
     542                                        {
     543                                            l = insert(l,list(graph67(list(1,1,1,1,1,1),i,j,k,h,m,n,p),8),size(l));
     544                                        }
     545                                        if (j <> h and h <> m and h <> n and h <> p)
     546                                        {
     547                                            l = insert(l,list(graph68(list(1,1,1,1,1,1),i,j,k,h,m,n,p),12),size(l));
     548                                        }
     549                                        if (j <> h and h <> m and h <> n and n <> p)
     550                                        {
     551                                            l = insert(l,list(graph69(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2),size(l));
     552                                        }
     553                                        if (k <> h and k <> m and k <> n and k <> p)
     554                                        {
     555                                            l = insert(l,list(graph610(list(1,1,1,1,1,1),i,j,k,h,m,n,p),24),size(l));
     556                                        }
     557                                        if (j <> h and j <> m and j <> n and j <> p)
     558                                        {
     559                                            l = insert(l,list(graph611(list(1,1,1,1,1,1),i,j,k,h,m,n,p),720),size(l));
     560                                        }
     561                                    }
     562                                }
     563                            }
     564                        }
     565                    }
     566                }
     567            }
     568        }
     569    }
     570    return (l);
     571}
     572example
     573{
     574    "EXAMPLE:"; echo=2;
     575    ring r = 0,(x),dp;
     576    variety P = projectiveSpace(4);
     577    stack M = moduliSpace(P,2);
     578    def F = fixedPoints(M);
     579    size(F);
     580    typeof(F[1]) == "list";
     581    typeof(F[1][1]) == "graph";
     582    typeof(F[1][2]) == "int";
     583}
     584
     585static proc torusList(variety P)
     586"USAGE:     torusList(P); P variety
     587RETURN:     list
     588INPUT:      P is a projective space
     589OUTPUT:     a list of numbers
     590THEORY:     This is a procedure concerning the enumeration of rational curves.
     591KEYWORDS:   torus action
     592EXAMPLE:    example torusList; shows an example
     593"
     594{
     595    int i;
     596    int n = P.dimension;
     597    list l;
     598    for (i=0;i<=n;i++)
     599    {
     600        l = insert(l,number(5^i),size(l));
     601    }
     602    return (l);
     603}
     604example
     605{
     606    "EXAMPLE:"; echo=2;
     607    ring r = 0,(x),dp;
     608    variety P = projectiveSpace(4);
     609    def L = torusList(P);
     610    L;
     611}
     612
     613proc contributionBundle(stack M, graph G, list #)
     614"USAGE:     contributionBundle(M,G,#); M stack, G graph, # list
     615RETURN:     number
     616INPUT:      M is a moduli space of stable maps, G is a graph, # is a list.
     617OUTPUT:     a number corresponding to the contribution bundle on a moduli space
     618            of stable maps at a fixed point component (graph)
     619KEYWORDS:   contribution bundle, graph, multiple cover, rational curve,
     620SEE ALSO:   normalBundle
     621EXAMPLE:    example contributionBundle; shows an example
     622"
     623{
     624    def R = basering;
     625    setring R;
     626    int i,j,a;
     627    variety P = M.currentVariety;
     628    def L = torusList(P);
     629    int r = P.dimension;
     630    int d;
     631    if (size(#)==0) {d = 2*r - 3;}
     632    else
     633    {
     634        if (typeof(#[1]) == "int") {d = #[1];}
     635        else {Error("invalid optional argument");}
     636    }
     637    list e = G.edges;
     638    list v = G.vertices;
     639    number E = 1;
     640    number V = 1;
     641    if (r == 1)
     642    {
     643        for (i=1;i<=size(v);i++)
     644        {
     645            V = V*(-L[v[i][1]+1])^(v[i][2]-1);
     646        }
     647        for (j=1;j<=size(e);j++)
     648        {
     649            number f = 1;
     650            if (e[j][3]<>1)
     651            {
     652                for (a=1;a<e[j][3];a++)
     653                {
     654                    f=f*(-a*L[e[j][1]+1]-(e[j][3]-a)*L[e[j][2]+1])/e[j][3];
     655                }
     656            }
     657            E = E*f;
     658            kill f;
     659        }
     660        return ((E*V)^2);
     661    }
     662    else
     663    {
     664        for (i=1;i<=size(v);i++)
     665        {
     666            V = V*((d*L[v[i][1]+1])^(v[i][2]-1));
     667        }
     668        for (j=1;j<=size(e);j++)
     669        {
     670            number f = 1;
     671            for (a=0;a<=d*e[j][3];a++)
     672            {
     673                f = f*((a*L[e[j][1]+1]+(d*e[j][3]-a)*L[e[j][2]+1])/e[j][3]);
     674            }
     675            E = E*f;
     676            kill f;
     677        }
     678        return (E/V);
     679    }
     680}
     681example
     682{
     683    "EXAMPLE:"; echo=2;
     684    ring r = 0,(x),dp;
     685    variety P = projectiveSpace(4);
     686    stack M = moduliSpace(P,2);
     687    def F = fixedPoints(M);
     688    graph G = F[1][1];
     689    number f = contributionBundle(M,G);
     690    number g = contributionBundle(M,G,5);
     691    f == g;
     692}
     693
     694proc normalBundle(stack M, graph G)
     695"USAGE:     normalBundle(M,G); M stack, G graph
     696RETURN:     number
     697INPUT:      M is a moduli space of stable maps, G is a graph
     698OUTPUT:     a number corresponding to the normal bundle on a moduli space of
     699            stable maps at a graph
     700KEYWORDS:   normal bundle, graph, rational curves, mutiple covers, lines on
     701            hypersurfaces
     702SEE ALSO:   contributionBundle
     703EXAMPLE:    example normalBundle; shows an example
     704{
     705    def R = basering;
     706    setring R;
     707    variety P = M.currentVariety;
     708    def L = torusList(P);
     709    int n = P.dimension;
     710    list e = G.edges;
     711    list v = G.vertices;
     712    int i,j,k,h,b,m,a;
     713    number N = 1;
     714    for (j=1;j<=size(e);j++)
     715    {
     716        int d = e[j][3];
     717        number c = (-1)^d*factorial(d)^2;
     718        number y = c*(L[e[j][1]+1]-L[e[j][2]+1])^(2*d)/(d^(2*d));
     719        for (k=0;k<=n;k++)
     720        {
     721            if (k <> e[j][1] and k <> e[j][2])
     722            {
     723                for (a=0;a<=d;a++)
     724                {
     725                    y=y*((a*L[e[j][1]+1]+(d-a)*L[e[j][2]+1])/d - L[k+1]);
     726                }
     727            }
     728        }
     729        N = N*y;
     730        kill y,d,c;
     731    }
     732    for (i=1;i<=size(v);i++)
     733    {
     734        number F = 1;
     735        for (h=3;h<=size(v[i]);h++)
     736        {
     737            F = F*(L[v[i][h][1]+1]-L[v[i][h][2]+1])/v[i][h][3];
     738        }
     739        if (v[i][2] == 1)
     740        {
     741            N = N/F;
     742            kill F;
     743        }
     744        else
     745        {
     746            number z = 1;
     747            for (m=0;m<=n;m++)
     748            {
     749                if (m<>v[i][1])
     750                {
     751                    z = z*(L[v[i][1]+1]-L[m+1]);
     752                }
     753            }
     754            if (v[i][2] == 3)
     755            {
     756                N = N*F/z^2;
     757                kill F,z;
     758            }
     759            else
     760            {
     761                number g = 0;
     762                for (b=3;b<=size(v[i]);b++)
     763                {
     764                    g = g + v[i][b][3]/(L[v[i][b][1]+1]-L[v[i][b][2]+1]);
     765                }
     766                N = N*F*g^(3-v[i][2])/(z^(v[i][2]-1));
     767                kill g,F,z;
     768            }
     769        }
     770    }
     771    return (N);
     772}
     773example
     774{
     775    "EXAMPLE:"; echo=2;
     776    ring r = 0,(x),dp;
     777    variety P = projectiveSpace(4);
     778    stack M = moduliSpace(P,2);
     779    def F = fixedPoints(M);
     780    graph G = F[1][1];
     781    number f = normalBundle(M,G);
     782    f <> 0;
     783}
     784
     785proc multipleCover(int d)
     786"USAGE:     multipleCover(d); d int
     787RETURN:     number
     788THEORY:     This is the contribution of degree d multiple covers of a smooth
     789            rational curve as a Gromov-Witten invariant.
     790KEYWORDS:   Gromov-Witten invariants, multiple covers
     791SEE ALSO:   rationalCurve, linesHypersurface
     792EXAMPLE:    example multipleCover; shows an example
     793"
     794{
     795    def R = basering;
     796    setring R;
     797    variety P = projectiveSpace(1);
     798    stack M = moduliSpace(P,d);
     799    def F = fixedPoints(M);
     800    int i;
     801    number r = 0;
     802    for (i=1;i<=size(F);i++)
     803    {
     804        graph G = F[i][1];
     805        number s = contributionBundle(M,G);
     806        number t = F[i][2]*normalBundle(M,G);
     807        r = r + s/t;
     808        kill s,t,G;
     809    }
     810    return (r);
     811}
     812example
     813{
     814    "EXAMPLE:"; echo=2;
     815    ring r = 0,(x),dp;
     816    multipleCover(1);
     817    multipleCover(2);
     818    multipleCover(3);
     819    multipleCover(4);
     820    multipleCover(5);
     821}
     822
     823proc linesHypersurface(int n)
     824"USAGE:     linesHypersurface(n); n int
     825RETURN:     number
     826THEORY:     This is the number of lines on a general hypersurface of degree
     827            d = 2n-3 in an n-dimensional projective space.
     828KEYWORDS:   Gromov-Witten invariants, lines on hypersurfaces
     829SEE ALSO:   linesHypersurface, multipleCover
     830EXAMPLE:    example linesHypersurface; shows an example
     831"
     832{
     833    def R = basering;
     834    setring R;
     835    variety P = projectiveSpace(n);
     836    stack M = moduliSpace(P,1);
     837    def F = fixedPoints(M);
     838    int i;
     839    poly r = 0;
     840    for (i=1;i<=size(F);i++)
     841    {
     842        graph G = F[i][1];
     843        number s = contributionBundle(M,G);
     844        number t = F[i][2]*normalBundle(M,G);
     845        r = r + s/t;
     846        kill s,t,G;
     847    }
     848    return (r);
     849}
     850example
     851{
     852    "EXAMPLE:"; echo=2;
     853    ring r = 0,(x),dp;
     854    linesHypersurface(2);
     855    linesHypersurface(3);
     856    linesHypersurface(4);
     857    linesHypersurface(5);
     858    linesHypersurface(6);
     859    linesHypersurface(7);
     860    linesHypersurface(8);
     861    linesHypersurface(9);
     862    linesHypersurface(10);
     863}
     864
     865proc rationalCurve(int d, list #)
     866"USAGE:     rationalCurve(d,#); d int, # list
     867RETURN:     number
     868THEORY:     This is the Gromov-Witten invariant corresponding the number of
     869            rational curves on a general Calabi-Yau threefold.
     870KEYWORDS:   Gromov-Witten invariants, rational curves on Calabi-Yau threefolds
     871SEE ALSO:   linesHypersurface, multipleCover
     872EXAMPLE:    example rationalCurve; shows an example
     873"
     874{
     875    def R = basering;
     876    setring R;
     877    int n,i,j;
     878    if (size(#) == 0) {n = 4; list l = 5;}
     879    else {n = size(#)+3; list l = #;}
     880    variety P = projectiveSpace(n);
     881    stack M = moduliSpace(P,d);
     882    def F = fixedPoints(M);
     883    number r = 0;
     884    for (i=1;i<=size(F);i++)
     885    {
     886        graph G = F[i][1];
     887        number s = 1;
     888        for (j=1;j<=size(l);j++)
     889        {
     890            s = s*contributionBundle(M,G,list(l[j]));
     891        }
     892        number t = F[i][2]*normalBundle(M,G);
     893        r = r + s/t;
     894        kill s,t,G;
     895    }
     896    return (r);
     897}
     898example
     899{
     900    "EXAMPLE:"; echo=2;
     901    ring r = 0,(x),dp;
     902    rationalCurve(1);
     903    /*
     904    rationalCurve(2);
     905    rationalCurve(3);
     906    rationalCurve(4);
     907    rationalCurve(5);
     908    rationalCurve(1,list(4,2));
     909    rationalCurve(1,list(3,3));
     910    rationalCurve(1,list(3,2,2));
     911    rationalCurve(1,list(2,2,2,2));
     912    rationalCurve(2,list(4,2));
     913    rationalCurve(2,list(3,3));
     914    rationalCurve(2,list(3,2,2));
     915    rationalCurve(2,list(2,2,2,2));
     916    rationalCurve(3,list(4,2));
     917    rationalCurve(3,list(3,3));
     918    rationalCurve(3,list(3,2,2));
     919    rationalCurve(3,list(2,2,2,2));
     920    rationalCurve(4,list(4,2));
     921    rationalCurve(4,list(3,3));
     922    rationalCurve(4,list(3,2,2));
     923    rationalCurve(4,list(2,2,2,2));
     924    rationalCurve(5,list(4,2));
     925    rationalCurve(5,list(3,3));
     926    rationalCurve(5,list(3,2,2));
     927    rationalCurve(5,list(2,2,2,2));
     928    */
     929}
     930
     931////////////////////////////////////////////////////////////////////////////////
     932/////////// Procedures concerned with graphs ///////////////////////////////////
     933////////////////////////////////////////////////////////////////////////////////
     934
     935proc printGraph(graph G)
     936"USAGE:     printGraph(G); G graph
     937ASSUME:     G is a graph.
     938THEORY:     This is the print function used by Singular to print a graph.
     939KEYWORDS:   graph
     940EXAMPLE:    example printGraph; shows an example
     941"
     942{
     943    "A graph with", size(G.vertices), "vertices and", size(G.edges), "edges";
     944}
     945example
     946{
     947    "EXAMPLE:"; echo=2;
     948    ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
     949    graph G = makeGraph(list(list(0,1,list(0,1,2)),list(1,1,list(1,0,2))),
     950    list(list(0,1,2)));
     951    G;
     952}
     953
     954proc makeGraph(list v, list e)
     955"USAGE:     makeGraph(v,e); v list, e list
     956ASSUME:     v is a list of vertices, e is a list of edges.
     957RETURN:     graph with vertices v and edges e.
     958THEORY:     Creates a graph from a list of vertices and edges.
     959KEYWORDS:   graph
     960EXAMPLE:    example makeGraph; shows an example
     961{
     962    graph G;
     963    G.vertices = v;
     964    G.edges = e;
     965    return(G);
     966}
     967example
     968{
     969    "EXAMPLE:"; echo=2;
     970    ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
     971    graph G = makeGraph(list(list(0,1,list(0,1,2)),list(1,1,list(1,0,2))),
     972    list(list(0,1,2)));
     973    G;
     974}
     975
     976static proc graph1(int d, int i, int j)
     977{
     978    graph G;
     979    list f1 = i,j,d;
     980    list f2 = j,i,d;
     981    list v1 = i,1,f1;
     982    list v2 = j,1,f2;
     983    G.vertices = v1,v2;
     984    G.edges = list(f1);
     985    return (G);
     986}
     987
     988static proc graph2(list d, int i, int j, int k)
     989{
     990    graph G;
     991    list f1 = i,j,d[1];
     992    list f2 = j,i,d[1];
     993    list f3 = j,k,d[2];
     994    list f4 = k,j,d[2];
     995    list v1 = i,1,f1;
     996    list v2 = j,2,f2,f3;
     997    list v3 = k,1,f4;
     998    G.vertices = v1,v2,v3;
     999    G.edges = f1,f3;
     1000    return (G);
     1001}
     1002
     1003static proc graph31(list d, int i, int j, int k, int h)
     1004{
     1005    graph G;
     1006    list f1 = i,j,d[1];
     1007    list f2 = j,i,d[1];
     1008    list f3 = j,k,d[2];
     1009    list f4 = k,j,d[2];
     1010    list f5 = k,h,d[3];
     1011    list f6 = h,k,d[3];
     1012    list v1 = i,1,f1;
     1013    list v2 = j,2,f2,f3;
     1014    list v3 = k,2,f4,f5;
     1015    list v4 = h,1,f6;
     1016    G.vertices = v1,v2,v3,v4;
     1017    G.edges = f1,f3,f5;
     1018    return (G);
     1019}
     1020
     1021static proc graph32(list d, int i, int j, int k, int h)
     1022{
     1023    graph G;
     1024    list f1 = i,j,d[1];
     1025    list f2 = j,i,d[1];
     1026    list f3 = j,k,d[2];
     1027    list f4 = j,h,d[3];
     1028    list f5 = k,j,d[2];
     1029    list f6 = h,j,d[3];
     1030    list v1 = i,1,f1;
     1031    list v2 = j,3,f2,f3,f4;
     1032    list v3 = k,1,f5;
     1033    list v4 = h,1,f6;
     1034    G.vertices = v1,v2,v3,v4;
     1035    G.edges = f1,f3,f4;
     1036    return (G);
     1037}
     1038
     1039static proc graph41(list d, int i, int j, int k, int h, int l)
     1040{
     1041    graph G;
     1042    list f1 = i,j,d[1];
     1043    list f2 = j,i,d[1];
     1044    list f3 = j,k,d[2];
     1045    list f4 = k,j,d[2];
     1046    list f5 = k,h,d[3];
     1047    list f6 = h,k,d[3];
     1048    list f7 = h,l,d[4];
     1049    list f8 = l,h,d[4];
     1050    list v1 = i,1,f1;
     1051    list v2 = j,2,f2,f3;
     1052    list v3 = k,2,f4,f5;
     1053    list v4 = h,2,f6,f7;
     1054    list v5 = l,1,f8;
     1055    G.vertices = v1,v2,v3,v4,v5;
     1056    G.edges = f1,f3,f5,f7;
     1057    return (G);
     1058}
     1059
     1060static proc graph42(list d, int i, int j, int k, int h, int l)
     1061{
     1062    graph G;
     1063    list f1 = i,j,d[1];
     1064    list f2 = j,i,d[1];
     1065    list f3 = j,k,d[2];
     1066    list f4 = k,j,d[2];
     1067    list f5 = k,h,d[3];
     1068    list f6 = k,l,d[4];
     1069    list f7 = h,k,d[3];
     1070    list f8 = l,k,d[4];
     1071    list v1 = i,1,f1;
     1072    list v2 = j,2,f2,f3;
     1073    list v3 = k,3,f4,f5,f6;
     1074    list v4 = h,1,f7;
     1075    list v5 = l,1,f8;
     1076    G.vertices = v1,v2,v3,v4,v5;
     1077    G.edges = f1,f3,f5,f6;
     1078    return (G);
     1079}
     1080
     1081static proc graph43(list d, int i, int j, int k, int h, int l)
     1082{
     1083    graph G;
     1084    list f1 = i,j,d[1];
     1085    list f2 = j,i,d[1];
     1086    list f3 = j,k,d[2];
     1087    list f4 = j,h,d[3];
     1088    list f5 = j,l,d[4];
     1089    list f6 = k,j,d[2];
     1090    list f7 = h,j,d[3];
     1091    list f8 = l,j,d[4];
     1092    list v1 = i,1,f1;
     1093    list v2 = j,4,f2,f3,f4,f5;
     1094    list v3 = k,1,f6;
     1095    list v4 = h,1,f7;
     1096    list v5 = l,1,f8;
     1097    G.vertices = v1,v2,v3,v4,v5;
     1098    G.edges = f1,f3,f4,f5;
     1099    return (G);
     1100}
     1101
     1102static proc graph51(list d, int i, int j, int k, int h, int m, int n)
     1103{
     1104    graph G;
     1105    list f1 = i,j,d[1];
     1106    list f2 = j,i,d[1];
     1107    list f3 = j,k,d[2];
     1108    list f4 = k,j,d[2];
     1109    list f5 = k,h,d[3];
     1110    list f6 = h,k,d[3];
     1111    list f7 = h,m,d[4];
     1112    list f8 = m,h,d[4];
     1113    list f9 = m,n,d[5];
     1114    list f10 = n,m,d[5];
     1115    list v1 = i,1,f1;
     1116    list v2 = j,2,f2,f3;
     1117    list v3 = k,2,f4,f5;
     1118    list v4 = h,2,f6,f7;
     1119    list v5 = m,2,f8,f9;
     1120    list v6 = n,1,f10;
     1121    G.vertices = v1,v2,v3,v4,v5,v6;
     1122    G.edges = f1,f3,f5,f7,f9;
     1123    return (G);
     1124}
     1125
     1126static proc graph52(list d, int i, int j, int k, int h, int m, int n)
     1127{
     1128    graph G;
     1129    list f1 = i,j,d[1];
     1130    list f2 = j,i,d[1];
     1131    list f3 = j,k,d[2];
     1132    list f4 = k,j,d[2];
     1133    list f5 = k,h,d[3];
     1134    list f6 = h,k,d[3];
     1135    list f7 = h,m,d[4];
     1136    list f8 = m,h,d[4];
     1137    list f9 = h,n,d[5];
     1138    list f10 = n,h,d[5];
     1139    list v1 = i,1,f1;
     1140    list v2 = j,2,f2,f3;
     1141    list v3 = k,2,f4,f5;
     1142    list v4 = h,3,f6,f7,f9;
     1143    list v5 = m,1,f8;
     1144    list v6 = n,1,f10;
     1145    G.vertices = v1,v2,v3,v4,v5,v6;
     1146    G.edges = f1,f3,f5,f7,f9;
     1147    return (G);
     1148}
     1149
     1150static proc graph53(list d, int i, int j, int k, int h, int m, int n)
     1151{
     1152    graph G;
     1153    list f1 = i,j,d[1];
     1154    list f2 = j,i,d[1];
     1155    list f3 = j,k,d[2];
     1156    list f4 = k,j,d[2];
     1157    list f5 = k,h,d[3];
     1158    list f6 = h,k,d[3];
     1159    list f7 = k,m,d[4];
     1160    list f8 = m,k,d[4];
     1161    list f9 = k,n,d[5];
     1162    list f10 = n,k,d[5];
     1163    list v1 = i,1,f1;
     1164    list v2 = j,2,f2,f3;
     1165    list v3 = k,4,f4,f5,f7,f9;
     1166    list v4 = h,1,f6;
     1167    list v5 = m,1,f8;
     1168    list v6 = n,1,f10;
     1169    G.vertices = v1,v2,v3,v4,v5,v6;
     1170    G.edges = f1,f3,f5,f7,f9;
     1171    return (G);
     1172}
     1173
     1174static proc graph54(list d, int i, int j, int k, int h, int m, int n)
     1175{
     1176    graph G;
     1177    list f1 = i,j,d[1];
     1178    list f2 = j,i,d[1];
     1179    list f3 = j,k,d[2];
     1180    list f4 = k,j,d[2];
     1181    list f5 = j,h,d[3];
     1182    list f6 = h,j,d[3];
     1183    list f7 = h,m,d[4];
     1184    list f8 = m,h,d[4];
     1185    list f9 = h,n,d[5];
     1186    list f10 = n,h,d[5];
     1187    list v1 = i,1,f1;
     1188    list v2 = j,3,f2,f3,f5;
     1189    list v3 = k,1,f4;
     1190    list v4 = h,3,f6,f7,f9;
     1191    list v5 = m,1,f8;
     1192    list v6 = n,1,f10;
     1193    G.vertices = v1,v2,v3,v4,v5,v6;
     1194    G.edges = f1,f3,f5,f7,f9;
     1195    return (G);
     1196}
     1197
     1198static proc graph55(list d, int i, int j, int k, int h, int m, int n)
     1199{
     1200    graph G;
     1201    list f1 = i,j,d[1];
     1202    list f2 = j,i,d[1];
     1203    list f3 = j,k,d[2];
     1204    list f4 = k,j,d[2];
     1205    list f5 = k,h,d[3];
     1206    list f6 = h,k,d[3];
     1207    list f7 = k,m,d[4];
     1208    list f8 = m,k,d[4];
     1209    list f9 = h,n,d[5];
     1210    list f10 = n,h,d[5];
     1211    list v1 = i,1,f1;
     1212    list v2 = j,2,f2,f3;
     1213    list v3 = k,3,f4,f5,f7;
     1214    list v4 = h,2,f6,f9;
     1215    list v5 = m,1,f8;
     1216    list v6 = n,1,f10;
     1217    G.vertices = v1,v2,v3,v4,v5,v6;
     1218    G.edges = f1,f3,f5,f7,f9;
     1219    return (G);
     1220}
     1221
     1222static proc graph56(list d, int i, int j, int k, int h, int m, int n)
     1223{
     1224    graph G;
     1225    list f1 = i,j,d[1];
     1226    list f2 = j,i,d[1];
     1227    list f3 = j,k,d[2];
     1228    list f4 = k,j,d[2];
     1229    list f5 = j,h,d[3];
     1230    list f6 = h,j,d[3];
     1231    list f7 = j,m,d[4];
     1232    list f8 = m,j,d[4];
     1233    list f9 = j,n,d[5];
     1234    list f10 = n,j,d[5];
     1235    list v1 = i,1,f1;
     1236    list v2 = j,5,f2,f3,f5,f7,f9;
     1237    list v3 = k,1,f4;
     1238    list v4 = h,1,f6;
     1239    list v5 = m,1,f8;
     1240    list v6 = n,1,f10;
     1241    G.vertices = v1,v2,v3,v4,v5,v6;
     1242    G.edges = f1,f3,f5,f7,f9;
     1243    return (G);
     1244}
     1245
     1246static proc graph61(list d, int i, int j, int k, int h, int m, int n, int p)
     1247{
     1248    graph G;
     1249    list f1 = i,j,d[1];
     1250    list f2 = j,i,d[1];
     1251    list f3 = j,k,d[2];
     1252    list f4 = k,j,d[2];
     1253    list f5 = k,h,d[3];
     1254    list f6 = h,k,d[3];
     1255    list f7 = h,m,d[4];
     1256    list f8 = m,h,d[4];
     1257    list f9 = m,n,d[5];
     1258    list f10 = n,m,d[5];
     1259    list f11 = n,p,d[6];
     1260    list f12 = p,n,d[6];
     1261    list v1 = i,1,f1;
     1262    list v2 = j,2,f2,f3;
     1263    list v3 = k,2,f4,f5;
     1264    list v4 = h,2,f6,f7;
     1265    list v5 = m,2,f8,f9;
     1266    list v6 = n,2,f10,f11;
     1267    list v7 = p,1,f12;
     1268    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1269    G.edges = f1,f3,f5,f7,f9,f11;
     1270    return (G);
     1271}
     1272
     1273static proc graph62(list d, int i, int j, int k, int h, int m, int n, int p)
     1274{
     1275    graph G;
     1276    list f1 = i,j,d[1];
     1277    list f2 = j,i,d[1];
     1278    list f3 = j,k,d[2];
     1279    list f4 = k,j,d[2];
     1280    list f5 = k,h,d[3];
     1281    list f6 = h,k,d[3];
     1282    list f7 = h,m,d[4];
     1283    list f8 = m,h,d[4];
     1284    list f9 = m,n,d[5];
     1285    list f10 = n,m,d[5];
     1286    list f11 = m,p,d[6];
     1287    list f12 = p,m,d[6];
     1288    list v1 = i,1,f1;
     1289    list v2 = j,2,f2,f3;
     1290    list v3 = k,2,f4,f5;
     1291    list v4 = h,2,f6,f7;
     1292    list v5 = m,3,f8,f9,f11;
     1293    list v6 = n,1,f10;
     1294    list v7 = p,1,f12;
     1295    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1296    G.edges = f1,f3,f5,f7,f9,f11;
     1297    return (G);
     1298}
     1299
     1300static proc graph63(list d, int i, int j, int k, int h, int m, int n, int p)
     1301{
     1302    graph G;
     1303    list f1 = i,j,d[1];
     1304    list f2 = j,i,d[1];
     1305    list f3 = j,k,d[2];
     1306    list f4 = k,j,d[2];
     1307    list f5 = k,h,d[3];
     1308    list f6 = h,k,d[3];
     1309    list f7 = h,m,d[4];
     1310    list f8 = m,h,d[4];
     1311    list f9 = h,n,d[5];
     1312    list f10 = n,h,d[5];
     1313    list f11 = n,p,d[6];
     1314    list f12 = p,n,d[6];
     1315    list v1 = i,1,f1;
     1316    list v2 = j,2,f2,f3;
     1317    list v3 = k,2,f4,f5;
     1318    list v4 = h,3,f6,f7,f9;
     1319    list v5 = m,1,f8;
     1320    list v6 = n,2,f10,f11;
     1321    list v7 = p,1,f12;
     1322    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1323    G.edges = f1,f3,f5,f7,f9,f11;
     1324    return (G);
     1325}
     1326
     1327static proc graph64(list d, int i, int j, int k, int h, int m, int n, int p)
     1328{
     1329    graph G;
     1330    list f1 = i,j,d[1];
     1331    list f2 = j,i,d[1];
     1332    list f3 = j,k,d[2];
     1333    list f4 = k,j,d[2];
     1334    list f5 = k,h,d[3];
     1335    list f6 = h,k,d[3];
     1336    list f7 = h,m,d[4];
     1337    list f8 = m,h,d[4];
     1338    list f9 = h,n,d[5];
     1339    list f10 = n,h,d[5];
     1340    list f11 = h,p,d[6];
     1341    list f12 = p,h,d[6];
     1342    list v1 = i,1,f1;
     1343    list v2 = j,2,f2,f3;
     1344    list v3 = k,2,f4,f5;
     1345    list v4 = h,4,f6,f7,f9,f11;
     1346    list v5 = m,1,f8;
     1347    list v6 = n,1,f10;
     1348    list v7 = p,1,f12;
     1349    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1350    G.edges = f1,f3,f5,f7,f9,f11;
     1351    return (G);
     1352}
     1353
     1354static proc graph65(list d, int i, int j, int k, int h, int m, int n, int p)
     1355{
     1356    graph G;
     1357    list f1 = i,j,d[1];
     1358    list f2 = j,i,d[1];
     1359    list f3 = j,k,d[2];
     1360    list f4 = k,j,d[2];
     1361    list f5 = k,h,d[3];
     1362    list f6 = h,k,d[3];
     1363    list f7 = k,m,d[4];
     1364    list f8 = m,k,d[4];
     1365    list f9 = k,n,d[5];
     1366    list f10 = n,k,d[5];
     1367    list f11 = n,p,d[6];
     1368    list f12 = p,n,d[6];
     1369    list v1 = i,1,f1;
     1370    list v2 = j,2,f2,f3;
     1371    list v3 = k,4,f4,f5,f7,f9;
     1372    list v4 = h,1,f6;
     1373    list v5 = m,1,f8;
     1374    list v6 = n,2,f10,f11;
     1375    list v7 = p,1,f12;
     1376    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1377    G.edges = f1,f3,f5,f7,f9,f11;
     1378    return (G);
     1379}
     1380
     1381static proc graph66(list d, int i, int j, int k, int h, int m, int n, int p)
     1382{
     1383    graph G;
     1384    list f1 = i,j,d[1];
     1385    list f2 = j,i,d[1];
     1386    list f3 = j,k,d[2];
     1387    list f4 = k,j,d[2];
     1388    list f5 = k,h,d[3];
     1389    list f6 = h,k,d[3];
     1390    list f7 = k,m,d[4];
     1391    list f8 = m,k,d[4];
     1392    list f9 = h,n,d[5];
     1393    list f10 = n,h,d[5];
     1394    list f11 = m,p,d[6];
     1395    list f12 = p,m,d[6];
     1396    list v1 = i,1,f1;
     1397    list v2 = j,2,f2,f3;
     1398    list v3 = k,3,f4,f5,f7;
     1399    list v4 = h,2,f6,f9;
     1400    list v5 = m,1,f8,f11;
     1401    list v6 = n,1,f10;
     1402    list v7 = p,1,f12;
     1403    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1404    G.edges = f1,f3,f5,f7,f9,f11;
     1405    return (G);
     1406}
     1407
     1408static proc graph67(list d, int i, int j, int k, int h, int m, int n, int p)
     1409{
     1410    graph G;
     1411    list f1 = i,j,d[1];
     1412    list f2 = j,i,d[1];
     1413    list f3 = j,k,d[2];
     1414    list f4 = k,j,d[2];
     1415    list f5 = j,h,d[3];
     1416    list f6 = h,j,d[3];
     1417    list f7 = h,m,d[4];
     1418    list f8 = m,h,d[4];
     1419    list f9 = m,n,d[5];
     1420    list f10 = n,m,d[5];
     1421    list f11 = m,p,d[6];
     1422    list f12 = p,m,d[6];
     1423    list v1 = i,1,f1;
     1424    list v2 = j,3,f2,f3,f5;
     1425    list v3 = k,1,f4;
     1426    list v4 = h,2,f6,f7;
     1427    list v5 = m,3,f8,f9,f11;
     1428    list v6 = n,1,f10;
     1429    list v7 = p,1,f12;
     1430    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1431    G.edges = f1,f3,f5,f7,f9,f11;
     1432    return (G);
     1433}
     1434
     1435static proc graph68(list d, int i, int j, int k, int h, int m, int n, int p)
     1436{
     1437    graph G;
     1438    list f1 = i,j,d[1];
     1439    list f2 = j,i,d[1];
     1440    list f3 = j,k,d[2];
     1441    list f4 = k,j,d[2];
     1442    list f5 = j,h,d[3];
     1443    list f6 = h,j,d[3];
     1444    list f7 = h,m,d[4];
     1445    list f8 = m,h,d[4];
     1446    list f9 = h,n,d[5];
     1447    list f10 = n,h,d[5];
     1448    list f11 = h,p,d[6];
     1449    list f12 = p,h,d[6];
     1450    list v1 = i,1,f1;
     1451    list v2 = j,3,f2,f3,f5;
     1452    list v3 = k,1,f4;
     1453    list v4 = h,4,f6,f7,f9,f11;
     1454    list v5 = m,1,f8;
     1455    list v6 = n,1,f10;
     1456    list v7 = p,1,f12;
     1457    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1458    G.edges = f1,f3,f5,f7,f9,f11;
     1459    return (G);
     1460}
     1461
     1462static proc graph69(list d, int i, int j, int k, int h, int m, int n, int p)
     1463{
     1464    graph G;
     1465    list f1 = i,j,d[1];
     1466    list f2 = j,i,d[1];
     1467    list f3 = j,k,d[2];
     1468    list f4 = k,j,d[2];
     1469    list f5 = j,h,d[3];
     1470    list f6 = h,j,d[3];
     1471    list f7 = h,m,d[4];
     1472    list f8 = m,h,d[4];
     1473    list f9 = h,n,d[5];
     1474    list f10 = n,h,d[5];
     1475    list f11 = n,p,d[6];
     1476    list f12 = p,n,d[6];
     1477    list v1 = i,1,f1;
     1478    list v2 = j,3,f2,f3,f5;
     1479    list v3 = k,1,f4;
     1480    list v4 = h,3,f6,f7,f9;
     1481    list v5 = m,1,f8;
     1482    list v6 = n,2,f10,f11;
     1483    list v7 = p,1,f12;
     1484    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1485    G.edges = f1,f3,f5,f7,f9,f11;
     1486    return (G);
     1487}
     1488
     1489static proc graph610(list d, int i, int j, int k, int h, int m, int n, int p)
     1490{
     1491    graph G;
     1492    list f1 = i,j,d[1];
     1493    list f2 = j,i,d[1];
     1494    list f3 = j,k,d[2];
     1495    list f4 = k,j,d[2];
     1496    list f5 = k,h,d[3];
     1497    list f6 = h,k,d[3];
     1498    list f7 = k,m,d[4];
     1499    list f8 = m,k,d[4];
     1500    list f9 = k,n,d[5];
     1501    list f10 = n,k,d[5];
     1502    list f11 = k,p,d[6];
     1503    list f12 = p,k,d[6];
     1504    list v1 = i,1,f1;
     1505    list v2 = j,2,f2,f3;
     1506    list v3 = k,5,f4,f5,f7,f9,f11;
     1507    list v4 = h,1,f6;
     1508    list v5 = m,1,f8;
     1509    list v6 = n,1,f10;
     1510    list v7 = p,1,f12;
     1511    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1512    G.edges = f1,f3,f5,f7,f9,f11;
     1513    return (G);
     1514}
     1515
     1516static proc graph611(list d, int i, int j, int k, int h, int m, int n, int p)
     1517{
     1518    graph G;
     1519    list f1 = i,j,d[1];
     1520    list f2 = j,i,d[1];
     1521    list f3 = j,k,d[2];
     1522    list f4 = k,j,d[2];
     1523    list f5 = j,h,d[3];
     1524    list f6 = h,j,d[3];
     1525    list f7 = j,m,d[4];
     1526    list f8 = m,j,d[4];
     1527    list f9 = j,n,d[5];
     1528    list f10 = n,j,d[5];
     1529    list f11 = j,p,d[6];
     1530    list f12 = p,j,d[6];
     1531    list v1 = i,1,f1;
     1532    list v2 = j,6,f2,f3,f5,f7,f9,f11;
     1533    list v3 = k,1,f4;
     1534    list v4 = h,1,f6;
     1535    list v5 = m,1,f8;
     1536    list v6 = n,1,f10;
     1537    list v7 = p,1,f12;
     1538    G.vertices = v1,v2,v3,v4,v5,v6,v7;
     1539    G.edges = f1,f3,f5,f7,f9,f11;
     1540    return (G);
    771541}
    781542
     
    801544/// Auxilary Static Procedures in this Library /////////////////////////////////
    811545////////////////////////////////////////////////////////////////////////////////
    82 //////// - part     ////////////////////////////////////////////////////////////
    83 //////// - parts    ////////////////////////////////////////////////////////////
    84 //////// - logg     ////////////////////////////////////////////////////////////
    85 //////// - expp     ////////////////////////////////////////////////////////////
    86 //////// - adams    ////////////////////////////////////////////////////////////
    87 //////// - wedges   ////////////////////////////////////////////////////////////
    88 //////// - schur    ////////////////////////////////////////////////////////////
    89 ////////////////////////////////////////////////////////////////////////////////
    901546
    911547proc part(poly f, int n)
    921548"USAGE:     part(f,n); f poly, n int
    931549RETURN:     poly
    94 PURPOSE:    return the homogeneous component of degree n of the polynomial f.
     1550PURPOSE:    computing the homogeneous component of a polynomial.
    951551EXAMPLE:    example part; shows examples
    961552"
     
    1211577"USAGE:     parts(f,i,j); f poly, i int, j int
    1221578RETURN:     poly
    123 PURPOSE:    return a polynomial which is the sum of the homogeneous components
    124             of degree from i to j of the polynomial f.
     1579THEORY:     computing a polynomial which is the sum of the homogeneous
     1580            components of a polynomial.
    1251581EXAMPLE:    example parts; shows examples
    1261582"
     
    1411597    parts(f,2,4);
    1421598}
     1599
    1431600proc logg(poly f, int n)
    1441601"USAGE:     logg(f,n); f poly, n int
    1451602RETURN:     poly
    146 PURPOSE:    computing the Chern character from the total Chern class.
     1603THEORY:     computing Chern characters from total Chern classes.
    1471604EXAMPLE:    example logg; shows examples
    1481605"
     
    1841641"USAGE:     expp(f,n); f poly, n int
    1851642RETURN:     poly
    186 PURPOSE:    computing the total Chern class from the Chern character.
     1643PURPOSE:    computing total Chern classes from Chern characters.
    1871644EXAMPLE:    example expp; shows examples
    1881645"
     
    2691726
    2701727////////////////////////////////////////////////////////////////////////////////
    271 //////// Procedures concerned with varieties ///////////////////////////////////
     1728//////// Procedures concerned with abstract varieties //////////////////////////
    2721729////////////////////////////////////////////////////////////////////////////////
    2731730
    274 proc variety_print(variety V)
     1731proc printVariety(variety V)
     1732"USAGE:     printVariety(V); V variety
     1733ASSUME:     V is an abstract variety
     1734THEORY:     This is the print function used by Singular to print an abstract
     1735            variety.
     1736KEYWORDS:   abstract variety, projective space, Grassmannian
     1737EXAMPLE:    example printVariety; shows an example
     1738"
    2751739{
    2761740    "A variety of dimension", V.dimension;
    2771741}
     1742example
     1743{
     1744    "EXAMPLE:"; echo=2;
     1745    ring r = 0, (h,e), wp(1,1);
     1746    ideal rels = he,h2+e2;
     1747    variety V = makeVariety(2,rels);
     1748    V;
     1749}
    2781750
    2791751proc makeVariety(int d, ideal i)
     1752"USAGE:     makeVariety(d,i); d int, i ideal
     1753ASSUME:     d is a nonnegative integer, i is an ideal
     1754RETURN:     variety
     1755THEORY:     create an abstract variety which has dimension d, and its Chow ring
     1756            should be a quotient ring
     1757KEYWORDS:   abstract variety, projective space, Grassmannian
     1758EXAMPLE:    example makeVariety; shows an example
     1759"
    2801760{
    2811761    def R = basering;
     
    2861766    return(V);
    2871767}
     1768<<<<<<< HEAD
    2881769
    2891770proc dimension(variety V)
    290 {
    291     return (V.dimension);
     1771=======
     1772example
     1773>>>>>>> 2ba3231... chg: new version of schubert.lib
     1774{
     1775    "EXAMPLE:"; echo=2;
     1776    ring r = 0, (h,e), wp(1,1);
     1777    ideal rels = he,h2+e2;
     1778    variety V = makeVariety(2,rels);
     1779    V;
     1780    V.dimension;
     1781    V.relations;
    2921782}
    2931783
    2941784proc ChowRing(variety V)
     1785"USAGE:     ChowRing(V); V variety
     1786ASSUME:     V is an abstract variety
     1787RETURN:     qring
     1788KEYWORDS:   Chow ring, abstract variety, projective space, Grassmannian
     1789EXAMPLE:    example makeVariety; shows an example
     1790"
    2951791{
    2961792    def R = V.baseRing;
     
    3001796    return (CR);
    3011797}
    302 
    303 proc relations(variety V)
    304 {
    305     def R = V.baseRing;
    306     setring R;
    307     ideal i = V.relations;
    308     return (i);
     1798example
     1799{
     1800    "EXAMPLE:"; echo=2;
     1801    ring r = 0, (h,e), wp(1,1);
     1802    ideal rels = he,h2+e2;
     1803    int d = 2;
     1804    variety V = makeVariety(2,rels);
     1805    ChowRing(V);
    3091806}
    3101807
     
    3141811"USAGE:     Grassmannian(k,n); k int, n int
    3151812RETURN:     variety
    316 PURPOSE:    create a variety as a Grassmannian G(k,n). This variety has
    317             diemnsion k(n-k) and its Chow ring is the quotient ring of a
    318             polynomial ring in n-k variables q(1),...,q(n-k) which are the
    319             Chern classes of the tautological quotient bundle on the
    320             Grassmannian G(k,n), modulo the ideal generated by n-k polynomials
    321             which come from the Giambelli formula. The monomial ordering of this
    322             ring is 'wp' with vector (1..k,1..n-k). Moreover, we export the
    323             Chern characters of the tautological subbundle and quotient bundle
    324             on G(k,n) (say 'subBundle' and 'quotientBundle').
     1813THEORY:     create a Grassmannian G(k,n) as an abstract variety. This abstract
     1814            variety has diemnsion k(n-k) and its Chow ring is the quotient ring
     1815            of a polynomial ring in n-k variables q(1),...,q(n-k), which are the
     1816            Chern classes of tautological quotient bundle on G(k,n), modulo some
     1817            ideal generated by n-k polynomials which come from the Giambelli
     1818            formula. The monomial ordering of this Chow ring is 'wp' with vector
     1819            (1..k,1..n-k). Moreover, we export the Chern characters of
     1820            tautological subbundle and quotient bundle on G(k,n)
     1821            (say 'subBundle' and 'quotientBundle').
     1822KEYWORDS:   Grassmannian, abstract variety, Schubert calculus
     1823SEE ALSO:   projectiveSpace, projectiveBundle
    3251824EXAMPLE:    example Grassmannian; shows examples
    3261825"
     
    3681867{
    3691868    "EXAMPLE:"; echo=2;
    370     def G24 = Grassmannian(2,4);
     1869    variety G24 = Grassmannian(2,4);
    3711870    G24;
    3721871    def r = G24.baseRing;
     1872<<<<<<< HEAD
     1873=======
     1874    setring r;
     1875>>>>>>> 2ba3231... chg: new version of schubert.lib
    3731876    subBundle;
    3741877    quotientBundle;
     
    3811884"USAGE:     projectiveSpace(n); n int
    3821885RETURN:     variety
    383 PURPOSE:    create a variety as a projective space of dimension n. The Chow ring
    384             is the quotient ring in one variable h modulo the ideal generated by
    385             h^(n+1).
     1886THEORY:     create a projective space of dimension n as an abstract variety. Its
     1887            Chow ring is a quotient ring in one variable h modulo the ideal
     1888            generated by h^(n+1).
     1889KEYWORDS:   projective space, abstract variety
     1890SEE ALSO:   Grassmannian, projectiveBundle
    3861891EXAMPLE:    example projectiveSpace; shows examples
    3871892"
     
    4191924{
    4201925    "EXAMPLE:"; echo=2;
    421     def P = projectiveSpace(3);
     1926    variety P = projectiveSpace(3);
    4221927    P;
    4231928    P.dimension;
     
    4301935proc projectiveBundle(sheaf S, list #)
    4311936"USAGE:     projectiveBundle(S); S sheaf
     1937INPUT:      a sheaf on an abstract variety
    4321938RETURN:     variety
    433 PURPOSE:    create a variety which we work on.
     1939THEORY:     create a projective bundle as an abstract variety. This is related
     1940            to the enumeration of conics.
     1941KEYWORDS:   projective bundle, abstract variety, sheaf, enumeration of conics
     1942SEE ALSO:   projectiveSpace, Grassmannian
    4341943EXAMPLE:    example projectiveBundle; shows examples
    4351944"
     
    4701979{
    4711980    "EXAMPLE:"; echo=2;
    472     def G35 = Grassmannian(3,5);
    473     def R = G35.baseRing;
     1981    variety G = Grassmannian(3,5);
     1982    def r = G.baseRing;
     1983    setring r;
     1984    sheaf S = makeSheaf(G,subBundle);
     1985    sheaf B = dualSheaf(S)^2;
     1986    variety PB = projectiveBundle(B);
     1987    PB;
     1988    def R = PB.baseRing;
    4741989    setring R;
    475     def S = makeSheaf(G35, subBundle);
    476     def B = symmetricPowerSheaf(dualSheaf(S),2);
    477     def PB = projectiveBundle(B);
    478     PB;
    479     def P = PB.baseRing;
    480     setring P;
    4811990    QuotientBundle;
    4821991    ChowRing(PB);
     
    4841993
    4851994proc productVariety(variety U, variety V)
     1995"USAGE:     productVariety(U,V); U variety, V variety
     1996INPUT:      two abstract varieties
     1997OUTPUT:     a product variety as an abstract variety
     1998RETURN:     variety
     1999KEYWORDS:   product variety, abstract variety
     2000SEE ALSO:   projectiveSpace, Grassmannian, projectiveBundle
     2001EXAMPLE:    example productVariety; shows examples
     2002"
    4862003{
    4872004    //def br = basering;
     
    4982015    ideal i2 = imap(vr,ii2);
    4992016    W.relations = i1 + i2;
     2017    setring ur;
     2018    kill ii1;
     2019    setring vr;
     2020    kill ii2;
    5002021    //setring br;
    5012022    return (W);
    5022023}
     2024example
     2025{
     2026    "EXAMPLE:"; echo=2;
     2027    variety P = projectiveSpace(3);
     2028    variety G = Grassmannian(2,4);
     2029    variety W = productVariety(P,G);
     2030    W;
     2031    W.dimension == P.dimension + G.dimension;
     2032    def r = W.baseRing;
     2033    setring r;
     2034    W.relations;
     2035}
    5032036
    5042037////////////////////////////////////////////////////////////////////////////////
     
    5062039proc integral(variety V, poly f)
    5072040"USAGE:     integral(V,f); V variety, f poly
     2041INPUT:      a abstract variety and a polynomial
    5082042RETURN:     int
    509 PURPOSE:    compute the intersection numbers.
    510 EXAMPLE:    example integral; shows examples
     2043PURPOSE:    computing intersection numbers.
     2044EXAMPLE:    example integral; shows an example
    5112045"
    5122046{
     
    5192053{
    5202054    "EXAMPLE:"; echo=2;
    521     def G24 = Grassmannian(2,4);
    522     def R = G24.baseRing;
    523     setring R;
    524     integral(G24,q(1)^4);
     2055    variety G = Grassmannian(2,4);
     2056    def r = G.baseRing;
     2057    setring r;
     2058    integral(G,q(1)^4);
    5252059}
    5262060
    5272061proc SchubertClass(list p)
    5282062"USAGE:     SchubertClass(p); p list
     2063INPUT:      a list of integers which is a partition
    5292064RETURN:     poly
    530 PURPOSE:    compute the Schubert class on a Grassmannian.
    531 EXAMPLE:    example SchubertClass; shows examples
     2065PURPOSE:    compute the Schubert classes on a Grassmannian.
     2066EXAMPLE:    example SchubertClass; shows an example
    5322067"
    5332068{
     
    5462081{
    5472082    "EXAMPLE:"; echo=2;
    548     def G = Grassmannian(2,4);
     2083    variety G = Grassmannian(2,4);
    5492084    def r = G.baseRing;
    5502085    setring r;
     
    5562091
    5572092proc dualPartition(int k, int n, list p)
     2093"USAGE:     dualPartition(k,n,p); k int, n int, p list
     2094INPUT:      two integers and a partition
     2095RETURN:     list
     2096PURPOSE:    compute the dual of a partition.
     2097SEE ALSO:   SchubertClass
     2098EXAMPLE:    example dualPartition; shows an example
     2099"
    5582100{
    5592101    while (size(p) < k)
     
    5692111    return (l);
    5702112}
    571 
    572 ////////////////////////////////////////////////////////////////////////////////
     2113example
     2114{
     2115    "EXAMPLE:"; echo=2;
     2116    ring r = 0,(x),dp;
     2117    dualPartition(2,4,list(2,1));
     2118}
    5732119
    5742120////////////////////////////////////////////////////////////////////////////////
     
    5762122////////////////////////////////////////////////////////////////////////////////
    5772123
    578 ////////////////////////////////////////////////////////////////////////////////
    579 
    580 proc sheaf_print(sheaf S)
    581 {
    582     def V = S.currentVariety;
    583     def R = V.baseRing;
    584     setring R;
    585     poly f = S.ChernCharacter;
    586     "A sheaf of rank ", int(part(f,0));
     2124proc printSheaf(sheaf S)
     2125"USAGE:     printSheaf(S); S sheaf
     2126RETURN:     string
     2127INPUT:      a sheaf
     2128THEORY:     This is the print function used by Singular to print a sheaf.
     2129SEE ALSO:   makeSheaf, rankSheaf
     2130EXAMPLE:    example printSheaf; shows an example
     2131"
     2132{
     2133    "A sheaf of rank ", rankSheaf(S);
     2134}
     2135example
     2136{
     2137    "EXAMPLE:"; echo=2;
     2138    variety X;
     2139    X.dimension = 4;
     2140    ring r = 0,(c(1..2),d(1..3)),wp(1..2,1..3);
     2141    setring r;
     2142    X.baseRing = r;
     2143    poly c = 1 + c(1) + c(2);
     2144    poly ch = 2 + logg(c,4);
     2145    sheaf S = makeSheaf(X,ch);
     2146    S;
    5872147}
    5882148
    5892149proc makeSheaf(variety V, poly ch)
     2150"USAGE:     makeSheaf(V,ch); V variety, ch poly
     2151RETURN:     sheaf
     2152THEORY:     create a sheaf on an abstract variety, and its Chern character is
     2153            the polynomial ch.
     2154SEE ALSO:   printSheaf, rankSheaf
     2155EXAMPLE:    example makeSheaf; shows an example
     2156"
    5902157{
    5912158    def R = basering;
     
    5952162    return(S);
    5962163}
    597 
    598 proc currentVariety(sheaf S)
    599 {
    600     return (S.currentVariety);
    601 }
    602 
    603 proc ChernCharacter(sheaf S)
    604 {
    605     return (S.ChernCharacter)
     2164example
     2165{
     2166    "EXAMPLE:"; echo=2;
     2167    variety X;
     2168    X.dimension = 4;
     2169    ring r = 0,(c(1..2),d(1..3)),wp(1..2,1..3);
     2170    setring r;
     2171    X.baseRing = r;
     2172    poly c = 1 + c(1) + c(2);
     2173    poly ch = 2 + logg(c,4);
     2174    sheaf S = makeSheaf(X,ch);
     2175    S;
    6062176}
    6072177
     
    6092179"USAGE:     rankSheaf(S); S sheaf
    6102180RETURN:     int
    611 INPUT:      S -- a sheaf
    612 OUTPUT:     an integer which is the rank of the sheaf S.
    613 EXAMPLE:    example rankSheaf(S); shows examples
    614 "
    615 {
    616     def V = S.currentVariety;
     2181INPUT:      S is a sheaf
     2182OUTPUT:     a positive integer which is the rank of a sheaf.
     2183SEE ALSO:   makeSheaf, printSheaf
     2184EXAMPLE:    example rankSheaf; shows an example
     2185"
     2186{
     2187    variety V = S.currentVariety;
    6172188    def R = V.baseRing;
    6182189    setring R;
     
    6232194{
    6242195    "EXAMPLE:"; echo=2;
    625     def G24 = Grassmannian(2,4);
    626     def R = G24.baseRing;
     2196    variety G = Grassmannian(2,4);
     2197    def R = G.baseRing;
    6272198    setring R;
    628     def S = makeSheaf(G24,subBundle);
     2199    sheaf S = makeSheaf(G,subBundle);
    6292200    rankSheaf(S);
    6302201}
    6312202
    6322203proc totalChernClass(sheaf S)
    633 "USAGE:     totalChernClass(S); f sheaf
     2204"USAGE:     totalChernClass(S); S sheaf
    6342205RETURN:     poly
    635 INPUT:      S -- a sheaf
    636 OUTPUT:     a polynomial which is the total Chern class of the sheaf S
    637 EXAMPLE:    example totalChernClass(S); shows examples
    638 "
    639 {
    640     def V = S.currentVariety;
     2206INPUT:      S is a sheaf
     2207OUTPUT:     a polynomial which is the total Chern class of a sheaf
     2208SEE ALSO:   totalSegreClass, topChernClass, ChernClass
     2209EXAMPLE:    example totalChernClass; shows an example
     2210"
     2211{
     2212    variety V = S.currentVariety;
    6412213    int d = V.dimension;
    6422214    def R = V.baseRing;
     
    6472219    return (reduce(f,rels));
    6482220}
     2221example
     2222{
     2223    "EXAMPLE:"; echo=2;
     2224    variety X;
     2225    X.dimension = 4;
     2226    ring r = 0,(c(1..2),d(1..3)),wp(1..2,1..3);
     2227    setring r;
     2228    X.baseRing = r;
     2229    poly c = 1 + c(1) + c(2);
     2230    poly ch = 2 + logg(c,4);
     2231    sheaf E = makeSheaf(X,ch);
     2232    sheaf S = E^3;
     2233    totalChernClass(S);
     2234}
    6492235
    6502236proc ChernClass(sheaf S, int i)
     2237"USAGE:     ChernClass(S,i); S sheaf, i int
     2238INPUT:      S is a sheaf, i is a nonnegative integer
     2239RETURN:     poly
     2240THEORY:     This is the i-th Chern class of a sheaf
     2241SEE ALSO:   topChernClass, totalChernClass
     2242EXAMPLE:    example ChernClass; shows an example
     2243"
    6512244{
    6522245    return (part(totalChernClass(S),i));
     2246}
     2247example
     2248{
     2249    "EXAMPLE:"; echo=2;
     2250    variety X;
     2251    X.dimension = 4;
     2252    ring r = 0,(c(1..2),d(1..3)),wp(1..2,1..3);
     2253    setring r;
     2254    X.baseRing = r;
     2255    poly c = 1 + c(1) + c(2);
     2256    poly ch = 2 + logg(c,4);
     2257    sheaf E = makeSheaf(X,ch);
     2258    sheaf S = E^3;
     2259    ChernClass(S,1);
     2260    ChernClass(S,2);
     2261    ChernClass(S,3);
     2262    ChernClass(S,4);
    6532263}
    6542264
     
    6562266"USAGE:     topChernClass(S); S sheaf
    6572267RETURN:     poly
    658 INPUT:      S -- a sheaf
    659 OUTPUT:     the top Chern class of the sheaf S
    660 EXAMPLE:    example topChernClass(S); shows examples
     2268INPUT:      S is a sheaf
     2269THEORY:     This is the top Chern class of a sheaf
     2270SEE ALSO:   ChernClass, totalChernClass
     2271EXAMPLE:    example topChernClass; shows an example
    6612272"
    6622273{
     
    6662277{
    6672278    "EXAMPLE:"; echo=2;
    668     def G24 = Grassmannian(2,4);
    669     def R = G24.baseRing;
     2279    variety G = Grassmannian(2,4);
     2280    def R = G.baseRing;
    6702281    setring R;
    671     def S = makeSheaf(G24,quotientBundle);
    672     def B = symmetricPowerSheaf(S,3);
     2282    sheaf S = makeSheaf(G,quotientBundle);
     2283    sheaf B = S^3;
    6732284    topChernClass(B);
    6742285}
     
    6772288"USAGE:     totalSegreClass(S); S sheaf
    6782289RETURN:     poly
    679 INPUT:      S -- a sheaf
    680 OUTPUT:     a polynomial which is the total Segre class of the sheaf S.
    681 EXAMPLE:    example totalSegreClass(S); shows examples
     2290INPUT:      S is a sheaf
     2291THEORY:     This is the total Segre class of a sheaf.
     2292SEE AlSO:   totalChernClass
     2293EXAMPLE:    example totalSegreClass; shows an example
    6822294"
    6832295{
    6842296    //def D = dualSheaf(S);
    685     def V = S.currentVariety;
     2297    variety V = S.currentVariety;
    6862298    def R = V.baseRing;
    6872299    setring R;
     
    7032315{
    7042316    "EXAMPLE:"; echo=2;
    705     def G24 = Grassmannian(2,4);
    706     def R = G24.baseRing;
     2317    variety G = Grassmannian(2,4);
     2318    def R = G.baseRing;
    7072319    setring R;
    708     def S = makeSheaf(G24,subBundle);
     2320    sheaf S = makeSheaf(G,subBundle);
    7092321    totalSegreClass(S);
    7102322}
     
    7132325"USAGE:     dualSheaf(S); S sheaf
    7142326RETURN:     sheaf
    715 INPUT:      S -- a sheaf
    716 OUTPUT:     the dual of the sheaf S
    717 EXAMPLE:    example dualSheaf(S); shows examples
    718 "
    719 {
    720     def V = S.currentVariety;
     2327THEORY:     This is the dual of a sheaf
     2328SEE ALSO:   addSheaf, symmetricPowerSheaf, tensorSheaf, quotSheaf
     2329EXAMPLE:    example dualSheaf; shows examples
     2330"
     2331{
     2332    variety V = S.currentVariety;
    7212333    int d = V.dimension;
    7222334    def R = V.baseRing;
     
    7322344{
    7332345    "EXAMPLE:"; echo=2;
    734     def G24 = Grassmannian(2,4);
    735     def R = G24.baseRing;
     2346    variety G = Grassmannian(2,4);
     2347    def R = G.baseRing;
    7362348    setring R;
    737     def S = makeSheaf(G24,subBundle);
    738     dualSheaf(S);
     2349    sheaf S = makeSheaf(G,subBundle);
     2350    sheaf D = dualSheaf(S);
     2351    D;
    7392352}
    7402353
     
    7422355"USAGE:     tensorSheaf(A,B); A sheaf, B sheaf
    7432356RETURN:     sheaf
    744 INPUT:      A, B -- two sheaves
    745 OUTPUT:     the tensor of two sheaves A and B
    746 EXAMPLE:    example tensorSheaf(A,B); shows examples
     2357THEORY:     This is the tensor product of two sheaves
     2358SEE ALSO:   addSheaf, symmetricPowerSheaf, quotSheaf, dualSheaf
     2359EXAMPLE:    example tensorSheaf; shows examples
    7472360"
    7482361{
    7492362    sheaf S;
    750     def V1 = A.currentVariety;
    751     def V2 = B.currentVariety;
     2363    variety V1 = A.currentVariety;
     2364    variety V2 = B.currentVariety;
    7522365    def R1 = V1.baseRing;
    7532366    setring R1;
     
    7772390{
    7782391    "EXAMPLE:"; echo=2;
    779     def G34 = Grassmannian(3,4);
    780     def R = G34.baseRing;
     2392    variety G = Grassmannian(3,4);
     2393    def R = G.baseRing;
    7812394    setring R;
    782     def S = makeSheaf(G34,subBundle);
    783     def Q = makeSheaf(G34, quotientBundle);
    784     S*Q;
     2395    sheaf S = makeSheaf(G,subBundle);
     2396    sheaf Q = makeSheaf(G,quotientBundle);
     2397    sheaf T = S*Q;
     2398    T;
    7852399}
    7862400
     
    7882402"USAGE:     symmetricPowerSheaf(S,n); S sheaf, n int
    7892403RETURN:     sheaf
    790 INPUT:      S -- a sheaf
    791             n -- an integer
    792 OUTPUT:     the n-th symmetric power of the sheaf S
    793 EXAMPLE:    example symmetricPowerSheaf(S,n); shows examples
    794 "
    795 {
    796     def V = S.currentVariety;
     2404THEORY:     This is the n-th symmetric power of a sheaf
     2405SEE ALSO:   quotSheaf, addSheaf, tensorSheaf, dualSheaf
     2406EXAMPLE:    example symmetricPowerSheaf; shows examples
     2407"
     2408{
     2409    variety V = S.currentVariety;
    7972410    def R = V.baseRing;
    7982411    setring R;
     
    8312444{
    8322445    "EXAMPLE:"; echo=2;
    833     def G24 = Grassmannian(2,4);
    834     def R = G24.baseRing;
     2446    variety G = Grassmannian(2,4);
     2447    def R = G.baseRing;
    8352448    setring R;
    836     def S = makeSheaf(G24,quotientBundle);
    837     def B = symmetricPowerSheaf(S,3);
     2449    sheaf S = makeSheaf(G,quotientBundle);
     2450    sheaf B = symmetricPowerSheaf(S,3);
    8382451    B;
    839 }
    840 
    841 proc minusSheaf(sheaf A, sheaf B)
     2452    sheaf A = S^3;
     2453    A;
     2454    A.ChernCharacter == B.ChernCharacter;
     2455}
     2456
     2457proc quotSheaf(sheaf A, sheaf B)
     2458"USAGE:     quotSheaf(A,B); A sheaf, B sheaf
     2459RETURN:     sheaf
     2460THEORY:     This is the quotient of two sheaves
     2461SEE ALSO:   addSheaf, symmetricPowerSheaf, tensorSheaf, dualSheaf
     2462EXAMPLE:    example quotSheaf; shows an example
     2463"
    8422464{
    8432465    sheaf S;
    844     def V1 = A.currentVariety;
    845     def V2 = B.currentVariety;
     2466    variety V1 = A.currentVariety;
     2467    variety V2 = B.currentVariety;
    8462468    def R1 = V1.baseRing;
    8472469    setring R1;
     
    8662488    }
    8672489}
    868 
    869 proc plusSheaf(sheaf A, sheaf B)
     2490example
     2491{
     2492    "EXAMPLE:"; echo=2;
     2493    variety G = Grassmannian(3,5);
     2494    def r = G.baseRing;
     2495    setring r;
     2496    sheaf S = makeSheaf(G,subBundle);
     2497    sheaf B = dualSheaf(S)^2;
     2498    sheaf B3 = dualSheaf(S)^3;
     2499    sheaf B5 = dualSheaf(S)^5;
     2500    variety PB = projectiveBundle(B);
     2501    def R = PB.baseRing;
     2502    setring R;
     2503    sheaf Q = makeSheaf(PB,QuotientBundle);
     2504    sheaf V = dualSheaf(Q)*B3;
     2505    sheaf A = B5 - V;
     2506    A;
     2507}
     2508
     2509proc addSheaf(sheaf A, sheaf B)
     2510"USAGE:     addSheaf(A,B); A sheaf, B sheaf
     2511RETURN:     sheaf
     2512THEORY:     This is the direct sum of two sheaves.
     2513SEE ALSO:   quotSheaf, symmetricPowerSheaf, tensorSheaf, dualSheaf
     2514EXAMPLE:    example addSheaf; shows an example
     2515"
    8702516{
    8712517    sheaf S;
    872     def V1 = A.currentVariety;
    873     def V2 = B.currentVariety;
     2518    variety V1 = A.currentVariety;
     2519    variety V2 = B.currentVariety;
    8742520    def R1 = V1.baseRing;
    8752521    setring R1;
     
    8942540    }
    8952541}
    896 
    897 ////////////////////////////////////////////////////////////////////////////////
    898 
    899 proc geometricMultiplicity(ideal I, ideal J)
    900 "USAGE:     geometricMultiplicity(I,J); I,J = ideals
    901 RETURN:     int
    902 INPUT:      I, J -- two ideals
    903 OTPUT:      an integer which is the intersection multiplicity of two subvarieties
    904             defined by the ideals I, J at the origin.
    905 EXAMPLE:    example geometricMultiplicity(I,J); shows examples
    906 "
    907 {
    908     def R = basering;
    909     setring R;
    910     ideal K = I + J;
    911     int v = vdim(std(K));
    912     return (v);
    913 }
    914 example
    915 {
    916     "EXAMPLE:"; echo=2;
    917     ring r = 0, (x,y,z,w), ds;
    918     ideal I = xz,xw,yz,yw;
    919     ideal J = x-z,y-w;
    920     geometricMultiplicity(I,J);
    921 }
    922 
    923 ////////////////////////////////////////////////////////////////////////////////
    924 
    925 proc serreMultiplicity(ideal I, ideal J)
    926 "USAGE:     serreMultiplicity(I,J); I,J = ideals
    927 RETURN:     int
    928 INPUT:      I, J -- two ideals
    929 OUTPUT:     the intersection multiplicity (defined by J. P. Serre)
    930             of two subvarieties defined by the ideals I, J at the origin.
    931 EXAMPLE:    example serreMultiplicity(I,J); shows examples
    932 "
    933 {
    934     def R = basering;
    935     setring R;
    936     int i = 0;
    937     int s = 0;
    938     module m = std(Tor(i,I,J));
    939     int t = sum(hilb(m,2));
    940     kill m;
    941     while (t != 0)
    942     {
    943         s = s + ((-1)^i)*t;
    944         i++;
    945         module m = std(Tor(i,I,J));
    946         t = sum(hilb(m,2));
    947         kill m;
    948     }
    949     return (s);
    950 }
    951 example
    952 {
    953     "EXAMPLE:"; echo=2;
    954     ring r = 0, (x,y,z,w), ds;
    955     ideal I = xz,xw,yz,yw;
    956     ideal J = x-z,y-w;
    957     serreMultiplicity(I,J);
    958 }
     2542example
     2543{
     2544    "EXAMPLE:"; echo=2;
     2545    variety G = Grassmannian(3,5);
     2546    def r = G.baseRing;
     2547    setring r;
     2548    sheaf S = makeSheaf(G,subBundle);
     2549    sheaf Q = makeSheaf(G,quotientBundle);
     2550    sheaf D = S + Q;
     2551    D;
     2552    D.ChernCharacter == rankSheaf(D);
     2553    totalChernClass(D) == 1;
     2554}
Note: See TracChangeset for help on using the changeset viewer.