Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
08c5529
moved 'component' to Core
mahrud May 12, 2026
2579bf5
enabled SheafComplexes
mahrud May 12, 2025
e278d72
removed unnecessary definition in Varieties
mahrud May 8, 2025
5ab3310
added commentary in twistedGlobalSectionsModule
mahrud May 12, 2025
01abb38
added (not working) test for isomorphism of sheaves
mahrud May 12, 2025
489e5b2
added isInjective(SheafMap)
mahrud May 13, 2025
0122cf8
passed options for kernel SheafMap
mahrud May 13, 2025
a119f3d
specified variety in calls to sheaf
mahrud Jan 14, 2024
6857ab5
added kludge for promote(RingElement, OO_X)
mahrud Mar 15, 2025
d94b304
added koszul and koszulComplex for sheaf maps
mahrud Nov 24, 2024
ac3662b
added wedgeProduct and generalized koszul for coherent sheaves
mahrud Dec 1, 2024
e3307c9
generalized koszul for modules
mahrud Dec 1, 2024
1105d34
added comultiplication
mahrud Jan 20, 2025
b7848d3
added hilbertPolynomial(Variety, CoherentSheaf)
mahrud Nov 23, 2024
cddf97f
set hilbertPolynomial to check for base variety
mahrud Nov 26, 2024
9bb5ddb
updated hilbertPolynomial for coherent sheaves
mahrud Dec 1, 2024
39506b7
cached homomorphism for modules and sheaves
mahrud Nov 24, 2024
a3374fa
simplified caching of sheaf of rings
mahrud Nov 24, 2024
67fc289
specified the variety in sheafifying complexes
mahrud Nov 24, 2024
d1b978e
cached nef/eff cones
mahrud Dec 1, 2024
9db1883
added support of sheaf as synonym for annihilator
mahrud Dec 1, 2024
c599606
fixed small issue in zero sheaf maps
mahrud Dec 1, 2024
33cbd6a
added TODO to make liftModule work on ring towers
mahrud Mar 6, 2026
4790203
added SheafMap_Array and SheafMap^Array
mahrud Feb 24, 2026
ed8f5b3
fixed a bug in CoherentSheaf^Array
mahrud Feb 25, 2026
04d23cd
fixed a bug in SheafMap * SheafMap
mahrud Feb 25, 2026
7fb2400
added isHomogeneous(SheafMap) for consistency
mahrud Mar 2, 2026
4fd2a24
added extend(Complex,Complex,SheafMap)
mahrud Mar 2, 2026
a58d508
bumped version of Varieties
mahrud Mar 5, 2026
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
3 changes: 2 additions & 1 deletion M2/Macaulay2/m2/Hom.m2
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ Hom(Module, Module) := Module => opts -> (M, N) -> (
trim' := if opts.MinimalGenerators then trim else identity;
-- a hack: we really want to type "Hom(M, N) = ..."
H = Y#(Hom, M, N, e) = if opts.MinimalGenerators then trim H else H;
H.cache.homomorphism = f -> map(N, M, adjoint'(f, M, N), Degree => first degrees source f + degree f);
H.cache.homomorphism = f -> H.cache#(homomorphism, f) ??= (
map(N, M, adjoint'(f, M, N), Degree => first degrees source f + degree f));
H.cache.formation = FunctionApplication { Hom, (M, N, DegreeLimit => e) };
H)

Expand Down
2 changes: 2 additions & 0 deletions M2/Macaulay2/m2/exports.m2
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,12 @@ export {
"compareExchange",
"complement",
"complete",
"component",
"components",
"compose",
"compositions",
"compress",
"comultiplication",
"concatenate",
"cone",
"conjugate",
Expand Down
6 changes: 6 additions & 0 deletions M2/Macaulay2/m2/matrix.m2
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ isDirectSum Module := (M) -> M.cache.?components
components Module := M -> if M.cache.?components then M.cache.components else {M}
components Matrix := f -> if f.cache.?components then f.cache.components else {f}

component = method()
component(Module, Thing) := Module => (M, k) -> (
if not M.cache.?indexComponents then error "expected Module to be a direct sum with indexed components";
if not M.cache.indexComponents#?k then error("expected ", k, " to be the index of a component");
M.cache.components#(M.cache.indexComponents#k))

formation = method()
formation Module := M -> if M.cache.?formation then M.cache.formation

Expand Down
8 changes: 8 additions & 0 deletions M2/Macaulay2/m2/multilin.m2
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ wedgeProduct(ZZ, ZZ, Module) := Matrix => (p, q, M) -> (
if isFreeModule M then map(ring M, rawWedgeProduct(p,q,raw M))
else map(exteriorPower(p+q,M),exteriorPower(p,M)**exteriorPower(q,M),wedgeProduct(p,q,cover M)))

-- TODO: document this
-- TODO: generalize to wedgeCoproduct(p, q, M)
comultiplication = method()
comultiplication(ZZ, Module) := Matrix => (i, M) -> (
map(exteriorPower(i-1, M) ** M,
exteriorPower(i, M),
transpose wedgeProduct(i-1, 1, cover M)))

-----------------------------------------------------------------------------
-- ideals of minors, permanents, and pfaffians
-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/m2/pushforward.m2
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ addHook((kernel, Matrix), Strategy => "PushForward",
-- cf. https://github.com/Macaulay2/M2/issues/3321
-- and https://github.com/Macaulay2/M2/issues/3656
-- TODO: can we lift generators and relations and avoid presentation?
-- TODO: make this work for ring towers
liftModule = M -> (
if instance(ring M, PolynomialRing) then M
else cokernel liftMorphism presentation M)
Expand Down
3 changes: 0 additions & 3 deletions M2/Macaulay2/packages/Complexes.m2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ newPackage(
)

export {
"component",
-- types
"Complex",
"ComplexMap",
Expand Down Expand Up @@ -197,8 +196,6 @@ undocumented{
(texMath, Complex),
(texMath, ComplexMap),
(expression, ComplexMap),
(component,Module,Thing),
component
}

load "./Complexes/ChainComplexDoc.m2"
Expand Down
6 changes: 0 additions & 6 deletions M2/Macaulay2/packages/Complexes/ChainComplex.m2
Original file line number Diff line number Diff line change
Expand Up @@ -859,12 +859,6 @@ cohomology(ZZ,Complex) := opts -> (i,C) -> homology(-i, C)
--------------------------------------------------------------------
-- Hom -------------------------------------------------------------
--------------------------------------------------------------------
component = method()
component(Module,Thing) := (M,k) -> (
if not M.cache.?indexComponents then error "expected Module to be a direct sum with indexed components";
if not M.cache.indexComponents#?k then error("expected "|toString k|" to be the index of a component");
(components M)#(M.cache.indexComponents#k)
)
Hom(Complex, Complex) := Complex => opts -> (C,D) -> (
-- signs here are based from Christensen and Foxby
-- which agrees with Conrad (Grothendieck duality book)
Expand Down
10 changes: 9 additions & 1 deletion M2/Macaulay2/packages/Macaulay2Doc/functions/directSum-doc.m2
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ document {
Subnodes => {
TO isDirectSum,
TO components,
TO component,
}}

document {
Expand All @@ -128,10 +129,17 @@ document {
TT "components M", " -- the list of components for a module ", TT "M", " which was
formed as a direct sum, or ", TT "{M}", " if ", TT "M", " was not formed as a direct sum.
Works also for matrices, chain complexes, etc.",
SeeAlso => {"vector", "directSum", "++"},
SeeAlso => {"vector", "directSum", "++", "component"},
Subnodes => { TO indexComponents },
}

document {
Key => { component, (component, Module, Thing) },
Headline => "get the direct sum component with given index",
TT "component(M, k)", " -- produces the component of ", TT "M", " with index ", TT "k", ".",
SeeAlso => { "components", "directSum", "indexComponents" },
}

-- TODO:
-- document {
-- Key => (indices,HashTable),
Expand Down
6 changes: 0 additions & 6 deletions M2/Macaulay2/packages/NormalToricVarieties/Chow.m2
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,5 @@ hilbertPolynomial (NormalToricVariety, Module) := RingElement => opts ->
)
);

hilbertPolynomial (NormalToricVariety, Ring) := RingElement => opts ->
(X, S) -> hilbertPolynomial (X, S^1, opts)
hilbertPolynomial (NormalToricVariety, SheafOfRings) := RingElement =>
opts -> (X, S) -> hilbertPolynomial (X, ring S, opts)
hilbertPolynomial (NormalToricVariety, Ideal) := RingElement => opts ->
(X, I) -> hilbertPolynomial (X, (ring I)^1/I, opts)
hilbertPolynomial (NormalToricVariety, CoherentSheaf) := RingElement =>
opts -> (X, F) -> hilbertPolynomial (X, module F, opts)
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,6 @@ doc ///
doc ///
Key
(hilbertPolynomial, NormalToricVariety)
(hilbertPolynomial, NormalToricVariety, Ring)
(hilbertPolynomial, NormalToricVariety, SheafOfRings)
Headline
compute the multivariate Hilbert polynomial
Usage
Expand Down Expand Up @@ -615,7 +613,6 @@ doc ///
Key
(hilbertPolynomial, NormalToricVariety, CoherentSheaf)
(hilbertPolynomial, NormalToricVariety, Module)
(hilbertPolynomial, NormalToricVariety, Ideal)
Headline
compute the multivariate Hilbert polynomial
Usage
Expand Down
5 changes: 2 additions & 3 deletions M2/Macaulay2/packages/NormalToricVarieties/Sheaves.m2
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ sheaf (NormalToricVariety, Module) := CoherentSheaf => (X,M) -> (
symbol cache => new CacheTable
}
));
sheaf (NormalToricVariety, Ring) := SheafOfRings => (X,R) -> (
sheaf (NormalToricVariety, Ring) := SheafOfRings => (X,R) -> X.cache.sheaf ??= (
if ring X =!= R then
error "-- expected the ring of the variety";
-- TODO: simplify when https://github.com/Macaulay2/M2/issues/3351 is fixed
X.sheaf = X.sheaf ?? new SheafOfRings from {
new SheafOfRings from {
symbol variety => X,
symbol ring => R
}
Expand Down
26 changes: 22 additions & 4 deletions M2/Macaulay2/packages/OldChainComplexes/chaincomplexes.m2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

importFrom_Core {
"short",
"rawKoszul",
"rawTensor",
"concatBlocks",
"moduleAbbrv",
Expand Down Expand Up @@ -921,10 +922,27 @@ eagonNorthcott Matrix := f -> (
j += 1) ;
chainComplex d);

------ koszul
koszul Matrix := ChainComplex => f ->(
n := rank source f;
chainComplex toList apply(1 .. n, i -> koszul(i,f)))
-----------------------------------------------------------------------------
-- koszul
-----------------------------------------------------------------------------

-- this version only works when target f is R^1
freeKoszul = (i, f) -> map(
exteriorPower(i-1, source f),
exteriorPower(i, source f),
rawKoszul(i, raw f))

koszul(ZZ, Matrix) := Matrix => (i, f) -> (
if target f === module ring f then return freeKoszul(i, f);
-- this version is more general, but perhaps slower
F := source f;
G := exteriorPower(i-1, F);
g := wedgeProduct(1, i-1, F);
(f ** id_G) * g)

-- Note: exterior powers of modules are cached
koszul Matrix := ChainComplex => f -> chainComplex apply(
toList(1 .. rank source f), i -> koszul(i, f))

-- this seems not to be useful to the user (yet):
-- koszul(ZZ, Matrix, Matrix) := Matrix => (i,m,n) -> map(ring m, rawKoszulMonomials(i, raw m, raw n))
Expand Down
Loading
Loading