Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sheaf cohomology improvements #3238

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8f128cd
Some small fix for Wolfram.
HechtiDerLachs Jan 24, 2024
a9bc8b7
Another small fix for Wolfram.
HechtiDerLachs Jan 24, 2024
10f6da5
Fix the fix.
HechtiDerLachs Jan 24, 2024
816e940
Address #2999 a bit.
HechtiDerLachs Jan 24, 2024
b4d246b
Fix tests.
HechtiDerLachs Jan 24, 2024
bb0efe5
Fix docstring.
HechtiDerLachs Jan 24, 2024
39ea71c
Add internal method for fast determination of the degree.
HechtiDerLachs Jan 24, 2024
2b71b7a
Avoid creating some matrices.
HechtiDerLachs Jan 24, 2024
5a8594f
Make the graded modules use the new internal method.
HechtiDerLachs Jan 24, 2024
516f829
Add missing internal method.
HechtiDerLachs Jan 24, 2024
abb3dbc
Repair docs.
HechtiDerLachs Jan 24, 2024
227c131
Fix tests.
HechtiDerLachs Jan 24, 2024
d67888b
Use sparse matrices.
HechtiDerLachs Jan 24, 2024
489ee3e
Fix tests.
HechtiDerLachs Jan 25, 2024
47a0459
Revert "Fix tests."
HechtiDerLachs Jan 25, 2024
7a627b0
Revert "Revert "Fix tests.""
HechtiDerLachs Jan 25, 2024
83bffbd
Revert "Use sparse matrices."
HechtiDerLachs Jan 25, 2024
d4c1bae
Another fix.
HechtiDerLachs Jan 25, 2024
ba457b0
Add some missing methods.
HechtiDerLachs Jan 25, 2024
f2ca5c2
Fix degree function for SubquoModuleElems.
HechtiDerLachs Jan 25, 2024
dafe342
Fix degree function for SubquoModuleElems over generic rings.
HechtiDerLachs Jan 25, 2024
616b885
Fix signature.
HechtiDerLachs Jan 25, 2024
11bfd3e
Restrict signature.
HechtiDerLachs Jan 25, 2024
ba0e12e
Repair simplify to avoid infinite loops.
HechtiDerLachs Jan 25, 2024
d33020d
Add some extra assertions.
HechtiDerLachs Jan 25, 2024
817558d
Temporarily disable some failing tests.
HechtiDerLachs Jan 25, 2024
cdeaf0e
WIP on debugging.
HechtiDerLachs Jan 25, 2024
652d9b5
Preliminary closure with messages left where to pick up on the issues
HechtiDerLachs Jan 25, 2024
53ac73d
Overhaul degree.
HechtiDerLachs Jan 31, 2024
2651550
Make current tests run.
HechtiDerLachs Jan 31, 2024
17e9ddb
Fix tests.
HechtiDerLachs Jan 31, 2024
bf5f872
Adjust internal usage of degree.
HechtiDerLachs Feb 1, 2024
6ccaefe
Widen some degree signatures.
HechtiDerLachs Feb 1, 2024
b651fa7
Pass the check flag in the creation of homs.
HechtiDerLachs Feb 1, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ is_homogeneous(f::FreeModElem)
```

```@docs
degree(f::FreeModElem)
degree(f::FreeModElem{T}) where {T<:Union{<:MPolyDecRingElem, <:MPolyQuoRingElem{<:MPolyDecRingElem}}}
```


Expand Down
42 changes: 24 additions & 18 deletions src/Modules/ModuleTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ mutable struct SubQuoHom{
r.header.preimage = x->preimage(r, x)
r.im = Vector{elem_type(C)}(im)
r.generators_map_to_generators = nothing
return set_grading(r)
return set_grading(r; check)
end

function SubQuoHom{T1,T2,RingMapType}(D::SubquoModule, C::SubquoModule, im::Vector;
Expand All @@ -366,7 +366,7 @@ mutable struct SubQuoHom{
r.header.preimage = x->preimage(r, x)
r.im = Vector{elem_type(C)}(im)
r.generators_map_to_generators = nothing
return set_grading(r)
return set_grading(r; check)
end

function SubQuoHom{T1,T2,RingMapType}(D::SubquoModule, C::ModuleFP, im::Vector;
Expand All @@ -382,7 +382,7 @@ mutable struct SubQuoHom{
r.header.preimage = x->preimage(r, x)
r.im = Vector{elem_type(C)}(im)
r.generators_map_to_generators = nothing
return set_grading(r)
return set_grading(r; check)
end

# Constructors for maps with change of base ring
Expand All @@ -404,7 +404,7 @@ mutable struct SubQuoHom{
r.im = Vector{elem_type(C)}(im)
r.ring_map = h
r.generators_map_to_generators = nothing
return set_grading(r)
return set_grading(r; check)
end

function SubQuoHom{T1,T2,RingMapType}(
Expand All @@ -425,7 +425,7 @@ mutable struct SubQuoHom{
r.im = Vector{elem_type(C)}(im)
r.ring_map = h
r.generators_map_to_generators = nothing
return set_grading(r)
return set_grading(r; check)
end

function SubQuoHom{T1,T2,RingMapType}(
Expand All @@ -446,7 +446,7 @@ mutable struct SubQuoHom{
r.im = Vector{elem_type(C)}(im)
r.ring_map = h
r.generators_map_to_generators = nothing
return set_grading(r)
return set_grading(r; check)
end

end
Expand Down Expand Up @@ -539,7 +539,8 @@ When computed, the corresponding matrix (via `matrix()`) and inverse isomorphism
# generate homomorphism of free modules from F to G where the vector a contains the images of
# the generators of F
function FreeModuleHom(
F::AbstractFreeMod, G::S, a::Vector{ModuleElemType}
F::AbstractFreeMod, G::S, a::Vector{ModuleElemType};
check::Bool=true
) where {S<:ModuleFP, ModuleElemType<:ModuleFPElem}
###@assert is_graded(F) == is_graded(G)
@assert all(x->parent(x) === G, a)
Expand Down Expand Up @@ -568,11 +569,12 @@ When computed, the corresponding matrix (via `matrix()`) and inverse isomorphism
r.header = MapHeader{typeof(F), typeof(G)}(F, G, im_func, pr_func)
r.imgs_of_gens = Vector{elem_type(G)}(a)
r.generators_map_to_generators = nothing
return set_grading(r)
return set_grading(r; check)
end

function FreeModuleHom(
F::AbstractFreeMod, G::T2, a::Vector{ModuleElemType}, h::RingMapType
F::AbstractFreeMod, G::T2, a::Vector{ModuleElemType}, h::RingMapType;
check::Bool=true
) where {T2, ModuleElemType<:ModuleFPElem, RingMapType}
###@assert is_graded(F) == is_graded(G)
@assert all(x->parent(x) === G, a)
Expand All @@ -599,50 +601,54 @@ When computed, the corresponding matrix (via `matrix()`) and inverse isomorphism
r.ring_map = h
r.imgs_of_gens = Vector{elem_type(G)}(a)
r.generators_map_to_generators = nothing
return set_grading(r)
return set_grading(r; check)
end

end

# Further constructors taking matrices as input
function FreeModuleHom(
F::AbstractFreeMod{T}, G::S, mat::MatElem{T}
F::AbstractFreeMod{T}, G::S, mat::MatElem{T};
check::Bool=true
) where {T<:RingElem,S<:AbstractFreeMod}
@assert nrows(mat) == ngens(F)
@assert ncols(mat) == ngens(G)
hom = FreeModuleHom(F, G, [FreeModElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)])
hom = FreeModuleHom(F, G, [FreeModElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)]; check)
hom.matrix = mat
return hom
end

function FreeModuleHom(
F::AbstractFreeMod{T}, G::S, mat::MatElem{T}
F::AbstractFreeMod{T}, G::S, mat::MatElem{T};
check::Bool=true
) where {T<:RingElem, S<:ModuleFP}
@assert nrows(mat) == ngens(F)
@assert ncols(mat) == ngens(G)
hom = FreeModuleHom(F, G, [SubquoModuleElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)])
hom = FreeModuleHom(F, G, [SubquoModuleElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)]; check)
hom.matrix = mat
return hom
end

function FreeModuleHom(
F::AbstractFreeMod, G::S, mat::MatElem, h::RingMapType
F::AbstractFreeMod, G::S, mat::MatElem, h::RingMapType;
check::Bool=true
) where {S<:AbstractFreeMod, RingMapType}
@assert nrows(mat) == ngens(F)
@assert ncols(mat) == ngens(G)
@assert base_ring(mat) === base_ring(G)
hom = FreeModuleHom(F, G, [FreeModElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)], h)
hom = FreeModuleHom(F, G, [FreeModElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)], h; check)
hom.matrix = mat
return hom
end

function FreeModuleHom(
F::AbstractFreeMod, G::S, mat::MatElem, h::RingMapType
F::AbstractFreeMod, G::S, mat::MatElem, h::RingMapType;
check::Bool=true
) where {S<:ModuleFP, RingMapType}
@assert nrows(mat) == ngens(F)
@assert ncols(mat) == ngens(G)
@assert base_ring(mat) === base_ring(G)
hom = FreeModuleHom(F, G, [SubquoModuleElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)], h)
hom = FreeModuleHom(F, G, [SubquoModuleElem(sparse_row(mat[i,:]), G) for i=1:ngens(F)], h; check)
hom.matrix = mat
return hom
end
Expand Down
Loading