Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
a305553
Widen _derived_pushforward to accept multi-gradings.
HechtiDerLachs Apr 23, 2025
8c1763d
WIP towards cached pushforwards.
HechtiDerLachs Apr 23, 2025
260be89
WIP on spectral sequences.
HechtiDerLachs Apr 25, 2025
44cd309
Repair homogeneous Koszul complexes.
HechtiDerLachs Apr 29, 2025
63145b4
Introduce induced maps on homogeneous Koszul complexes.
HechtiDerLachs Apr 29, 2025
c03c1c6
Implement contravariant induced hom.
HechtiDerLachs Apr 29, 2025
9b4b3ae
Add tests.
HechtiDerLachs Apr 29, 2025
0c96029
Adjust wip on derived pushforward.
HechtiDerLachs Apr 29, 2025
44ebdb0
Implement induced maps in shifted complexes.
HechtiDerLachs Apr 29, 2025
d9b66dd
Implement induced maps in tensor products.
HechtiDerLachs Apr 29, 2025
82370b2
Implement induced maps in total complexes.
HechtiDerLachs Apr 29, 2025
8f4d65d
Implement induced maps in views of complexes.
HechtiDerLachs Apr 29, 2025
7ba3668
Include the files.
HechtiDerLachs Apr 29, 2025
6bb503a
Compute induced maps in truncated Cech complexes.
HechtiDerLachs Apr 29, 2025
16d01ba
Implement induced maps on strands.
HechtiDerLachs Apr 29, 2025
0748f9b
Include file.
HechtiDerLachs Apr 29, 2025
4fe1ca2
Use inclusion of strands.
HechtiDerLachs Apr 29, 2025
bacba7a
Add functionality for projection to (obvious) direct summands.
HechtiDerLachs Apr 30, 2025
a427166
Use the strand projections.
HechtiDerLachs Apr 30, 2025
488b782
Add some printing.
HechtiDerLachs Apr 30, 2025
2bad0ee
Implement strand projections.
HechtiDerLachs May 2, 2025
e3ec3ec
Entries and maps on the first page.
HechtiDerLachs May 2, 2025
c33f429
Produce entries on second page.
HechtiDerLachs May 2, 2025
e4f2327
Adapt to products of projective spaces.
HechtiDerLachs May 2, 2025
0d487ea
Improve caching.
HechtiDerLachs May 2, 2025
ad89737
WIP on implementation of maps on 2nd page.
HechtiDerLachs May 3, 2025
86bd25b
Repair induced_ENC.
HechtiDerLachs May 6, 2025
ddfd5d2
Introduced lifted_kernel_generators for production of maps.
HechtiDerLachs May 6, 2025
48d0e4a
Easen up lifting.
HechtiDerLachs May 7, 2025
b08d8d5
Switch back to WeakKeyDicts.
HechtiDerLachs May 9, 2025
8aacc8b
First working version of spectral sequences.
HechtiDerLachs May 9, 2025
b0fa335
Add some hacky tuning.
HechtiDerLachs May 12, 2025
61ceed8
Repair computations and remove debug messages.
HechtiDerLachs May 20, 2025
526bdc3
Fix bug in the shifted complexes.
HechtiDerLachs May 21, 2025
0f1cff4
Fix bug in the induced_homs.
HechtiDerLachs May 21, 2025
906a9c6
Update tests.
HechtiDerLachs May 22, 2025
8d9e0bd
Add early return for production of maps.
HechtiDerLachs May 28, 2025
7b7b096
Use in-place operations.
HechtiDerLachs Jun 2, 2025
6d7ef69
Clean up new Koszul complexes.
HechtiDerLachs Jun 3, 2025
ce5425e
Clean up the context object for pushforward.
HechtiDerLachs Jun 3, 2025
1819737
Clean up code for spectral sequences.
HechtiDerLachs Jun 3, 2025
a4eea34
Re-repair Koszul complexes.
HechtiDerLachs Jun 3, 2025
7f2012c
Add tests.
HechtiDerLachs Jun 3, 2025
ddb1300
Repair messed up routine for _derived_pushforward.
HechtiDerLachs Jun 3, 2025
eff58c0
Add a docstring for the spectral sequence.
HechtiDerLachs Jun 3, 2025
5e8ac95
Actually include tests.
HechtiDerLachs Jun 3, 2025
241441b
Fix doctests.
HechtiDerLachs Jun 3, 2025
3b465bd
Remove deprecated code.
HechtiDerLachs Jun 4, 2025
437d0b5
Extend tests.
HechtiDerLachs Jun 4, 2025
ea4d899
Extend check_sanity.
HechtiDerLachs Jun 4, 2025
588a176
Clean up code.
HechtiDerLachs Jun 4, 2025
a68256a
Implement covariant induced morphisms for hypercomplexes.
HechtiDerLachs Jun 20, 2025
c67f310
Add first context object for the toric setting.
HechtiDerLachs Jun 23, 2025
f1f141b
Implement _minimal_exponent_vector naively.
HechtiDerLachs Jun 24, 2025
48cd1d0
Allow use of ToricCtx in SpectralSequences.
HechtiDerLachs Jun 24, 2025
2900ebe
Add tests.
HechtiDerLachs Jun 24, 2025
b0fab12
Repair messed up hom-constructor.
HechtiDerLachs Jun 24, 2025
a5fe4cc
Drop support for sub for views.
HechtiDerLachs Jun 25, 2025
ce74f55
Revert faulty simplification.
HechtiDerLachs Jun 26, 2025
0814636
Fix doctests.
HechtiDerLachs Jun 26, 2025
207c0da
Fix up iterators for ZZm gradings.
HechtiDerLachs Jun 28, 2025
b6cbfcd
Use better command to create matrix from rays.
HechtiDerLachs Jun 28, 2025
2151e72
Regress code to 1.6 compatibility.
HechtiDerLachs Jun 29, 2025
4973f31
Allow for fixed exponent vectors.
HechtiDerLachs Jun 30, 2025
b2519d0
Add some internal checks for SummandProjection.
HechtiDerLachs Jun 30, 2025
071289a
Clean up some code.
HechtiDerLachs Jun 30, 2025
81b966e
Add method for setting exponent vector and algorithm keyword.
HechtiDerLachs Jul 1, 2025
eb99d7b
Forward set_global_exponent_vector to spectral sequence.
HechtiDerLachs Jul 1, 2025
770adeb
Adjust tests.
HechtiDerLachs Jul 1, 2025
a0cc625
Fixed uninitialized field.
HechtiDerLachs Jul 1, 2025
6afd9aa
Code cleanup.
HechtiDerLachs Jul 2, 2025
48897a8
Fix tests.
HechtiDerLachs Jul 2, 2025
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 @@ -29,6 +29,14 @@ include("Morphisms/methods.jl")
include("Objects/Methods.jl")
include("Exports.jl")

include("Morphisms/new_koszul_complexes.jl")
include("Morphisms/induced_homs.jl")
include("Morphisms/tensor_product.jl")
include("Morphisms/shifted_complexes.jl")
include("Morphisms/views.jl")
include("Morphisms/total_complexes.jl")
include("Morphisms/strand_morphisms.jl")
include("Morphisms/SummandProjection.jl")
include("base_change_types.jl")
include("base_change.jl")

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#=
# Say you have an injective morphism of complexes `ι : C* ↪ D*` of `FreeMod`ules where
#
# ιᵏ : Cᵏ ≅ Rᵐ ↪ Rⁿ ≅ Dᵏ
#
# takes the generators of Cᵏ to a subset of the generators of Dᵏ for each k.
# Then Rⁿ ≅ Rᵐ ⊕ Rⁿ⁻ᵐ decomposes as a direct sum. This type of morphism
# computes the corresponding projection `π : D* → C*`.
=#

struct SummandProjectionFactory{MorphismType} <: HyperComplexMorphismFactory{MorphismType}
inc::AbsHyperComplexMorphism
check::Bool

function SummandProjectionFactory(
inc::AbsHyperComplexMorphism{DomainType, CodomainType, MorphismType};
check::Bool=true
) where {DomainType, CodomainType, MorphismType}
return new{MorphismType}(inc, check)
end
end

@attributes mutable struct SummandProjection{DomainType, CodomainType, MorphismType} <: AbsHyperComplexMorphism{DomainType, CodomainType, MorphismType, SummandProjection{DomainType, CodomainType, MorphismType}}
internal_morphism::HyperComplexMorphism{DomainType, CodomainType, MorphismType}

function SummandProjection(
inc::AbsHyperComplexMorphism{DomainType, CodomainType, MorphismType};
check::Bool=true
) where {DomainType, CodomainType, MorphismType}
map_factory = SummandProjectionFactory(inc; check)

internal_morphism = HyperComplexMorphism(
codomain(inc), domain(inc),
map_factory, cached=true,
offset=-offset(inc)
)
return new{CodomainType, DomainType, MorphismType}(internal_morphism)
end
end

function (fac::SummandProjectionFactory)(self::AbsHyperComplexMorphism, i::Tuple)
inc = fac.inc[i]
dom = domain(inc)::FreeMod
cod = codomain(inc)::FreeMod
img_gens = elem_type(dom)[]
img_gens_inc = images_of_generators(inc)
if fac.check
is_injective(inc) || error("given map is not injective")
A = sparse_matrix(inc)
all(is_one(only(v)[2]) || is_one(-only(v)[2]) for v in A) || error("given map is not of the required form")
end
for g in gens(cod)
j = findfirst(==(g), img_gens_inc)
if isnothing(j)
k = findfirst(==(-g), img_gens_inc)
if isnothing(k)
push!(img_gens, zero(dom))
else
push!(img_gens, -dom[k::Int])

Check warning on line 59 in experimental/DoubleAndHyperComplexes/src/Morphisms/SummandProjection.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/SummandProjection.jl#L59

Added line #L59 was not covered by tests
end
else
push!(img_gens, dom[j::Int])
end
end
res = hom(cod, dom, img_gens)
if fac.check && compose(inc, res) != identity_map(dom)
error("given map failed to be of the required format.")

Check warning on line 67 in experimental/DoubleAndHyperComplexes/src/Morphisms/SummandProjection.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/SummandProjection.jl#L67

Added line #L67 was not covered by tests
end
return res
end

function can_compute(fac::SummandProjectionFactory, self::AbsHyperComplexMorphism, i::Tuple)
return can_compute_index(fac.inc, i)
end


underlying_morphism(phi::SummandProjection) = phi.internal_morphism
47 changes: 42 additions & 5 deletions experimental/DoubleAndHyperComplexes/src/Morphisms/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,14 @@ domain(phi::HyperComplexMorphism) = phi.domain
codomain(phi::HyperComplexMorphism) = phi.codomain

function getindex(phi::HyperComplexMorphism{<:Any, <:Any, MorphismType}, i::Tuple) where {MorphismType}
can_compute(phi.fac, phi, i) || error("index out of bounds")
# No caching deflects to production
!isdefined(phi, :map_cache) && return phi.fac(phi, i)::MorphismType

# The case of cached results
haskey(phi.map_cache, i) && return phi.map_cache[i]
can_compute(phi.fac, phi, i) || error("index out of bounds")
result = phi.fac(phi, i)::MorphismType
phi.map_cache[i] = result
return result
return get!(phi.map_cache, i) do
phi.fac(phi, i)
end::MorphismType
end

offset(phi::HyperComplexMorphism) = phi.offset
Expand Down Expand Up @@ -162,3 +161,41 @@ mutable struct MapLifter{MorphismType} <: HyperComplexMorphismFactory{MorphismTy
end
end

# Induced maps for Koszul complexes
struct InducedKoszulMorFactory{MorphismType} <: HyperComplexMorphismFactory{MorphismType}
dom::HomogKoszulComplex
cod::HomogKoszulComplex
A::SMat # the transition matrix between the generators

function InducedKoszulMorFactory(
dom::HomogKoszulComplex,
cod::HomogKoszulComplex,
A::SMat
)
return new{ModuleFPHom}(dom, cod, A)
end
end

@attributes mutable struct InducedKoszulMorphism{DomainType, CodomainType, MorphismType} <: AbsHyperComplexMorphism{DomainType, CodomainType, MorphismType, InducedKoszulMorphism{DomainType, CodomainType, MorphismType}}
internal_morphism::HyperComplexMorphism{DomainType, CodomainType, MorphismType}

function InducedKoszulMorphism(
dom::HomogKoszulComplex,
cod::HomogKoszulComplex;
transition_matrix::SMat=begin
S = ring(dom)
a = sequence(cod)
b = sequence(dom)
a_ideal = ideal(S, a)
c = sparse_matrix(S, 0, length(a))
for f in b
push!(c, coordinates(SRow, f, a_ideal))
end
c
end
)
map_factory = InducedKoszulMorFactory(dom, cod, transition_matrix)
internal_morphism = HyperComplexMorphism(dom, cod, map_factory, cached=true, offset=[0 for i in 1:dim(dom)])
return new{typeof(dom), typeof(cod), ModuleFPHom}(internal_morphism)
end
end
175 changes: 175 additions & 0 deletions experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#=
# Induced complexes on `HomComplex`es.
#
# Say, one has morphisms of hypercomplexes `ϕ : C* → D*` and `ψ : E* → F`.
# Then we would like to be able to get all induced maps in the following
# diagram:
#
# ϕ^*
# Hom(D*, E*) → Hom(C*, E*)
# ψ_* ↓ ↓ ψ_*
# Hom(D*, F*) → Hom(C*, F*)
# ϕ^*
#
# This is achieved by the co- and the contravariant induced homomorphisms.
=#
struct InducedContravariantMorphismFactory{MorphismType} <: HyperComplexMorphismFactory{MorphismType}
phi::AbsHyperComplexMorphism
dom::HomComplex
cod::HomComplex
common_cod::AbsHyperComplex

# Fields needed for production
function InducedContravariantMorphismFactory(
phi::AbsHyperComplexMorphism,
D::AbsHyperComplex,
dom::HomComplex,
cod::HomComplex
)
return new{ModuleFPHom}(phi, dom, cod, D)
end
end

function hom(phi::ModuleFPHom, M::ModuleFP;
domain::ModuleFP=hom(Oscar.codomain(phi), M),
codomain::ModuleFP=hom(Oscar.domain(phi), M)
)
return lift_homomorphism_contravariant(domain, codomain, phi)
end

function (fac::InducedContravariantMorphismFactory)(self::AbsHyperComplexMorphism, i::Tuple)
dom = fac.dom
cod = fac.cod
common_cod = fac.common_cod
n = dim(common_cod)
m = dim(dom) - n
a = i[1:m]
b = i[m+1:m+n]
na = Tuple([-i for i in a])
return hom(fac.phi[na], common_cod[b]; domain=dom[i], codomain=cod[i])
end

function can_compute(fac::InducedContravariantMorphismFactory, self::AbsHyperComplexMorphism, i::Tuple)
# Decide whether the outgoing map from index i can be computed
dom = fac.dom
cod = fac.cod
common_cod = fac.common_cod
n = dim(common_cod)
m = dim(dom) - n
a = i[1:m]
b = i[m+1:m+n]
na = Tuple([-i for i in a])
return can_compute_index(fac.phi, na) && can_compute_index(common_cod, b)
end


@attributes mutable struct InducedContravariantMorphism{DomainType, CodomainType, MorphismType} <: AbsHyperComplexMorphism{DomainType, CodomainType, MorphismType, InducedContravariantMorphism{DomainType, CodomainType, MorphismType}}
internal_morphism::HyperComplexMorphism{DomainType, CodomainType, MorphismType}

function InducedContravariantMorphism(
phi::AbsHyperComplexMorphism,
D::AbsHyperComplex;
domain::HomComplex = hom(Oscar.codomain(phi), D),
codomain::HomComplex = hom(Oscar.domain(phi), D)
)
@assert Oscar.codomain(domain) === Oscar.codomain(codomain) === D
@assert Oscar.domain(domain) === Oscar.codomain(phi)
@assert Oscar.domain(codomain) === Oscar.domain(phi)
map_factory = InducedContravariantMorphismFactory(phi, D, domain, codomain)
internal_morphism = HyperComplexMorphism(domain, codomain, map_factory, cached=true, offset=[0 for i in 1:dim(domain)])
return new{typeof(domain), typeof(codomain), ModuleFPHom}(internal_morphism)
end
end

underlying_morphism(phi::InducedContravariantMorphism) = phi.internal_morphism

function hom(
phi::AbsHyperComplexMorphism,
D::AbsHyperComplex;
domain::HomComplex = hom(Oscar.codomain(phi), D),
codomain::HomComplex = hom(Oscar.domain(phi), D)
)
return InducedContravariantMorphism(phi, D; domain, codomain)
end

# The same for covariant induced maps
struct InducedCovariantMorphismFactory{MorphismType} <: HyperComplexMorphismFactory{MorphismType}
phi::AbsHyperComplexMorphism
dom::HomComplex
cod::HomComplex
common_dom::AbsHyperComplex

# Fields needed for production
function InducedCovariantMorphismFactory(

Check warning on line 103 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L103

Added line #L103 was not covered by tests
phi::AbsHyperComplexMorphism,
D::AbsHyperComplex,
dom::HomComplex,
cod::HomComplex
)
return new{ModuleFPHom}(phi, dom, cod, D)

Check warning on line 109 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L109

Added line #L109 was not covered by tests
end
end

function hom(M::ModuleFP, phi::ModuleFPHom;

Check warning on line 113 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L113

Added line #L113 was not covered by tests
domain::ModuleFP=hom(M, Oscar.domain(phi)),
codomain::ModuleFP=hom(M, Oscar.codomain(phi))
)
return lift_homomorphism_covariant(domain, codomain, phi)

Check warning on line 117 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L117

Added line #L117 was not covered by tests
end

function (fac::InducedCovariantMorphismFactory)(self::AbsHyperComplexMorphism, i::Tuple)
dom = fac.dom
cod = fac.cod
common_dom = fac.common_dom
n = dim(common_dom)
m = dim(dom) - n
a = i[1:n]
b = i[n+1:m+n]
na = Tuple([-i for i in a])
return hom(common_dom[na], fac.phi[b]; domain=dom[i], codomain=cod[i])

Check warning on line 129 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L120-L129

Added lines #L120 - L129 were not covered by tests
end

function can_compute(fac::InducedCovariantMorphismFactory, self::AbsHyperComplexMorphism, i::Tuple)

Check warning on line 132 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L132

Added line #L132 was not covered by tests
# Decide whether the outgoing map from index i can be computed
dom = fac.dom
cod = fac.cod
common_dom = fac.common_dom
n = dim(common_dom)
m = dim(dom) - n
a = i[1:n]
b = i[n+1:m+n]
na = Tuple([-i for i in a])
return can_compute_index(fac.phi, b) && can_compute_index(common_dom, na)

Check warning on line 142 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L134-L142

Added lines #L134 - L142 were not covered by tests
end


@attributes mutable struct InducedCovariantMorphism{DomainType, CodomainType, MorphismType} <: AbsHyperComplexMorphism{DomainType, CodomainType, MorphismType, InducedCovariantMorphism{DomainType, CodomainType, MorphismType}}
internal_morphism::HyperComplexMorphism{DomainType, CodomainType, MorphismType}

function InducedCovariantMorphism(

Check warning on line 149 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L149

Added line #L149 was not covered by tests
D::AbsHyperComplex,
phi::AbsHyperComplexMorphism;
domain::HomComplex = hom(D, Oscar.codomain(phi)),
codomain::HomComplex = hom(D, Oscar.domain(phi))
)
@assert Oscar.domain(domain) === Oscar.domain(codomain) === D
@assert Oscar.codomain(domain) === Oscar.domain(phi)
@assert Oscar.codomain(codomain) === Oscar.codomain(phi)
map_factory = InducedCovariantMorphismFactory(phi, D, domain, codomain)

Check warning on line 158 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L155-L158

Added lines #L155 - L158 were not covered by tests

internal_morphism = HyperComplexMorphism(domain, codomain, map_factory, cached=true, offset=[0 for i in 1:dim(domain)])
return new{typeof(domain), typeof(codomain), ModuleFPHom}(internal_morphism)

Check warning on line 161 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L160-L161

Added lines #L160 - L161 were not covered by tests
end
end

underlying_morphism(phi::InducedCovariantMorphism) = phi.internal_morphism

Check warning on line 165 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L165

Added line #L165 was not covered by tests

function hom(

Check warning on line 167 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L167

Added line #L167 was not covered by tests
D::AbsHyperComplex,
phi::AbsHyperComplexMorphism;
domain::HomComplex = hom(D, Oscar.domain(phi)),
codomain::HomComplex = hom(D, Oscar.codomain(phi))
)
return InducedCovariantMorphism(D, phi; domain, codomain)

Check warning on line 173 in experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/induced_homs.jl#L173

Added line #L173 was not covered by tests
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Induced map of (homogeneous) Koszul complexes
#
# Let `S` be a graded ring and `a = (a₁,…,aₘ)` and `b = (b₁,…,bₙ)` two sequences
# in `S` with `bⱼ = ∑ᵢcⱼᵢ ⋅ aᵢ` for some matrix `C = (cⱼᵢ) ∈ Sⁿˣᵐ`.
# Then there is a natural map of Koszul complexes
#
# b b b
# ⋀⁰ Sⁿ ← ⋀¹Sⁿ ← ⋀² Sⁿ ← …
# ↓id ↓c ↓c
# ⋀⁰ Sᵐ ← ⋀¹Sᵐ ← ⋀² Sᵐ ← …
# a a a
#
# This is to construct that morphism.
function (fac::InducedKoszulMorFactory)(self::AbsHyperComplexMorphism, I::Tuple)
p = first(I)
dom = fac.dom[p]
cod = fac.cod[p]
A = matrix(fac.A)
n = ngens(fac.dom)
m = ngens(fac.cod)
img_gens = elem_type(cod)[]
for (i, ind_dom) in enumerate(combinations(n, p))
ii = data(ind_dom)::Vector{Int}
img = zero(cod)
for (j, ind_cod) in enumerate(combinations(m, p))
jj = data(ind_cod)::Vector{Int}
A_sub = A[ii, jj]
c = det(A_sub)
is_zero(c) && continue
img += c*cod[j]
end
push!(img_gens, img)
end
return hom(dom, cod, img_gens)
end

function can_compute(fac::InducedKoszulMorFactory, self::AbsHyperComplexMorphism, i::Tuple)
return can_compute_index(fac.dom, i) && can_compute_index(fac.cod, i)
end


# The return type for `coordinates` for ideals is not yet unified.
# This implementation is used to provide output as `SRow`
coordinates(::Type{OutputType}, f::T, I::Ideal{T}) where {OutputType<:SRow, T<:RingElem} = coordinates(f, I)

Check warning on line 44 in experimental/DoubleAndHyperComplexes/src/Morphisms/new_koszul_complexes.jl

View check run for this annotation

Codecov / codecov/patch

experimental/DoubleAndHyperComplexes/src/Morphisms/new_koszul_complexes.jl#L44

Added line #L44 was not covered by tests

function coordinates(::Type{OutputType}, f::T, I::Ideal{T}) where {OutputType<:SRow, T<:MPolyRingElem}
R = parent(f)
c = coordinates(f, I)::MatrixElem
sparse_row(R, [(i, c[1, i]) for i in 1:ngens(I) if !is_zero(c[1, i])])
end



underlying_morphism(phi::InducedKoszulMorphism) = phi.internal_morphism

Loading
Loading