diff --git a/experimental/InjectiveResolutions/src/InjectiveResolutions.jl b/experimental/InjectiveResolutions/src/InjectiveResolutions.jl index 8701b3d7f608..ab2c0e43f16c 100644 --- a/experimental/InjectiveResolutions/src/InjectiveResolutions.jl +++ b/experimental/InjectiveResolutions/src/InjectiveResolutions.jl @@ -713,9 +713,9 @@ function _get_irreducible_ideal(kQ::MonoidAlgebra, J::IndecInj) end @doc raw""" - irreducible_resolution(M::SubquoModule{<:MonoidAlgebraElem}, i::Int = 0) + irreducible_resolution(M::SubquoModule{<:MonoidAlgebraElem}, i::Int = -1) -Return an irreducible resolution of $M$. +Return an irreducible resolution of $M$ (up to cohomological degree i). !!! note The monoid algebra $k[Q]$ must be normal. @@ -759,7 +759,7 @@ by graded submodule of kQ^1 with 3 generators over monoid algebra over rational field with cone of dimension 2 ``` """ -function irreducible_resolution(M::SubquoModule{<:MonoidAlgebraElem}, i::Int=0) +function irreducible_resolution(M::SubquoModule{<:MonoidAlgebraElem}, i::Int=-1) kQ = base_ring(M) @req is_normal(kQ) "monoid algebra must be normal" @@ -812,7 +812,7 @@ function irreducible_resolution(M::SubquoModule{<:MonoidAlgebraElem}, i::Int=0) push!(cochain_maps, hi) # end at cohomological degree i - if i > 0 && j == i + if j == i + 1 break end j = j + 1 @@ -955,7 +955,7 @@ function injective_resolution(M::SubquoModule{<:MonoidAlgebraElem}, i::Int) #compute irreducible resolution of shifted module a_shift = compute_shift(M, i+1) M_a = twist(M, -G(a_shift)) - irr_res = irreducible_resolution(M_a) + irr_res = irreducible_resolution(M_a,i) #get injective modules up to cohomological degree i, i.e. J^0, J^1, ...,J^i inj_modules = Vector{InjMod}() @@ -968,7 +968,7 @@ function injective_resolution(M::SubquoModule{<:MonoidAlgebraElem}, i::Int) #get all needed maps (as k-matrix or k[Q]-matrix?) cochain_maps = [ - matrix(irr_res.cochain_maps[k]) for k in eachindex(irr_res.cochain_maps) if 1 < k <= i+1 + matrix(irr_res.cochain_maps[k]) for k in eachindex(irr_res.cochain_maps) if 1 <= k <= i+1 ] return InjRes(M, inj_modules, cochain_maps, length(inj_modules)-1, irr_res, a_shift) end @@ -1065,4 +1065,3 @@ export zeroth_local_cohomology export MonoidAlgebra export MonoidAlgebraIdeal export MonoidAlgebraElem - diff --git a/experimental/InjectiveResolutions/src/LocalCohomology.jl b/experimental/InjectiveResolutions/src/LocalCohomology.jl index 630d9377f3f7..5a9c5f9519ad 100644 --- a/experimental/InjectiveResolutions/src/LocalCohomology.jl +++ b/experimental/InjectiveResolutions/src/LocalCohomology.jl @@ -146,7 +146,7 @@ function local_cohomology(M::SubquoModule{T}, I::MonoidAlgebraIdeal, i::Integer) #get the injective modules J^{i-1} -> J^i -> J^{i+1} Ji_ = inj_res.inj_mods[i] - Ji = inj_res.inj_mods[i + 1] + Ji = inj_res.inj_mods[i+1] if inj_res.upto > i # J^{i+1} ≠ 0 Ji_1 = inj_res.inj_mods[i + 2] @@ -155,10 +155,10 @@ function local_cohomology(M::SubquoModule{T}, I::MonoidAlgebraIdeal, i::Integer) end #get maps _phi: J^{i-1} -> J^i and _psi: J^i -> J^{i+1} - _phi = get_scalar_matrix(kQ, inj_res.cochain_maps[i]) + _phi = get_scalar_matrix(kQ, inj_res.cochain_maps[i+1]) if inj_res.upto > i - _psi = get_scalar_matrix(kQ, inj_res.cochain_maps[i + 1]) + _psi = get_scalar_matrix(kQ, inj_res.cochain_maps[i + 2]) else # map is zero _psi = zero_matrix(k,length(Ji.indec_injectives), 1) end @@ -419,7 +419,7 @@ function sector_partition( poly_tuple = intersect(_delta...) if dim(poly_tuple) < 0 continue - elseif dim(poly_tuple) == 0 && length(lattice_points(poly_tuple)) == 0 + elseif dim(poly_tuple) == 0 && is_bounded(poly_tuple) && length(lattice_points(poly_tuple)) == 0 continue end @@ -460,9 +460,9 @@ function _local_cohomology_sector( _A = [A_0, A_1, A_2] # define vector spaces J_{S_A0}, J_{S_A1} and J_{S_A2} - F_0 = free_module(field, length(A_0)) - F_1 = free_module(field, length(A_1)) - F_2 = free_module(field, length(A_2)) + F_0 = vector_space(field, length(A_0)) + F_1 = vector_space(field, length(A_1)) + F_2 = vector_space(field, length(A_2)) #compute the maps by deleting rows and columns in phi and psi #phi diff --git a/experimental/InjectiveResolutions/test/local_cohomology_hartshorne_example.jl b/experimental/InjectiveResolutions/test/local_cohomology_hartshorne_example.jl index 03ed8d8a13ce..0119e39d5ea0 100644 --- a/experimental/InjectiveResolutions/test/local_cohomology_hartshorne_example.jl +++ b/experimental/InjectiveResolutions/test/local_cohomology_hartshorne_example.jl @@ -16,13 +16,13 @@ # cohomological degree 1 H1 = Oscar.local_cohomology(I_M, I, 1) - H1_sectors = [h for h in H1.sectors if dim(h.H)>0] #sectors with non-zero local cohomomology + H1_sectors = [h for h in H1.sectors if !is_zero(h)] #sectors with non-zero local cohomomology @test !Oscar.is_zero(H1) @test length(H1_sectors) == 1 # cohomological degree 2 H2 = Oscar.local_cohomology(I_M, I, 2) - H2_sectors = [h for h in H2.sectors if dim(h.H)>0] #sectors with non-zero local cohomology + H2_sectors = [h for h in H2.sectors if !is_zero(h)] #sectors with non-zero local cohomology @test !Oscar.is_zero(H2) @test length(H2_sectors) == 1