The modules M and N should be graded (homogeneous) modules over the same ring.
If M and/or N are ideals or rings, they are regarded as modules in the evident way.
Computes the components in degree ≤d of Exti(M,N). The method computes the homogeneous component up to the chosen degree d of the i-th homology of the complex Hom(Fi-1,N) →Hom(Fi,N) →Hom(Fi+1,N), obtained by applying Hom(.,N) to the resolution F• of M: 0←M ←F0 ←...←Fi ←Fi+1.
Example 1: we compute the dimension of the space of first order deformations of a line bundle L of degree 4 over a smooth curve of genus 5 in ℙ4, comparing our function to the global Ext module computation ExtiX(M,N) for coherent sheaves M and N.
i1 : R=ZZ/10007[y_0..y_4]; |
i2 : I=ideal(y_0*y_3-y_1*y_2,sum apply(5,i->y_i^2),sum apply(5,i->(-1)^i*i*y_i^2)); o2 : Ideal of R |
i3 : genus I, codim I, codim(minors(codim I,jacobian I)+I)==5 o3 = (5, 3, true) o3 : Sequence |
i4 : RC=R/I; PC=Proj RC; |
i6 : L=coker(matrix{{y_0,y_1},{y_2,y_3}});
|
i7 : time Ext^1(sheaf L, sheaf L)
-- used 0.268593 seconds
ZZ 5
o7 = (-----)
10007
ZZ
o7 : ------module, free
10007
|
i8 : time (LonR=coker(sub(presentation L, R))**R^{1}/I;
betti res(truncate(1,LonR), LengthLimit=>2)) --see below for an explanation
-- used 0.00242612 seconds
0 1 2
o8 = total: 16 56 72
1: 16 56 72
o8 : BettiTally
|
i9 : time rank source basis(0,ExtDegreeLimit(1,truncate(1,L),L,0))
-- used 0.0744804 seconds
o9 = 5
|
We remark that our computation is faster. We needed to truncate L such that the first 2 steps of its R-resolution are linear; the reason may be found in: Smith, G., Computing global extension modules, J. Symbolic Comp (2000) 29, 729-746.
Example 2: we compute Hom(I,S/I)0 and Ext1(I,S/I)0 for a rational quartic curve in ℙ3.
i10 : S = QQ[a..d]; |
i11 : I = monomialCurveIdeal(S,{1,3,4})
3 2 2 2 3 2
o11 = ideal (b*c - a*d, c - b*d , a*c - b d, b - a c)
o11 : Ideal of S
|
i12 : R = S/I o12 = R o12 : QuotientRing |
i13 : X = Proj R o13 = X o13 : ProjectiveVariety |
i14 : IX = sheaf (module I ** R)
o14 = cokernel {2} | c2 bd ac b2 |
{3} | -b -a 0 0 |
{3} | d c -b -a |
{3} | 0 0 -d -c |
1 3
o14 : coherent sheaf on X, quotient of OO (-2) ++ OO (-3)
X X
|
i15 : time Ext^1(IX,OO_X)
-- used 0.0118447 seconds
o15 = 0
o15 : QQ-module
|
i16 : time (RonS=coker(presentation R);
betti res(truncate(2,RonS), LengthLimit=>2)) --see above for an explanation
-- used 0.00136758 seconds
0 1 2
o16 = total: 9 23 19
2: 9 23 19
o16 : BettiTally
|
i17 : time rank source basis(0,ExtDegreeLimit(1,truncate(2,(module I)**R),R,0))
-- used 0.00857034 seconds
o17 = 0
|
i18 : time Hom(IX,OO_X)
-- used 0.0556342 seconds
16
o18 = QQ
o18 : QQ-module, free
|
i19 : time rank source basis(0,ExtDegreeLimit(0,truncate(2,(module I)**R),R,0,printTimings=>true))
-- Computing resolution of M
-- used 0.00102219 seconds
-- Allocating memory
-- used 0.00320991 seconds
-- Calculating syz of
0 1
total: 4 4
-4: 4 3
-3: . 1
-- used 0.00058046 seconds
-- used 0.0102455 seconds
o19 = 16
|
The Hom computation is faster with our method.
Example 3: Serre-duality.
i20 : k = ZZ/32003; S = k[v,w,x,y,z]; |
i22 : I = ideal(w*x+y*z,w*y+x*z); o22 : Ideal of S |
i23 : R = S/I; |
i24 : G = coker genericSymmetricMatrix(R,v,2)
o24 = cokernel | v w |
| w x |
2
o24 : R-module, quotient of R
|
i25 : omega = R^{ -1};
|
i26 : time HH^0(sheaf G), time HH^1(sheaf G), time HH^2(sheaf G)
-- used 0.0177116 seconds
-- used 0.00308205 seconds
-- used 0.0046196 seconds
2 2
o26 = (k , k , 0)
o26 : Sequence
|
i27 : time (OmegaOnS=coker(presentation R);
betti res(truncate(2,OmegaOnS), LengthLimit=>2))
-- used 0.00121121 seconds
0 1 2
o27 = total: 13 40 46
2: 13 40 46
o27 : BettiTally
|
i28 : (time rank source basis(0,ExtDegreeLimit(2,truncate(2,G),omega,0)),
time rank source basis(0,ExtDegreeLimit(1,truncate(2,G),omega,0)),
time rank source basis(0,ExtDegreeLimit(0,truncate(2,G),omega,0)))
-- used 0.54874 seconds
-- used 0.0794507 seconds
-- used 0.0117981 seconds
o28 = (2, 2, 0)
o28 : Sequence
|
i29 : (time rank source basis(0,Ext^2(truncate(2,G),omega)),
time rank source basis(0,Ext^1(truncate(2,G),omega)),
time rank source basis(0,Ext^0(truncate(2,G),omega)))
-- used 0.031472 seconds
-- used 0.0164986 seconds
-- used 0.00214615 seconds
o29 = (2, 2, 0)
o29 : Sequence
|
Example 4: Comparing timings.
i30 : k = ZZ/32003; S = k[w,x,y,z]; |
i32 : I = monomialCurveIdeal(S,{1,2,3})
2 2
o32 = ideal (y - x*z, x*y - w*z, x - w*y)
o32 : Ideal of S
|
i33 : Q = S/I; |
i34 : M = coker vars S**Q
o34 = cokernel | w x y z |
1
o34 : Q-module, quotient of Q
|
i35 : time betti res M
-- used 0.00206875 seconds
0 1 2 3 4 5
o35 = total: 1 4 9 18 36 72
0: 1 4 9 18 36 72
o35 : BettiTally
|
i36 : apply(0..8,i->time rank source basis(-i,ExtDegreeLimit(i,M,M,-i)))
-- used 0.00395442 seconds
-- used 0.00540809 seconds
-- used 0.00736771 seconds
-- used 0.011827 seconds
-- used 0.023842 seconds
-- used 0.0613497 seconds
-- used 0.224447 seconds
-- used 0.601766 seconds
-- used 2.15206 seconds
o36 = (1, 4, 9, 18, 36, 72, 144, 288, 576)
o36 : Sequence
|
i37 : apply(0..8,i->time rank source basis(-i,Ext^i(M,M)))
-- used 0.00296287 seconds
-- used 0.011585 seconds
-- used 0.00860211 seconds
-- used 0.0132349 seconds
-- used 0.0284217 seconds
-- used 0.0967308 seconds
-- used 0.223134 seconds
-- used 0.843614 seconds
-- used 3.96964 seconds
o37 = (1, 4, 9, 18, 36, 72, 144, 288, 576)
o37 : Sequence
|