Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions experimental/InjectiveResolutions/src/InjectiveResolutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}()
Expand All @@ -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
Expand Down Expand Up @@ -1065,4 +1065,3 @@ export zeroth_local_cohomology
export MonoidAlgebra
export MonoidAlgebraIdeal
export MonoidAlgebraElem

14 changes: 7 additions & 7 deletions experimental/InjectiveResolutions/src/LocalCohomology.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading