Changeset 31e974 in git
 Timestamp:
 May 10, 2013, 10:20:08 AM (11 years ago)
 Branches:
 (u'fiekerDuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c1c65551e4b3a0de0b13ddf30446f6e9569681b5')
 Children:
 e5ecb5d7da3a3a0cdf0adcafcac47e81f1901433
 Parents:
 9b3ad3d7d7e4664e8d3edba66cf01c3625bda816
 gitauthor:
 Hans Schoenemann <hannes@mathematik.unikl.de>20130510 10:20:08+02:00
 gitcommitter:
 Hans Schoenemann <hannes@mathematik.unikl.de>20130510 10:24:55+02:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/schubert.lib
r9b3ad3 r31e974 1 1 //////////////////////////////////////////////////////////////////////////////// 2 version=" 1.0";2 version="Id"; 3 3 4 4 category="Algebraic Geometry"; 5 5 info=" 6 LIBRARY: schubert.lib Proceduces for Intersection Theory 6 LIBRARY: Schubert.lib Proceduces for Intersection Theory 7 8 AUTHOR: Hiep Dang, email: hiep@mathematik.unikl.de 9 10 OVERVIEW: 11 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 16 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 0cycles). 7 19 8 20 PROCEDURES: 9 projectiveSpace(n) Chow ring of projective space of dimension n 10 grassmannian(k,n) Chow ring of Grassmannian of kplanes on an nspace 11 projectiveBundle(f,d) Chow ring of projective bundles 12 grassmannBundle(k,f,d) Chow ring of Grassmann bundles 13 integral(f) compute intersection number 14 dual(f) dual of a vector bundle 15 tensorBundle(f,g,d) tensor of two vector bundles 16 symmPower(n,f,d) nth symmetric power of a vector bundle 17 chern(f,d) total Chern class of a vector bundle 18 segre(f,d) total Segre class of a vector bundle 19 rankBundle(f) rank of a vector bundle 21 makeVariety(int,ideal) create a variety 22 productVariety(variety,variety) product of two varieties 23 ChowRing(variety) create the Chow ring of a variety 24 dimension(variety) dimension of a variety 25 relations(variety) relations of a variety 26 Grassmannian(int,int) create a Grassmannian as a variety 27 projectiveSpace(int) create a projective space as a variety 28 projectiveBundle(sheaf) create a projective bundle as a variety 29 integral(variety,poly) degree of a 0cycle on a variety 30 makeSheaf(variety,poly) create a sheaf 31 ChernCharacter(sheaf) the Chern character of a sheaf 32 totalChernClass(sheaf) the total Chern class of a sheaf 33 ChernClass(sheaf,int) the kth Chern class of a sheaf 34 topChernClass(sheaf) the top Chern class of a sheaf 35 totalSegreClass(sheaf) the total Segre class of a sheaf 36 dualSheaf(sheaf) the dual of a sheaf 37 tensorSheaf(sheaf,sheaf) the tensor of two sheaves 38 symmetricPowerSheaf(sheaf,int) the kth symmetric power of a sheaf 39 minusSheaf(sheaf,sheaf) the quotient of two sheaves 40 plusSheaf(sheaf,sheaf) the direct sum of two sheaves 41 42 REFERENCES: 43 44 Hiep Dang, Intersection theory with applications to the computation of 45 GromovWitten invariants, Ph.D thesis, TU Kaiserslautern, 2013. 46 47 Sheldon Katz and Stein A. Stromme, SchubertA Maple package for intersection 48 theory and enumerative geometry, 1992. 49 50 Daniel R. Grayson, Michael E. Stillman, Stein A. Stromme, David Eisenbud and 51 Charley Crissman, Schubert2A Macaulay2 package for computation in 52 intersection theory, 2010. 20 53 21 54 KEYWORDS: Intersection Theory, Enumerative Geometry, Schubert Calculus … … 25 58 26 59 LIB "general.lib"; 27 28 //////////////////////////////////////////////////////////////////////////////// 29 30 //////////////////////////////////////////////////////////////////////////////// 31 /// Procedures concerned with abstract varieties /////////////////////////////// 32 //////////////////////////////////////////////////////////////////////////////// 33 34 //////////////////////////////////////////////////////////////////////////////// 35 36 proc projectiveSpace(int n) 37 "USAGE: projectiveSpace(n); n int 38 RETURN: ring 39 PURPOSE: create a polynomial ring in one variable h, where h is the hyperplane 40 class of this projective space. The monomial ordering of this ring is 41 'wp' (weighted reverse lexicographical ordering) with vector (1). 42 Moreover, we export an ideal (say 'rels') generated by h^{n+1} and 43 the quotient ring modulo this ideal should be its Chow ring. 44 EXAMPLE: example projectiveSpace; shows examples 45 " 46 { 47 ring CR = 0, (h), wp(1); 48 int d = n; 49 poly u = 1; 50 poly v = 1 + h; 51 list l; 52 int i; 53 for (i=1;i<=n;i++) 54 { 55 l=insert(l,1,size(l)); 56 u=u+(1)^i*schur(l,v); 57 } 58 ideal rels = h^(n+1); 59 rels = std(rels); 60 poly s = reduce(logg(u,d)+n,rels); 61 poly q = reduce(logg(v,d)+1,rels); 62 export (s,q,rels); 63 return (CR); 64 } 65 example 66 { 67 "EXAMPLE:"; echo=2; 68 def P3 = projectiveSpace(3); 69 setring P3; 70 s; q; rels; 71 } 72 73 proc grassmannian(int k, int n) 74 "USAGE: grassmannian(k,n); k int, n int 75 RETURN: ring 76 PURPOSE: create a polynomial ring in n variables, in which the first k 77 variables s(1),...,s(k) will be the Chern classes of the 78 tautological subbundle on Grassmannian G(k,n) and the next nk 79 variables q(1),...,q(nk) will be the Chern classes of the 80 tautological quotient bundle on G(k,n). The monomial ordering 81 of this ring is 'wp' (weighted reverse lexicographical ordering) 82 with vector (1..k,1..nk). 83 Moreover, we export the Chern characters of the tautological 84 subbundle and quotient bundle on G(k,n) (say 's' and 'q'). They 85 are the polynomials. One more thing, we export an ideal 86 (say 'rels') generated by the relations between the Chern 87 variables and the quotient ring modulo this ideal should be Chow 88 ring of G(k,n). 89 EXAMPLE: example grassmannian; shows examples 90 " 91 { 92 ring CR = 0, (q(1..nk)), wp(1..nk); 93 int d = k*(nk); 94 int i,j,h; 95 poly v = 1; 96 poly u = 1; 97 for (j=1;j<=nk;j++) {v=v+q(j);} 98 list l; 99 for (i=1;i<=k;i++) 100 { 101 l=insert(l,1,size(l)); 102 u=u+(1)^i*schur(l,v); 103 } 104 ideal rels; 105 for (h=k+1;h<=n;h++) 106 { 107 l=insert(l,1,size(l)); 108 rels=rels,schur(l,v); 109 } 110 rels = std(rels); 111 poly s = reduce(logg(u,d)+k,rels); 112 poly q = reduce(logg(v,d)+nk,rels); 113 export (s,q,rels); 114 return (CR); 115 } 116 example 117 { 118 "EXAMPLE:"; echo=2; 119 def G24 = grassmannian(2,4); 120 setring G24; 121 s; q; rels; 122 } 123 124 //////////////////////////////////////////////////////////////////////////////// 125 126 proc projectiveBundle(poly f, int d) 127 "USAGE: projectiveBundle(f,d); f poly, d int 128 RETURN: ring 129 PURPOSE: create a polynomial ring which we work on. 130 we export an ideal (say 'rels') generated by the relations between 131 the Chern variables and the quotient ring modulo this ideal should 132 be its Chow ring. 133 EXAMPLE: example projectiveBundle; shows examples 134 " 135 { 136 def R = basering; 137 setring R; 138 int r = rankBundle(f); 139 poly c = chern(f,d); 140 ring P = 0, (z), wp(1); 141 def CR = P + R; 142 setring CR; 143 int dd = r1 + d; 144 poly c = imap(R,c); 145 ideal rels = imap(R,rels); 146 poly g = z^r; 147 int i; 148 for (i=1;i<=r;i++) {g=g+z^(ri)*part(c,i);} 149 rels=std(rels,g); 150 poly u = 1 + z; 151 poly Q = reduce(logg(u,dd)+1,rels); 152 export (rels,Q); 153 return (CR); 154 } 155 example 156 { 157 "EXAMPLE:"; echo=2; 158 def G35 = grassmannian(3,5); 159 setring G35; 160 int d = 6; 161 poly f = symmPower(2,dual(s),6); 162 def PB = projectiveBundle(f,6); 163 setring PB; 164 int d = 14; 165 Q; rels; 166 } 167 //////////////////////////////////////////////////////////////////////////////// 168 169 proc grassmannBundle(int k, poly f, int d) 170 "USAGE: grassmannBundle(k,f,d); k int, f poly, d int 171 RETURN: ring 172 PURPOSE: create a polynomial ring which we work on. 173 we export the Chern characters of the tautological subbundle and 174 quotient bundle on this Grassmann bundle (say 'S' and 'Q'). 175 They are the polynomials. One more thing, we also export an ideal 176 (say 'rels') generated by the relations between the Chern variables 177 and the quotient ring modulo this ideal should be its Chow ring. 178 EXAMPLE: example grassmannBundle; shows examples 179 " 180 { 181 def R = basering; 182 setring R; 183 int r = rankBundle(f); 184 ring G = 0, (S(1..k),Q(1..rk)), wp(1..k,1..rk); 185 def CR = G + R; 186 setring CR; 187 int dd = k*(rk)+d; 188 poly f = imap(R,f); 189 ideal rels = imap(R,rels); 190 poly u = 1; 191 poly v = 1; 192 int i,j,h; 193 for (i=1;i<=k;i++) {u=u+S(i);} 194 for (j=1;j<=rk;j++) {v=v+Q(j);} 195 poly g = u*v; 196 ideal I = part(g,1)part(expp(f,r),1); 197 for (h=2;h<=r;h++) {I = I,part(g,h)part(expp(f,r),h);} 198 def J = I + rels; 199 ideal rels = std(J); 200 poly S = reduce(logg(u,dd)+k,rels); 201 poly Q = reduce(logg(v,dd)+rk,rels); 202 export (rels,S,Q); 203 return (CR); 204 } 205 example 206 { 207 "EXAMPLE:"; echo=2; 208 def G25 = grassmannian(2,5); 209 setring G25; 210 int d = 6; 211 poly f = dual(symmPower(2,q,6)); 212 def GB = grassmannBundle(5,f,6); 213 setring GB; 214 int d = 14; 215 S; Q; rels; 216 } 217 218 //////////////////////////////////////////////////////////////////////////////// 60 LIB "homolog.lib"; 61 62 //////////////////////////////////////////////////////////////////////////////// 63 /// create new classes: varieties and sheaves ////////////////////////////////// 64 //////////////////////////////////////////////////////////////////////////////// 65 66 proc mod_init() 67 { 68 newstruct("variety","int dimension, ring baseRing, ideal relations"); 69 newstruct("sheaf","variety currentVariety, poly ChernCharacter"); 70 71 system("install","variety","print",variety_print,1); 72 system("install","variety","*",productVariety,2); 73 system("install","sheaf","print",sheaf_print,1); 74 system("install","sheaf","*",tensorSheaf,2); 75 system("install","sheaf","+",plusSheaf,2); 76 system("install","sheaf","",minusSheaf,2); 77 } 219 78 220 79 //////////////////////////////////////////////////////////////////////////////// 221 80 /// Auxilary Static Procedures in this Library ///////////////////////////////// 222 81 //////////////////////////////////////////////////////////////////////////////// 223 ///  part 224 ///  parts 225 ///  logg 226 ///  expp 227 ///  adams 228 ///  wedges 229 ///  integral 230 //////////////////////////////////////////////////////////////////////////////// 231 232 //////////////////////////////////////////////////////////////////////////////// 233 234 static proc part(poly f, int n) 82 ////////  part //////////////////////////////////////////////////////////// 83 ////////  parts //////////////////////////////////////////////////////////// 84 ////////  logg //////////////////////////////////////////////////////////// 85 ////////  expp //////////////////////////////////////////////////////////// 86 ////////  adams //////////////////////////////////////////////////////////// 87 ////////  wedges //////////////////////////////////////////////////////////// 88 ////////  schur //////////////////////////////////////////////////////////// 89 //////////////////////////////////////////////////////////////////////////////// 90 91 proc part(poly f, int n) 92 "USAGE: part(f,n); f poly, n int 93 RETURN: poly 94 PURPOSE: return the homogeneous component of degree n of the polynomial f. 95 EXAMPLE: example part; shows examples 96 " 235 97 { 236 98 int i; … … 238 100 for (i=1;i<=size(f);i++) 239 101 { 240 if (deg(f[i])==n) 241 { 242 p=p+f[i]; 243 } 102 if (deg(f[i])==n) {p=p+f[i];} 244 103 } 245 104 return (p); 246 105 } 247 248 //////////////////////////////////////////////////////////////////////////////// 249 250 static proc parts(poly f, int i, int j) 106 example 107 { 108 "EXAMPLE:"; echo=2; 109 ring r = 0,(x,y,z),wp(1,2,3); 110 poly f = 1+x+x2+x3+x4+y+y2+y3+z+z2+xy+xz+yz+xyz; 111 part(f,0); 112 part(f,1); 113 part(f,2); 114 part(f,3); 115 part(f,4); 116 part(f,5); 117 part(f,6); 118 } 119 120 proc parts(poly f, int i, int j) 121 "USAGE: parts(f,i,j); f poly, i int, j int 122 RETURN: 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. 125 EXAMPLE: example parts; shows examples 126 " 251 127 { 252 128 int k; … … 258 134 return (p); 259 135 } 260 261 //////////////////////////////////////////////////////////////////////////////// 262 263 static proc logg(poly f, int n) 136 example 137 { 138 "EXAMPLE:"; echo=2; 139 ring r = 0,(x,y,z),wp(1,2,3); 140 poly f = 1+x+x2+x3+x4+y+y2+y3+z+z2+xy+xz+yz+xyz; 141 parts(f,2,4); 142 } 143 proc logg(poly f, int n) 144 "USAGE: logg(f,n); f poly, n int 145 RETURN: poly 146 PURPOSE: computing the Chern character from the total Chern class. 147 EXAMPLE: example logg; shows examples 148 " 264 149 { 265 150 poly p; … … 288 173 return (p); 289 174 } 290 291 //////////////////////////////////////////////////////////////////////////////// 292 293 static proc expp(poly f, int n) 175 example 176 { 177 "EXAMPLE:"; echo=2; 178 ring r = 0,(x,y),wp(1,2); 179 poly f = 1+x+y; 180 logg(f,4); 181 } 182 183 proc expp(poly f, int n) 184 "USAGE: expp(f,n); f poly, n int 185 RETURN: poly 186 PURPOSE: computing the total Chern class from the Chern character. 187 EXAMPLE: example expp; shows examples 188 " 294 189 { 295 190 poly p; … … 316 211 return (p); 317 212 } 318 319 //////////////////////////////////////////////////////////////////////////////// 213 example 214 { 215 "EXAMPLE:"; echo=2; 216 ring r = 0,(x),dp; 217 poly f = 3+x; 218 expp(f,3); 219 } 320 220 321 221 static proc adams(poly f, int n) … … 329 229 return (p); 330 230 } 331 332 ////////////////////////////////////////////////////////////////////////////////333 231 334 232 static proc wedges(int n, poly f, int d) … … 355 253 } 356 254 357 ////////////////////////////////////////////////////////////////////////////////358 359 255 static proc schur(list p, poly f) 360 256 { … … 373 269 374 270 //////////////////////////////////////////////////////////////////////////////// 375 376 proc integral(poly f) 377 "USAGE: integral(f); f poly 271 //////// Procedures concerned with varieties /////////////////////////////////// 272 //////////////////////////////////////////////////////////////////////////////// 273 274 proc variety_print(variety V) 275 { 276 "A variety of dimension", V.dimension; 277 } 278 279 proc makeVariety(int d, ideal i) 280 { 281 def R = basering; 282 variety V; 283 V.dimension = d; 284 V.baseRing = R; 285 V.relations = i; 286 return(V); 287 } 288 289 proc dimension(variety V) 290 { 291 return (V.dimension); 292 } 293 294 proc ChowRing(variety V) 295 { 296 def R = V.baseRing; 297 setring R; 298 ideal rels = V.relations; 299 qring CR = std(rels); 300 return (CR); 301 } 302 303 proc relations(variety V) 304 { 305 def R = V.baseRing; 306 setring R; 307 ideal i = V.relations; 308 return (i); 309 } 310 311 //////////////////////////////////////////////////////////////////////////////// 312 313 proc Grassmannian(int k, int n, list #) 314 "USAGE: Grassmannian(k,n); k int, n int 315 RETURN: variety 316 PURPOSE: create a variety as a Grassmannian G(k,n). This variety has 317 diemnsion k(nk) and its Chow ring is the quotient ring of a 318 polynomial ring in nk variables q(1),...,q(nk) which are the 319 Chern classes of the tautological quotient bundle on the 320 Grassmannian G(k,n), modulo the ideal generated by nk polynomials 321 which come from the Giambelli formula. The monomial ordering of this 322 ring is 'wp' with vector (1..k,1..nk). Moreover, we export the 323 Chern characters of the tautological subbundle and quotient bundle 324 on G(k,n) (say 'subBundle' and 'quotientBundle'). 325 EXAMPLE: example Grassmannian; shows examples 326 " 327 { 328 string q; 329 if (size(#)==0) {q = "q";} 330 else 331 { 332 if (typeof(#[1]) == "string") {q = #[1];} 333 else {Error("invalid optional argument");} 334 } 335 variety G; 336 G.dimension = k*(nk); 337 execute("ring r = 0,("+q+"(1..nk)),wp(1..nk);"); 338 setring r; 339 G.baseRing = r; 340 int i,j; 341 poly v = 1; 342 poly u = 1; 343 for (j=1;j<=nk;j++) {v=v+q(j);} 344 list l; 345 for (i=1;i<=k;i++) 346 { 347 l=insert(l,1,size(l)); 348 u=u+(1)^i*schur(l,v); 349 } 350 l=insert(l,1,size(l)); 351 ideal rels = schur(l,v); 352 int h = k+2; 353 while (h<=n) 354 { 355 l=insert(l,1,size(l)); 356 rels = rels,schur(l,v); 357 h++; 358 } 359 G.relations = rels; 360 int d = k*(nk); 361 poly subBundle = reduce(logg(u,d)+k,std(rels)); 362 poly quotientBundle = reduce(logg(v,d)+nk,std(rels)); 363 export (subBundle,quotientBundle); 364 kill u,v,d,l,rels; 365 return (G); 366 } 367 example 368 { 369 "EXAMPLE:"; echo=2; 370 def G24 = Grassmannian(2,4); 371 G24; 372 def r = G24.baseRing; 373 subBundle; 374 quotientBundle; 375 G24.dimension; 376 G24.relations; 377 ChowRing(G24); 378 } 379 380 proc projectiveSpace(int n, list #) 381 "USAGE: projectiveSpace(n); n int 382 RETURN: 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). 386 EXAMPLE: example projectiveSpace; shows examples 387 " 388 { 389 string h; 390 if (size(#)==0) {h = "h";} 391 else 392 { 393 if (typeof(#[1]) == "string") {h = #[1];} 394 else {Error("invalid optional argument");} 395 } 396 variety P; 397 P.dimension = n; 398 execute("ring r = 0, ("+h+"), wp(1);"); 399 setring r; 400 P.baseRing = r; 401 ideal rels = var(1)^(n+1); 402 P.relations = rels; 403 poly u = 1; 404 poly v = 1 + var(1); 405 list l; 406 int i; 407 for (i=1;i<=n;i++) 408 { 409 l=insert(l,1,size(l)); 410 u=u+(1)^i*schur(l,v); 411 } 412 poly subBundle = reduce(logg(u,n)+n,std(rels)); 413 poly quotientBundle = reduce(logg(v,n)+1,std(rels)); 414 export(subBundle,quotientBundle); 415 kill rels,u,v,l; 416 return (P); 417 } 418 example 419 { 420 "EXAMPLE:"; echo=2; 421 def P = projectiveSpace(3); 422 P; 423 P.dimension; 424 def r = P.baseRing; 425 setring r; 426 P.relations; 427 ChowRing(P); 428 } 429 430 proc projectiveBundle(sheaf S, list #) 431 "USAGE: projectiveBundle(S); S sheaf 432 RETURN: variety 433 PURPOSE: create a variety which we work on. 434 EXAMPLE: example projectiveBundle; shows examples 435 " 436 { 437 string z; 438 if (size(#)==0) {z = "z";} 439 else 440 { 441 if (typeof(#[1]) == "string") {z = #[1];} 442 else {Error("invalid optional argument");} 443 } 444 variety A; 445 def B = S.currentVariety; 446 def R = B.baseRing; 447 setring R; 448 ideal rels = B.relations; 449 int r = rankSheaf(S); 450 A.dimension = r  1 + B.dimension; 451 poly c = totalChernClass(S); 452 execute("ring P = 0, ("+z+"), wp(1);"); 453 def CR = P + R; 454 setring CR; 455 A.baseRing = CR; 456 poly c = imap(R,c); 457 ideal rels = imap(R,rels); 458 poly g = var(1)^r; 459 int i; 460 for (i=1;i<=r;i++) {g=g+var(1)^(ri)*part(c,i);} 461 A.relations = rels,g; 462 poly u = 1 + var(1); 463 poly f = logg(u,A.dimension)+1; 464 poly QuotientBundle = reduce(f,std(A.relations)); 465 export (QuotientBundle); 466 kill f,rels; 467 return (A); 468 } 469 example 470 { 471 "EXAMPLE:"; echo=2; 472 def G35 = Grassmannian(3,5); 473 def R = G35.baseRing; 474 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; 481 QuotientBundle; 482 ChowRing(PB); 483 } 484 485 proc productVariety(variety U, variety V) 486 { 487 //def br = basering; 488 def ur = U.baseRing; setring ur; 489 ideal ii1 = U.relations; 490 def vr = V.baseRing; setring vr; 491 ideal ii2 = V.relations; 492 variety W; 493 W.dimension = U.dimension + V.dimension; 494 def temp = ringtensor(ur,vr); 495 setring temp; 496 W.baseRing = temp; 497 ideal i1 = imap(ur,ii1); 498 ideal i2 = imap(vr,ii2); 499 W.relations = i1 + i2; 500 //setring br; 501 return (W); 502 } 503 504 //////////////////////////////////////////////////////////////////////////////// 505 506 proc integral(variety V, poly f) 507 "USAGE: integral(V,f); V variety, f poly 378 508 RETURN: int 379 PURPOSE: compute the intersection number. 380 That is the degree of top Chern class. 381 EXAMPLE: example integral; shows examples 382 " 383 { 384 return (leadcoef(reduce(f,rels))); 385 } 386 example 387 { 388 "EXAMPLE:"; echo=2; 389 def G25 = grassmannian(2,5); 390 setring G25; 391 integral(q(2)^3); 392 } 393 394 //////////////////////////////////////////////////////////////////////////////// 395 396 //////////////////////////////////////////////////////////////////////////////// 397 /// Procedures concerned with vector bundles /////////////////////////////////// 398 //////////////////////////////////////////////////////////////////////////////// 399 400 //////////////////////////////////////////////////////////////////////////////// 401 402 proc symmPower(int n, poly f, int d) 403 "USAGE: symmPower(n,f,d); n int, f poly, d int 509 PURPOSE: compute the intersection numbers. 510 EXAMPLE: example integral; shows examples 511 " 512 { 513 def R = V.baseRing; 514 setring R; 515 ideal rels = V.relations; 516 return (leadcoef(reduce(f,std(rels)))); 517 } 518 example 519 { 520 "EXAMPLE:"; echo=2; 521 def G24 = Grassmannian(2,4); 522 def R = G24.baseRing; 523 setring R; 524 integral(G24,q(1)^4); 525 } 526 527 proc SchubertClass(list p) 528 "USAGE: SchubertClass(p); p list 404 529 RETURN: poly 405 INPUT: n  integer 406 f  Chern character of a given vector bundle 407 d  dimension of current variety. 408 OUTPUT: a polynomial which is the Chern character of the nth symmetric 409 power of the vector bundle defined by 'f' 410 EXAMPLE: example symmPower(n,f,d); shows examples 411 " 412 { 530 PURPOSE: compute the Schubert class on a Grassmannian. 531 EXAMPLE: example SchubertClass; shows examples 532 " 533 { 534 def R = basering; 535 setring R; 536 poly f = 1; 537 if (size(p) == 0) {return (f);} 538 int i; 539 for (i=1;i<=nvars(R);i++) 540 { 541 f = f + var(i); 542 } 543 return (schur(p,f)); 544 } 545 example 546 { 547 "EXAMPLE:"; echo=2; 548 def G = Grassmannian(2,4); 549 def r = G.baseRing; 550 setring r; 551 list p = 1,1; 552 SchubertClass(p); 553 } 554 555 //////////////////////////////////////////////////////////////////////////////// 556 557 proc dualPartition(int k, int n, list p) 558 { 559 while (size(p) < k) 560 { 561 p = insert(p,0,size(p)); 562 } 563 int i; 564 list l; 565 for (i=1;i<=size(p);i++) 566 { 567 l[i] = nkp[size(p)i+1]; 568 } 569 return (l); 570 } 571 572 //////////////////////////////////////////////////////////////////////////////// 573 574 //////////////////////////////////////////////////////////////////////////////// 575 ////////// Procedures concerned with sheaves /////////////////////////////////// 576 //////////////////////////////////////////////////////////////////////////////// 577 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)); 587 } 588 589 proc makeSheaf(variety V, poly ch) 590 { 591 def R = basering; 592 sheaf S; 593 S.currentVariety = V; 594 S.ChernCharacter = ch; 595 return(S); 596 } 597 598 proc currentVariety(sheaf S) 599 { 600 return (S.currentVariety); 601 } 602 603 proc ChernCharacter(sheaf S) 604 { 605 return (S.ChernCharacter) 606 } 607 608 proc rankSheaf(sheaf S) 609 "USAGE: rankSheaf(S); S sheaf 610 RETURN: 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; 617 def R = V.baseRing; 618 setring R; 619 poly f = S.ChernCharacter; 620 return (int(part(f,0))); 621 } 622 example 623 { 624 "EXAMPLE:"; echo=2; 625 def G24 = Grassmannian(2,4); 626 def R = G24.baseRing; 627 setring R; 628 def S = makeSheaf(G24,subBundle); 629 rankSheaf(S); 630 } 631 632 proc totalChernClass(sheaf S) 633 "USAGE: totalChernClass(S); f sheaf 634 RETURN: 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; 641 int d = V.dimension; 642 def R = V.baseRing; 643 setring R; 644 poly ch = S.ChernCharacter; 645 poly f = expp(ch,d); 646 ideal rels = std(V.relations); 647 return (reduce(f,rels)); 648 } 649 650 proc ChernClass(sheaf S, int i) 651 { 652 return (part(totalChernClass(S),i)); 653 } 654 655 proc topChernClass(sheaf S) 656 "USAGE: topChernClass(S); S sheaf 657 RETURN: poly 658 INPUT: S  a sheaf 659 OUTPUT: the top Chern class of the sheaf S 660 EXAMPLE: example topChernClass(S); shows examples 661 " 662 { 663 return (ChernClass(S,rankSheaf(S))); 664 } 665 example 666 { 667 "EXAMPLE:"; echo=2; 668 def G24 = Grassmannian(2,4); 669 def R = G24.baseRing; 670 setring R; 671 def S = makeSheaf(G24,quotientBundle); 672 def B = symmetricPowerSheaf(S,3); 673 topChernClass(B); 674 } 675 676 proc totalSegreClass(sheaf S) 677 "USAGE: totalSegreClass(S); S sheaf 678 RETURN: 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 682 " 683 { 684 //def D = dualSheaf(S); 685 def V = S.currentVariety; 686 def R = V.baseRing; 687 setring R; 688 poly f = totalChernClass(S); 689 poly g; 690 int d = V.dimension; 691 ideal rels = std(V.relations); 692 if (f == 1) {return (1);} 693 else 694 { 695 poly t,h; 696 int i,j; 697 for (i=0;i<=d;i++) {t = t + (1f)^i;} 698 for (j=0;j<=d;j++) {h = h + part(t,j);} 699 return (reduce(h,rels)); 700 } 701 } 702 example 703 { 704 "EXAMPLE:"; echo=2; 705 def G24 = Grassmannian(2,4); 706 def R = G24.baseRing; 707 setring R; 708 def S = makeSheaf(G24,subBundle); 709 totalSegreClass(S); 710 } 711 712 proc dualSheaf(sheaf S) 713 "USAGE: dualSheaf(S); S sheaf 714 RETURN: 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; 721 int d = V.dimension; 722 def R = V.baseRing; 723 setring R; 724 poly ch = S.ChernCharacter; 725 poly f = adams(ch,1); 726 sheaf D; 727 D.currentVariety = V; 728 D.ChernCharacter = f; 729 return (D); 730 } 731 example 732 { 733 "EXAMPLE:"; echo=2; 734 def G24 = Grassmannian(2,4); 735 def R = G24.baseRing; 736 setring R; 737 def S = makeSheaf(G24,subBundle); 738 dualSheaf(S); 739 } 740 741 proc tensorSheaf(sheaf A, sheaf B) 742 "USAGE: tensorSheaf(A,B); A sheaf, B sheaf 743 RETURN: 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 747 " 748 { 749 sheaf S; 750 def V1 = A.currentVariety; 751 def V2 = B.currentVariety; 752 def R1 = V1.baseRing; 753 setring R1; 754 poly c1 = A.ChernCharacter; 755 def R2 = V2.baseRing; 756 setring R2; 757 poly c2 = B.ChernCharacter; 758 if (nvars(R1) < nvars(R2)) 759 { 760 S.currentVariety = V2; 761 poly c = imap(R1,c1); 762 poly f = parts(c*c2,0,V2.dimension); 763 S.ChernCharacter = f; 764 return (S); 765 } 766 else 767 { 768 setring R1; 769 S.currentVariety = V1; 770 poly c = imap(R2,c2); 771 poly f = parts(c1*c,0,V1.dimension); 772 S.ChernCharacter = f; 773 return (S); 774 } 775 } 776 example 777 { 778 "EXAMPLE:"; echo=2; 779 def G34 = Grassmannian(3,4); 780 def R = G34.baseRing; 781 setring R; 782 def S = makeSheaf(G34,subBundle); 783 def Q = makeSheaf(G34, quotientBundle); 784 S*Q; 785 } 786 787 proc symmetricPowerSheaf(sheaf S, int n) 788 "USAGE: symmetricPowerSheaf(S,n); S sheaf, n int 789 RETURN: sheaf 790 INPUT: S  a sheaf 791 n  an integer 792 OUTPUT: the nth symmetric power of the sheaf S 793 EXAMPLE: example symmetricPowerSheaf(S,n); shows examples 794 " 795 { 796 def V = S.currentVariety; 797 def R = V.baseRing; 798 setring R; 799 int r = rankSheaf(S); 800 int d = V.dimension; 413 801 int i,j,m; 414 int r = rankBundle(f);802 poly f = S.ChernCharacter; 415 803 poly result; 416 804 list s,w; … … 435 823 result = s[n+1]; 436 824 } 437 return (result); 438 } 439 example 440 { 441 "EXAMPLE:"; echo=2; 442 def G24 = grassmannian(2,4); 443 setring G24; 444 int d = 4; 445 symmPower(3,q,d); 446 } 447 //////////////////////////////////////////////////////////////////////////////// 448 449 proc dual(poly f) 450 "USAGE: dual(f); f poly 451 RETURN: poly 452 INPUT: f  Chern character of a vector bundle 453 OUTPUT: a polynomial which is the Chern character of the dual of the vector 454 bundle defined by 'f'. 455 EXAMPLE: example dual(f); shows examples 456 " 457 { 458 return (adams(f,1)); 459 } 460 example 461 { 462 "EXAMPLE:"; echo=2; 463 def G24 = grassmannian(); 464 setring G24; 465 dual(s); 466 } 467 468 //////////////////////////////////////////////////////////////////////////////// 469 470 proc tensorBundle(poly f, poly g, int d) 471 "USAGE: tensorBundle(f,g,d); f poly, g poly, d int 472 RETURN: poly 473 INPUT: f, g  Chern characters of two vector bundles 474 d  dimension of current variety. 475 OUTPUT: a polynomial which is the Chern character of the tensor of two 476 vector bundles defined by 'f' and 'g' respectively. 477 EXAMPLE: example tensorBundle(f,g,d); shows examples 478 " 479 { 480 return (parts(f*g,0,d)); 481 } 482 example 483 { 484 "EXAMPLE:"; echo=2; 485 def G34 = grassmannian(3,4); 486 setring G34; 487 int d = 3; 488 tensorBundle(s,q,d); 489 } 490 491 //////////////////////////////////////////////////////////////////////////////// 492 493 proc chern(poly f, int d) 494 "USAGE: chern(f,d); f poly, d int 495 RETURN: poly 496 INPUT: f  Chern character of a given vector bundle 497 d  dimension of current variety 498 OUTPUT: a polynomial which is the total Chern class of the vector bundle 499 defined by 'f'. 500 EXAMPLE: example chern(f,d); shows examples 501 " 502 { 503 poly c = reduce(expp(f,d),rels); 504 return (c); 505 } 506 example 507 { 508 "EXAMPLE:"; echo=2; 509 def G24 = grassmannian(2,4); 510 setring G24; 511 int d = 4; 512 chern(q,d); 513 } 514 515 //////////////////////////////////////////////////////////////////////////////// 516 517 proc segre(poly f, int d) 518 "USAGE: segre(f,d); f poly, d int 519 RETURN: poly 520 INPUT: f  Chern character of a given vector bundle 521 d  dimension of current variety 522 OUTPUT: a polynomial which is the total Segre class of the vector bundle 523 defined by 'f'. 524 EXAMPLE: example segre(f,d); shows examples 525 " 526 { 527 poly g = dual(chern(f,d)); 528 if (g==1) {return (1);} 529 else 530 { 531 poly t,h; 532 int i,j; 533 for (i=0;i<=d;i++) {t = t + (1g)^i;} 534 for (j=0;j<=d;j++) {h = h + part(t,j);} 535 return (reduce(h,rels)); 536 } 537 } 538 example 539 { 540 "EXAMPLE:"; echo=2; 541 def G24 = grassmannian(2,4); 542 setring G24; 543 int d = 4; 544 segre(q,d); 545 } 546 547 //////////////////////////////////////////////////////////////////////////////// 548 549 proc rankBundle(poly f) 550 "USAGE: rankBundle(f); f poly 551 RETURN: poly 552 INPUT: f  Chern character of a given vector bundle 553 OUTPUT: an integer which is the rank of the vector bundle defined by 'f'. 554 EXAMPLE: example rankBundle(f); shows examples 555 " 556 { 557 return (int(part(f,0))); 558 } 559 example 560 { 561 "EXAMPLE:"; echo=2; 562 def G24 = grassmannian(2,4); 563 setring G24; 564 int d = 4; 565 rankBundle(q); 566 } 825 sheaf A; 826 A.currentVariety = V; 827 A.ChernCharacter = result; 828 return (A); 829 } 830 example 831 { 832 "EXAMPLE:"; echo=2; 833 def G24 = Grassmannian(2,4); 834 def R = G24.baseRing; 835 setring R; 836 def S = makeSheaf(G24,quotientBundle); 837 def B = symmetricPowerSheaf(S,3); 838 B; 839 } 840 841 proc minusSheaf(sheaf A, sheaf B) 842 { 843 sheaf S; 844 def V1 = A.currentVariety; 845 def V2 = B.currentVariety; 846 def R1 = V1.baseRing; 847 setring R1; 848 poly c1 = A.ChernCharacter; 849 def R2 = V2.baseRing; 850 setring R2; 851 poly c2 = B.ChernCharacter; 852 if (nvars(R1) < nvars(R2)) 853 { 854 S.currentVariety = V2; 855 poly c = imap(R1,c1); 856 S.ChernCharacter = c  c2; 857 return (S); 858 } 859 else 860 { 861 setring R1; 862 S.currentVariety = V1; 863 poly c = imap(R2,c2); 864 S.ChernCharacter = c1  c; 865 return (S); 866 } 867 } 868 869 proc plusSheaf(sheaf A, sheaf B) 870 { 871 sheaf S; 872 def V1 = A.currentVariety; 873 def V2 = B.currentVariety; 874 def R1 = V1.baseRing; 875 setring R1; 876 poly c1 = A.ChernCharacter; 877 def R2 = V2.baseRing; 878 setring R2; 879 poly c2 = B.ChernCharacter; 880 if (nvars(R1) < nvars(R2)) 881 { 882 S.currentVariety = V2; 883 poly c = imap(R1,c1); 884 S.ChernCharacter = c + c2; 885 return (S); 886 } 887 else 888 { 889 setring R1; 890 S.currentVariety = V1; 891 poly c = imap(R2,c2); 892 S.ChernCharacter = c1 + c; 893 return (S); 894 } 895 } 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 = xz,yw; 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 = xz,yw; 957 serreMultiplicity(I,J); 958 }
Note: See TracChangeset
for help on using the changeset viewer.