# Spectral sequences and hypercohomology calculations

If F is a coherent sheaf on a smooth toric variety X then multigraded commutative algebra can be used to compute the cohomology groups Hi(X, F).

Indeed if B is the irrelevant ideal of X then the cohomology group Hi(X, F) can be relized as the degree zero piece of the multigraded module Exti(B[l], F) for sufficiently large l; here B[l] denotes the lth Forbenius power of B and F is any multigraded module whose corresponding sheaf on X is F.

Given the fan of X and F a sufficiently large power of l can be determined effectively. We refer to sections 2 and 3 of the paper "Cohomology on Toric Varieties and Local Cohomology with Monomial Supports" for more details.

In this example, we consider the case that X = ℙ1 ×ℙ1 and F = OC(1,0) where C is a general divisor of type (3,3) on X. In this setting, H0(C,F) and H1(C, F) are both 2-dimensional vector spaces.

We first make the multi-graded coordinate ring of 1 ×ℙ1, the irrelevant ideal, and a sufficentily high Frobenus power of the irrelevant ideal needed for our calculations. Also the complex G below is a resolution of the irrelevant ideal.

 `i1 : R = ZZ/101[a_0..b_1, Degrees=>{2:{1,0},2:{0,1}}]; -- PP^1 x PP^1` ```i2 : B = intersect(ideal(a_0,a_1),ideal(b_0,b_1)) ; -- irrelevant ideal o2 : Ideal of R``` ```i3 : B = B_*/(x -> x^5)//ideal ; -- Sufficentily high Frobenius power o3 : Ideal of R``` `i4 : G = res image gens B ;`

We next make the ideal, denoted by I below, of a general divisor of type (3,3) on 1 ×ℙ1. Also the chain complex F below is a resolution of this ideal.

 ```i5 : I = ideal random(R^1, R^{{-3,-3}}) ; -- ideal of C o5 : Ideal of R``` ```i6 : F = res comodule I 1 1 o6 = R <-- R <-- 0 0 1 2 o6 : ChainComplex```

To use hypercohomology to compute the cohomology groups of the line bundle OC(1,0) on C we twist the complex F above by a line of rulting and then make a filtered complex whose associated spectral sequence abuts to the desired cohomology groups.

 `i7 : K = Hom(G , filteredComplex (F ** R^{{1,0}})) ; -- Twist F by a line of ruling and make filtered complex whose ss abuts to HH OO_C(1,0)` `i8 : E = prune spectralSequence K ; --the spectral sequence degenerates on the second page` ```i9 : E^1 +-----------------------------------------------+---------------------------------------------+ | 1 | 1 | o9 = |R |R | | | | |{0, 0} |{1, 0} | +-----------------------------------------------+---------------------------------------------+ |cokernel {-11, 0} | a_1^5 a_0^5 0 0 | |cokernel {-8, 3} | a_1^5 a_0^5 0 0 | | | {-1, -10} | 0 0 b_1^5 b_0^5 | | {2, -7} | 0 0 b_1^5 b_0^5 | | | | | |{0, -1} |{1, -1} | +-----------------------------------------------+---------------------------------------------+ |cokernel {-11, -10} | b_1^5 b_0^5 a_1^5 a_0^5 ||cokernel {-8, -7} | b_1^5 b_0^5 a_1^5 a_0^5 || | | | |{0, -2} |{1, -2} | +-----------------------------------------------+---------------------------------------------+ o9 : SpectralSequencePage``` `i10 : E^2 ; -- output is a mess`

The cohomology groups we want are obtained as follows.

 ```i11 : basis({0,0}, E^2_{0,0}) -- == HH^0 OO_C(1,0) o11 = {-1, 0} | a_0 a_1 | o11 : Matrix``` ```i12 : basis({0,0}, E^2_{1,-2}) -- == HH^1 OO_C(1,0) o12 = {-8, -1} | 0 0 | {-8, -1} | 0 0 | {-8, -1} | 0 0 | {-7, -2} | 0 0 | {-7, -2} | 0 0 | {-7, -2} | 0 0 | {-6, -3} | 0 0 | {-6, -3} | 0 0 | {-6, -3} | 0 0 | {-6, -3} | 0 0 | {-5, -4} | 0 0 | {-5, -4} | 0 0 | {-5, -4} | 0 0 | {-4, -5} | 0 0 | {-4, -5} | 0 0 | {-6, -3} | 0 0 | {-6, -3} | 0 0 | {-6, -3} | 0 0 | {-5, -4} | 0 0 | {-5, -4} | 0 0 | {-5, -4} | 0 0 | {-5, -4} | 0 0 | {-4, -5} | 0 0 | {-4, -5} | 0 0 | {-4, -5} | 0 0 | {-4, -5} | 0 0 | {-4, -5} | 0 0 | {-3, -6} | 0 0 | {-3, -6} | 0 0 | {-3, -6} | 0 0 | {-2, -7} | 0 0 | {-2, -7} | 0 0 | {-2, -7} | a_1^2b_0^4b_1^3 a_1^2b_0^3b_1^4 | o12 : Matrix```