Changeset 009e6b in git
 Timestamp:
 Jan 4, 2007, 4:13:47 PM (17 years ago)
 Branches:
 (u'fiekerDuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b21a664aa22dc6e196223af8a74ad4885e83547c')
 Children:
 90969d3632cf681bdbda289bfeb63bd2442d9da6
 Parents:
 ca40ffb8fb73c8c7be000b3b6fdfe7b3e24ae824
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/sheafcoh.lib
rca40ffb r009e6b 1 1 S/////////////////////////////////////////////////////////////////////////////// 2 version="$Id: sheafcoh.lib,v 1.1 1 20070102 23:58:22 motsakExp $";2 version="$Id: sheafcoh.lib,v 1.12 20070104 15:13:47 Singular Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" … … 38 38 return(transpose(B)); 39 39 } 40 41 // returns transposed Jacobian of M 42 static proc tJacobian(module M) 43 { 44 M = transpose(M); 45 46 int N = nvars(basering); 47 int k = ncols(M); 48 int r = nrows(M); 49 50 module Result; 51 Result[N*k] = 0; 52 53 int i, j; 54 int l = 1; 55 56 for( j = 1; j <= N; j++ ) // for all variables 57 { 58 for( i = 1; i <= k; i++ ) // for every v \in transpose(M) 59 { 60 Result[l] = diff(M[i], var(j)); 61 l++; 62 } 63 } 64 65 return(Result); 66 } 67 68 69 /** 70 let M = { w_1, ..., w_k }, k = size(M) == ncols(M), n = nvars(currRing). 71 assuming that nrows(M) <= m*n; 72 computes transpose(M) * transpose( var(1) I_m  ...  var(n) I_m ) :== transpose(module{f_1, ... f_k}), 73 where f_i = \sum_{j=1}^{m} (w_i, v_j) gen(j), (w_i, v_j) is a `scalar` multiplication. 74 that is, if w_i = (a^1_1, ... a^1_m)  (a^2_1, ..., a^2_m)  ...  (a^n_1, ..., a^n_m) then 75 76 (a^1_1, ... a^1_m)  (a^2_1, ..., a^2_m)  ...  (a^n_1, ..., a^n_m) 77 * var_1 ... var_1  var_2 ... var_2  ...  var_n ... var(n) 78 * gen_1 ... gen_m  gen_1 ... gen_m  ...  gen_1 ... gen_m 79 + => 80 f_i = 81 82 a^1_1 * var(1) * gen(1) + ... + a^1_m * var(1) * gen(m) + 83 a^2_1 * var(2) * gen(1) + ... + a^2_m * var(2) * gen(m) + 84 ... 85 a^n_1 * var(n) * gen(1) + ... + a^n_m * var(n) * gen(m); 86 87 NOTE: for every f_i we run only ONCE along w_i saving partial sums into a temporary array of polys of size m 88 89 */ 90 static proc TensorModuleMult(int m, module M) 91 { 92 int n = nvars(basering); 93 int k = ncols(M); 94 95 int g, cc, vv; 96 97 poly h; 98 99 module Temp; // = {f_1, ..., f_k } 100 101 intvec exp; 102 vector pTempSum, w; 103 104 for( int i = k; i > 0; i ) // for every w \in M 105 { 106 pTempSum[m] = 0; 107 w = M[i]; 108 109 while(w != 0) // for each term of w... 110 { 111 exp = leadexp(w); 112 g = exp[n+1]; // module component! 113 h = w[g]; 114 115 w = w  h * gen(g); 116 117 cc = g % m; 118 119 if( cc == 0) 120 { 121 cc = m; 122 } 123 124 vv = 1 + (g  cc) / m; 125 126 pTempSum = pTempSum + h * var(vv) * gen(cc); 127 } 128 129 Temp[i] = pTempSum; 130 } 131 132 Temp = transpose(Temp); 133 134 return(Temp); 135 } 136 137 138 /////////////////////////////////////////////////////////////////////////////// 139 proc max(int i,int j) 40 /////////////////////////////////////////////////////////////////////////////// 41 static proc max(int i,int j) 140 42 { 141 43 if(i>j){return(i);} … … 324 226 325 227 /////////////////////////////////////////////////////////////////////////////// 326 proc sheafCohBGG1(module M,int l,int h) 327 "USAGE: sheafCohBGG1(M,l,h); M module, l,h int 328 ASSUME: @code{M} is graded, and it comes assigned with an admissible degree 329 vector as an attribute, @code{h>=l}, and the basering has @code{n+1} 330 variables. 331 RETURN: intmat, cohomology of twists of the coherent sheaf F on P^n 332 associated to coker(M). The range of twists is determined by @code{l}, 333 @code{h}. 334 DISPLAY: The intmat is displayed in a diagram of the following form: @* 335 @format 336 l l+1 h 337  338 n: h^n(F(l)) h^n(F(l+1)) ...... h^n(F(h)) 339 ............................................... 340 1: h^1(F(l)) h^1(F(l+1)) ...... h^1(F(h)) 341 0: h^0(F(l)) h^0(F(l+1)) ...... h^0(F(h)) 342  343 chi: chi(F(l)) chi(F(l+1)) ...... chi(F(h)) 344 @end format 345 A @code{''} in the diagram refers to a zero entry; a @code{'*'} 346 refers to a negative entry (= dimension not yet determined). 347 refers to a not computed dimension. @* 348 NOTE: This procedure is based on the BernsteinGel'fandGel'fand 349 correspondence and on Tate resolution ( see [Eisenbud, Floystad, 350 Schreyer: Sheaf cohomology and free resolutions over exterior 351 algebras, Trans AMS 355 (2003)] ).@* 352 @code{sheafCohBGG1(M,l,h)} does not compute all values in the above 353 table. To determine all values of @code{h^i(F(d))}, @code{d=l..h}, 354 use @code{sheafCohBGG1(M,ln,h+n)}. 355 Previous inefficient implementation. 356 SEE ALSO: sheafCoh, sheafCohBGG, dimH 357 EXAMPLE: example sheafCohBGG; shows an example 358 " 359 { 360 int i,j,k,row,col; 361 if( typeof(attrib(M,"isHomog"))!="intvec" ) { 362 if (size(M)==0) { attrib(M,"isHomog",0); } 363 else { ERROR("No admissible degree vector assigned"); } 364 } 365 int n=nvars(basering)1; 366 int ell=l+n; 367 def R=basering; 368 int reg = CM_regularity(M); 369 int bound=max(reg+1,h1); 370 module MT=truncate(M,bound); 371 int m=nrows(MT); 372 MT=transpose(jacobM(MT)); 373 MT=syz(MT); 374 matrix ML[n+1][1]=maxideal(1); 375 matrix S=transpose(outer(ML,unitmat(m))); 376 matrix SS=transpose(S*MT); 377 // to the exterior algebra 378 def AR = Exterior(); 379 setring AR; 380 option(redSB); 381 option(redTail); 382 module EM=imap(R,SS); 383 intvec w; 384 // here we are with our matrix 385 int bound1=max(1,boundell+1); 386 for (i=1; i<=nrows(EM); i++) 387 { 388 w[i]=bound1; 389 } 390 attrib(EM,"isHomog",w); 391 resolution RE=mres(EM,bound1); 392 intmat Betti=betti(RE); 393 k=ncols(Betti); 394 row=nrows(Betti); 395 int shift=attrib(Betti,"rowShift")+(k+ell1); 396 intmat newBetti[n+1][hl+1]; 397 for (j=1; j<=row; j++) { 398 for (i=l; i<=h; i++) { 399 if ((k+1ji+ellshift>0) and (j+iell+shift>=1)) { 400 newBetti[n+2shiftj,il+1]=Betti[j,k+1ji+ellshift]; 401 } 402 else { newBetti[n+2shiftj,il+1]=1; } 403 } 404 } 405 for (j=2; j<=n+1; j++) { 406 for (i=1; i<j; i++) { 407 newBetti[j,i]=1; 408 } 409 } 410 int d=kh+ell1; 411 for (j=1; j<=n; j++) { 412 for (i=hl+1; i>=k+j; i) { 413 newBetti[j,i]=1; 414 } 415 } 416 displayCohom(newBetti,l,h,n); 417 setring R; 418 return(newBetti); 419 option(noredSB); 420 option(noredTail); 421 } 422 example 423 {"EXAMPLE:"; 424 echo = 2; 425 // cohomology of structure sheaf on P^4: 426 // 427 ring r=0,x(1..5),dp; 428 module M=0; 429 def A=sheafCohBGG1(0,9,4); 430 // cohomology of cotangential bundle on P^3: 431 // 432 ring R=0,(x,y,z,u),dp; 433 resolution T1=mres(maxideal(1),0); 434 module M=T1[3]; 435 intvec v=2,2,2,2,2,2; 436 attrib(M,"isHomog",v); 437 def B=sheafCohBGG1(M,8,4); 438 } 439 440 /////////////////////////////////////////////////////////////////////////////// 228 441 229 proc sheafCohBGG(module M,int l,int h) 442 230 "USAGE: sheafCohBGG(M,l,h); M module, l,h int … … 468 256 table. To determine all values of @code{h^i(F(d))}, @code{d=l..h}, 469 257 use @code{sheafCohBGG(M,ln,h+n)}. 470 Optimized version.471 258 SEE ALSO: sheafCoh, dimH 472 259 EXAMPLE: example sheafCohBGG; shows an example … … 478 265 else { ERROR("No admissible degree vector assigned"); } 479 266 } 480 intvec ivOptionsSave = option(get);481 option(redSB); option(redTail);482 483 267 int n=nvars(basering)1; 484 268 int ell=l+n; … … 488 272 module MT=truncate(M,bound); 489 273 int m=nrows(MT); 490 MT = tJacobian(MT); //transpose(jacobM(MT));274 MT=transpose(jacobM(MT)); 491 275 MT=syz(MT); 492 493 m odule SS = TensorModuleMult(m, MT);494 276 matrix ML[n+1][1]=maxideal(1); 277 matrix S=transpose(outer(ML,unitmat(m))); 278 matrix SS=transpose(S*MT); 495 279 // to the exterior algebra 496 def AR = Exterior(); setring AR; 497 280 def AR = Exterior(); 281 setring AR; 282 option(redSB); 283 option(redTail); 498 284 module EM=imap(R,SS); 499 285 intvec w; … … 505 291 } 506 292 attrib(EM,"isHomog",w); 507 resolution RE = minres(nres(EM,bound1));293 resolution RE=mres(EM,bound1); 508 294 intmat Betti=betti(RE); 509 295 k=ncols(Betti); … … 531 317 } 532 318 displayCohom(newBetti,l,h,n); 533 534 319 setring R; 535 option(set, ivOptionsSave);536 537 320 return(newBetti); 321 option(noredSB); 322 option(noredTail); 538 323 } 539 324 example … … 554 339 def B=sheafCohBGG(M,8,4); 555 340 } 556 557 341 558 342 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.