Changeset cc5e38 in git
- Timestamp:
- May 19, 2005, 10:14:51 AM (19 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- 8f4b234e137fff311254fc393c2db21a430013ca
- Parents:
- 4caa6c6e0405901a99cfb2dad38944688dee60dc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/sheafcoh.lib
r4caa6c rcc5e38 1 ///////////////////////////////////////////////////////////////////////////////2 version="$Id: sheafcoh.lib,v 1. 3 2005-05-18 15:59:37Singular Exp $";1 S/////////////////////////////////////////////////////////////////////////////// 2 version="$Id: sheafcoh.lib,v 1.4 2005-05-19 08:14:51 Singular Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" … … 12 12 CM_regularity(M); Castelnuovo-Mumford regularity of coker(M) 13 13 sheafCohBGG(M,l,h); cohomology of sheaf associated to coker(M) 14 sheafCohE(M,l,h); cohomology of sheaf associated to coker(M) 14 sheafCoh(M,l,h); cohomology of sheaf associated to coker(M) 15 dimH(i,M,d); compute h^i(F(d)), F sheaf associated to coker(M) 15 16 16 17 AUXILIARY PROCEDURES: … … 49 50 proc truncate(module phi, int d) 50 51 "USAGE: truncate(M,d); M module, d int 51 ASSUME: M comes assigned with an admissible degree vector as an attribute 52 ASSUME: @code{M} is graded and is either 0 or comes assigned with an 53 admissible degree vector as an attribute 52 54 RETURN: module 53 55 NOTE: Output is a presentation matrix for the truncation of coker(M) … … 58 60 { 59 61 if ( typeof(attrib(phi,"isHomog"))=="string" ) { 62 if (size(phi)==0) { attrib(phi,"isHomog",0); } 60 63 ERROR("No admissible degree vector assigned"); 61 64 } … … 115 118 proc dimGradedPart(module phi, int d) 116 119 "USAGE: dimGradedPart(M,d); M module, d int 117 ASSUME: M comes assigned with an admissible degree vector as an attribute 120 ASSUME: @code{M} is graded and is either 0 or comes assigned with an 121 admissible degree vector as an attribute 118 122 RETURN: int 119 123 NOTE: Output is the vector space dimension of the graded part of degree d … … 123 127 " 124 128 { 125 if ( typeof(attrib(phi,"isHomog"))=="string" ) { 126 ERROR("No admissible degree vector assigned"); 129 if ( typeof(attrib(phi,"isHomog"))=="string" ) { 130 if (size(phi)==0) { intvec v=0; } 131 else { ERROR("No admissible degree vector assigned"); } 127 132 } 128 133 else { … … 174 179 proc CM_regularity (module M) 175 180 "USAGE: CM_regularity(M); M module 176 ASSUME: @code{M} comes assigned with an admissible degree vector asan177 a ttribute.181 ASSUME: @code{M} is graded and is either 0 or comes assigned with an 182 admissible degree vector as an attribute 178 183 RETURN: integer, the Castelnuovo-Mumford regularity of coker(M) 179 184 NOTE: procedure calls mres … … 183 188 { 184 189 if ( typeof(attrib(M,"isHomog"))=="string" ) { 190 if (size(M)==0) { attrib(M,"isHomog",0); } 185 191 ERROR("No admissible degree vector assigned"); 186 192 } … … 208 214 proc sheafCohBGG(module M,int l,int h) 209 215 "USAGE: sheafCohBGG(M,l,h); M module, l,h int 210 ASSUME: @code{M} comes assigned with an admissible degree vector as an 211 attribute, @code{h>=l}, and the basering has @code{n+1} variables. 212 RETURN: intmat, cohomology of the associated sheaf F of coker(M) on P^n. 213 DISPLAY: The intmat is displayed in a Betti-like diagram: @* 216 ASSUME: @code{M} is graded and is either 0 or comes assigned with an 217 admissible degree vector as an attribute, @code{h>=l}, and the 218 basering has @code{n+1} variables. 219 RETURN: intmat, cohomology of twists of the coherent sheaf F on P^n 220 associated to coker(M). The range of twists is determined by @code{l}, 221 @code{h}. 222 DISPLAY: The intmat is displayed in a diagram of the following form: @* 214 223 @format 215 0 1 h-l224 l l+1 h 216 225 ---------------------------------------------------------- 217 -h: h^0(F(h)) h^0(F(h-1)) ...... h^0(F(l))218 -h+1: h^1(F(h-1)) h^1(F(h-2)) ...... h^1(F(l-1))219 .........................................220 -h+n: h^n(F(h-n)) h^n(F(h-n-1)) ...... h^n(F(l-n))226 n: h^n(F(l)) h^n(F(l+1)) ...... h^n(F(h)) 227 ............................................... 228 1: h^1(F(l)) h^1(F(l+1)) ...... h^1(F(h)) 229 0: h^0(F(l)) h^0(F(l+1)) ...... h^0(F(h)) 221 230 ---------------------------------------------------------- 222 total: .................................231 chi: chi(F(l)) chi(F(l+1)) ...... chi(F(h)) 223 232 @end format 224 A @code{'-'} in the diagram refers to a zero entry, a @code{'*'} 225 refers to a negative entry (= dimension not yet determined). 226 NOTE: procedure is based on the Bernstein-Gel'fand-Gel'fand correspondence 227 and on Tate resolution ( see [Eisenbud, Floystad, Schreyer: Sheaf 228 cohomology and free resolutions over exterior algebras, Trans AMS 229 355 (2003)] ). 233 A @code{'-'} in the diagram refers to a zero entry; a @code{'*'} 234 refers to a negative entry (= dimension not yet determined). 235 refers to a not computed dimension. @* 236 NOTE: This procedure is based on the Bernstein-Gel'fand-Gel'fand 237 correspondence and on Tate resolution ( see [Eisenbud, Floystad, 238 Schreyer: Sheaf cohomology and free resolutions over exterior 239 algebras, Trans AMS 355 (2003)] ).@* 240 @code{sheafCohBGG(M,l,h)} does not compute all values in the above 241 table. To determine all values of @code{h^i(F(d))}, @code{d=l..h}, 242 use @code{sheafCohBGG(M,l-n,h+n)}. 243 SEE ALSO: sheafCoh, dimH 230 244 EXAMPLE: example sheafCohBGG; shows an example 231 245 " 232 246 { 233 int i,j,k,row,row1,col; 234 if( typeof(attrib(M,"isHomog"))!="intvec" ) 235 { 236 ERROR("The module has no weights"); 237 } 247 int i,j,k,row,col; 248 if( typeof(attrib(M,"isHomog"))!="intvec" ) { 249 if (size(M)==0) { attrib(M,"isHomog",0); } 250 else { ERROR("No admissible degree vector assigned"); } 251 } 252 int n=nvars(basering)-1; 253 int ell=l+n; 238 254 def R=basering; 239 255 int reg = CM_regularity(M); … … 243 259 MT=transpose(jacobM(MT)); 244 260 MT=syz(MT); 245 int n=nvars(basering); 246 matrix ML[n][1]=maxideal(1); 261 matrix ML[n+1][1]=maxideal(1); 247 262 matrix S=transpose(outer(ML,unitmat(m))); 248 263 matrix SS=transpose(S*MT); … … 255 270 intvec w; 256 271 //--- here we are with our matrix 257 int bound1=max(1,bound- l+1);272 int bound1=max(1,bound-ell+1); 258 273 for (i=1; i<=nrows(EM); i++) 259 274 { … … 264 279 intmat Betti=betti(RE); 265 280 k=ncols(Betti); 266 int d=k-h+l-1;267 if (d>0)268 {269 // select relevant k-d columns from Betti diagram:270 row=nrows(Betti);271 intmat newBetti[row][k-d]=Betti[1..row,d+1..k];272 int shift=attrib(Betti,"rowShift");273 attrib(newBetti,"rowShift",shift+d);274 Betti=newBetti;275 }276 277 row1=attrib(Betti,"rowShift");278 281 row=nrows(Betti); 279 col=ncols(Betti); 280 if ((row<n) or (row1>-h) ) { 281 // insert top and bottom zero lines (diagram is n x (h-l+1)) 282 intmat newBetti1[n][col]; 283 for (i=1; i<=row; i++) { 284 for (j=1; j<=col; j++) { 285 newBetti1[i+row1+h,j]=Betti[i,j]; 286 } 287 } 288 attrib(newBetti1,"rowShift",-h); 289 Betti=newBetti1; 290 } 291 displayCohom(Betti,l,h,n-1); 282 int shift=attrib(Betti,"rowShift")+(k+ell-1); 283 intmat newBetti[n+1][h-l+1]; 284 for (j=1; j<=row; j++) { 285 for (i=l; i<=h; i++) { 286 if ((k+1-j-i+ell-shift>0) and (j+i-ell+shift>=1)) { 287 newBetti[n+2-shift-j,i-l+1]=Betti[j,k+1-j-i+ell-shift]; 288 } 289 else { newBetti[n+2-shift-j,i-l+1]=-1; } 290 } 291 } 292 for (j=2; j<=n+1; j++) { 293 for (i=1; i<j; i++) { 294 newBetti[j,i]=-1; 295 } 296 } 297 int d=k-h+ell-1; 298 for (j=1; j<=n; j++) { 299 for (i=h-l+1; i>=k+j; i--) { 300 newBetti[j,i]=-1; 301 } 302 } 303 displayCohom(newBetti,l,h,n); 292 304 setring R; 293 305 return(Betti); … … 295 307 option(noredTail); 296 308 } 309 example 310 {"EXAMPLE:"; 311 echo = 2; 312 // cohomology of structure sheaf on P^4: 313 //------------------------------------------- 314 ring r=0,x(1..5),dp; 315 module M=0; 316 def A=sheafCohBGG(0,-9,4); 317 // cohomology of cotangential bundle on P^3: 318 //------------------------------------------- 319 ring R=0,(x,y,z,u),dp; 320 resolution T1=mres(maxideal(1),0); 321 module M=T1[3]; 322 intvec v=2,2,2,2,2,2; 323 attrib(M,"isHomog",v); 324 def B=sheafCohBGG(M,-8,4); 325 } 326 327 /////////////////////////////////////////////////////////////////////////////// 328 329 proc dimH(int i,module M,int d) 330 "USAGE: dimH(i,M,d); M module, i,d int 331 ASSUME: @code{M} is graded and is either 0 or comes assigned with an 332 admissible degree vector as an attribute, @code{h>=l}, and the 333 basering @code{S} has @code{n+1} variables. 334 RETURN: int, vector space dimension of @math{H^i(F(d))} for F the coherent 335 sheaf on P^n associated to coker(M). 336 NOTE: The procedure is based on local duality as described in [Eisenbud: 337 Computing cohomology. In Vasconcelos: Computational methods in 338 commutative algebra and algebraic geometry. Springer (1998)]. 339 SEE ALSO: sheafCoh, sheafCohBGG 340 EXAMPLE: example dimH; shows an example 341 " 342 { 343 if( typeof(attrib(M,"isHomog"))!="intvec" ) { 344 if (size(M)==0) { attrib(M,"isHomog",0); } 345 else { ERROR("No admissible degree vector assigned"); } 346 } 347 int Result; 348 int n=nvars(basering)-1; 349 if ((i>0) and (i<=n)) { 350 list L=Ext_R(n-i,M,1)[2]; 351 def N=L[1]; 352 return(dimGradedPart(N,-n-1-d)); 353 } 354 else { 355 if (i==0) { 356 list L=Ext_R(intvec(n+1,n+2),M,1)[2]; 357 def N0=L[2]; 358 def N1=L[1]; 359 Result=dimGradedPart(M,d) - dimGradedPart(N0,-n-1-d) 360 - dimGradedPart(N1,-n-1-d); 361 return(Result); 362 } 363 else { 364 return(0); 365 } 366 } 367 } 297 368 example 298 369 {"EXAMPLE:"; … … 303 374 intvec v=2,2,2,2,2,2; 304 375 attrib(M,"isHomog",v); 305 def B=sheafCohBGG(M,-6,2); 306 } 307 308 /////////////////////////////////////////////////////////////////////////////// 309 310 proc sheafCohE(module M,int l,int h) 311 "USAGE: sheafCohE(M,l,h); M module, l,h int 312 ASSUME: @code{M} comes assigned with an admissible degree vector as an 313 attribute, @code{h>=l}, and the basering @code{S} has @code{n+1} 314 variables. 315 RETURN: intmat, cohomology of the associated sheaf F of coker(M) on P^n. 316 DISPLAY: The intmat is displayed in a Betti-like diagram: @* 376 dimH(0,M,2); 377 dimH(1,M,0); 378 dimH(2,M,1); 379 dimH(3,M,-5); 380 } 381 382 383 /////////////////////////////////////////////////////////////////////////////// 384 385 proc sheafCoh(module M,int l,int h) 386 "USAGE: sheafCoh(M,l,h); M module, l,h int 387 ASSUME: @code{M} is graded and is either 0 or comes assigned with an 388 admissible degree vector as an attribute, @code{h>=l}. The basering 389 @code{S} has @code{n+1} variables. 390 RETURN: intmat, cohomology of twists of the coherent sheaf F on P^n 391 associated to coker(M). The range of twists is determined by @code{l}, 392 @code{h}. 393 DISPLAY: The intmat is displayed in a diagram of the following form: @* 317 394 @format 318 0 1 h-l395 l l+1 h 319 396 ---------------------------------------------------------- 320 -h: h^0(F(h)) h^0(F(h-1)) ...... h^0(F(l))321 -h+1: h^1(F(h-1)) h^1(F(h-2)) ...... h^1(F(l-1))322 .........................................323 -h+n: h^n(F(h-n)) h^n(F(h-n-1)) ...... h^n(F(l-n))397 n: h^n(F(l)) h^n(F(l+1)) ...... h^n(F(h)) 398 ............................................... 399 1: h^1(F(l)) h^1(F(l+1)) ...... h^1(F(h)) 400 0: h^0(F(l)) h^0(F(l+1)) ...... h^0(F(h)) 324 401 ---------------------------------------------------------- 325 total: .................................402 chi: chi(F(l)) chi(F(l+1)) ...... chi(F(h)) 326 403 @end format 327 A @code{'-'} in the diagram refers to a zero entry, a @code{'*'} 328 refers to a negative entry (= dimension not yet determined). 329 NOTE: procedure is based on the local duality as described in [Eisenbud: 404 A @code{'-'} in the diagram refers to a zero entry. 405 NOTE: The procedure is based on local duality as described in [Eisenbud: 330 406 Computing cohomology. In Vasconcelos: Computational methods in 331 commutative algebra and algebraic geometry. Springer (1998)]: 332 @format 333 h^i(F(j)) = dim_K Ext_S^(n-i) (M,S)_(-j-n-1). 334 @end format 335 EXAMPLE: example sheafCohE; shows an example 407 commutative algebra and algebraic geometry. Springer (1998)]. 408 SEE ALSO: dimH, sheafCohBGG 409 EXAMPLE: example sheafCoh; shows an example 336 410 " 337 411 { 412 if( typeof(attrib(M,"isHomog"))!="intvec" ) { 413 if (size(M)==0) { attrib(M,"isHomog",0); } 414 else { ERROR("No admissible degree vector assigned"); } 415 } 338 416 int i,j; 339 module N ;417 module N,N0,N1; 340 418 int n=nvars(basering)-1; 341 intvec v=0..n -1;419 intvec v=0..n+1; 342 420 int col=h-l+1; 343 421 intmat newBetti[n+1][col]; 344 422 list L=Ext_R(v,M,1)[2]; // list of GB for Ext_R 345 for (i=1; i<=col; i++) { 346 newBetti[1,i]=-1; 423 for (i=l; i<=h; i++) { 424 N0=L[n+2]; 425 N1=L[n+1]; 426 newBetti[n+1,i-l+1]=dimGradedPart(M,i) - dimGradedPart(N0,-n-1-i) 427 - dimGradedPart(N0,-n-1-i); 347 428 } 348 429 for (j=1; j<=n; j++) { 349 N=L[ n+1-j];430 N=L[j]; 350 431 attrib(N,"isSB",1); 351 432 if (dim(N)>=0) { 352 for (i= 1; i<=col; i++) {353 newBetti[j +1,i]=dimGradedPart(N,-h-n-2+j+i);433 for (i=l; i<=h; i++) { 434 newBetti[j,i-l+1]=dimGradedPart(N,-n-1-i); 354 435 } 355 436 } … … 361 442 {"EXAMPLE:"; 362 443 echo = 2; 444 // 445 // cohomology of structure sheaf on P^4: 446 //------------------------------------------- 447 ring r=0,x(1..5),dp; 448 module M=0; 449 def A=sheafCoh(0,-7,2); 450 // 451 // cohomology of cotangential bundle on P^3: 452 //------------------------------------------- 363 453 ring R=0,(x,y,z,u),dp; 364 454 resolution T1=mres(maxideal(1),0); … … 366 456 intvec v=2,2,2,2,2,2; 367 457 attrib(M,"isHomog",v); 368 def B=sheafCohE(M,-6,2); 369 } 370 371 /* 372 To compute dim_K Ext_S^(n-j) ( M, S(-n-1) )_i 373 = dim_K Ext_S^(n-j) ( M, S )_i-n-1 374 we just need the following input lines: 375 376 module N = Ext_R(n-j,phi); 377 homog(N); // Hier muss man momentan noch von Hand eingreifen... 378 // (siehe unten) 379 dimGradedPart( N, i-n-1); 380 */ 458 def B=sheafCoh(M,-6,2); 459 } 381 460 382 461 /////////////////////////////////////////////////////////////////////////////// … … 384 463 "USAGE: displayCohom(data,l,h,n); data intmat, l,h,n int 385 464 ASSUME: @code{h>=l}, @code{data} is the return value of 386 @code{sheafCoh E(M,l,h)} or of @code{sheafCohBGG(M,l,h)}, and the465 @code{sheafCoh(M,l,h)} or of @code{sheafCohBGG(M,l,h)}, and the 387 466 basering has @code{n+1} variables. 388 467 RETURN: none 389 NOTE: The intmat is displayed in a Betti-like diagram: @*468 NOTE: The intmat is displayed in a diagram of the following form: @* 390 469 @format 391 0 1 h-l470 l l+1 h 392 471 ---------------------------------------------------------- 393 -h: h^0(F(h)) h^0(F(h-1)) ...... h^0(F(l))394 -h+1: h^1(F(h-1)) h^1(F(h-2)) ...... h^1(F(l-1))395 .........................................396 -h+n: h^n(F(h-n)) h^n(F(h-n-1)) ...... h^n(F(l-n))472 n: h^n(F(l)) h^n(F(l+1)) ...... h^n(F(h)) 473 ............................................... 474 1: h^1(F(l)) h^1(F(l+1)) ...... h^1(F(h)) 475 0: h^0(F(l)) h^0(F(l+1)) ...... h^0(F(h)) 397 476 ---------------------------------------------------------- 398 total: .................................477 chi: chi(F(l)) chi(F(l+1)) ...... chi(F(h)) 399 478 @end format 400 479 where @code{F} refers to the associated sheaf of @code{M} on P^n.@* 401 A @code{'-'} in the diagram refers to a zero entry, a @code{'*'}402 refers to a negative entry (= dimension not yet determined). 480 A @code{'-'} in the diagram refers to a zero entry, a @code{'*'} 481 refers to a negative entry (= dimension not yet determined). 403 482 EXAMPLE: example truncate; shows an example 404 483 " 405 484 { 406 int i,j,k,dat ;485 int i,j,k,dat,maxL; 407 486 intvec notSumCol; 408 487 notSumCol[h-l+1]=0; 409 488 string s; 410 string Row=" "; 411 string Row1="------"; 412 for (i=0; i<=h-l; i++) { 413 if (i<10) { Row=Row+" "+string(i); } 414 else { Row=Row+" "+string(i); } 415 Row1 = Row1+"------"; 489 maxL=4; 490 for (i=1;i<=nrows(data);i++) { 491 for (j=1;j<=ncols(data);j++) { 492 if (size(string(data[i,j]))>=maxL-1) { 493 maxL=size(string(data[i,j]))+2; 494 } 495 } 496 } 497 string Row=" "; 498 string Row1="----"; 499 for (i=l; i<=h; i++) { 500 for (j=1; j<=maxL-size(string(i)); j++) { 501 Row=Row+" "; 502 } 503 Row=Row+string(i); 504 for (j=1; j<=maxL; j++) { Row1 = Row1+"-"; } 416 505 } 417 506 print(Row); 418 507 print(Row1); 419 508 for (j=1; j<=n+1; j++) { 420 s = string( j-h-1);509 s = string(n+1-j); 421 510 Row = ""; 422 for(k=1; k< 6-size(s); k++) { Row = Row+" "; }511 for(k=1; k<4-size(s); k++) { Row = Row+" "; } 423 512 Row = Row + s+":"; 424 513 for (i=0; i<=h-l; i++) { … … 429 518 else { s="*"; notSumCol[i+1]=1; } 430 519 } 431 for(k=1; k<= 6-size(s); k++) { Row = Row+" "; }520 for(k=1; k<=maxL-size(s); k++) { Row = Row+" "; } 432 521 Row = Row + s; 433 522 } … … 435 524 } 436 525 print(Row1); 437 Row=" total:";526 Row="chi:"; 438 527 for (i=0; i<=h-l; i++) { 439 528 dat = 0; 440 529 if (notSumCol[i+1]==0) { 441 for (j= 1; j<=n+1; j++) { dat = dat + data[j,i+1]; }442 if (dat>0) { s = string(dat); }530 for (j=0; j<=n; j++) { dat = dat + (-1)^j * data[n+1-j,i+1]; } 531 s = string(dat); 443 532 } 444 533 else { s="*"; } 445 for (k=1; k<= 6-size(s); k++) { Row = Row+" "; }534 for (k=1; k<=maxL-size(s); k++) { Row = Row+" "; } 446 535 Row = Row + s; 447 536 } … … 476 565 print(betti(FI),"betti"); 477 566 module F=FI[2]; 478 def A1=sheafCoh E(F,-2,6);479 def A2=sheafCohBGG(F,- 2,6);567 def A1=sheafCoh(F,-6,6); 568 def A2=sheafCohBGG(F,-6,6); 480 569 481 570 LIB "sheafcoh.lib"; … … 512 601 513 602 module F=FI[2]; 514 def A1=sheafCoh E(F,0,8);515 def A2=sheafCohBGG(F, 0,8);603 def A1=sheafCoh(F,-5,7); 604 def A2=sheafCohBGG(F,-5,7); 516 605 517 606 */
Note: See TracChangeset
for help on using the changeset viewer.