Skip to content

Commit

Permalink
fixup Hom options
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed Jan 2, 2024
1 parent c5cfb22 commit 8cb5cc6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 2 additions & 0 deletions M2/Macaulay2/m2/methods.m2
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ codeHelper#(functionBody (stashValue null) null) = g -> {
-- TODO: simplify usage
cacheHooks = (ckey, X, mkey, args, f) -> ((cacheValue ckey) (X -> tryHooks(mkey, args, f))) X

-- TODO: implement similar function which caches in the youngest?

-----------------------------------------------------------------------------
-- hypertext conversion

Expand Down
20 changes: 10 additions & 10 deletions M2/Macaulay2/packages/Varieties/SheafMaps.m2
Original file line number Diff line number Diff line change
Expand Up @@ -219,20 +219,20 @@ inverse SheafMap := SheafMap => f -> (
-----------------------------------------------------------------------------
-- sheafHom and Hom
-----------------------------------------------------------------------------
sheafHom(SheafMap, SheafMap) := SheafMap => (phi, psi) -> (dual phi) ** psi
sheafHom(SheafMap, CoherentSheaf) := SheafMap => (phi, F) -> sheafHom(phi, id_F)
sheafHom(CoherentSheaf, SheafMap) := SheafMap => (F, phi) -> sheafHom(id_F, phi)
sheafHom(SheafMap, SheafOfRings) := SheafMap => (phi, O) -> sheafHom(phi, O^1)
sheafHom(SheafOfRings, SheafMap) := SheafMap => (O, phi) -> sheafHom(O^1, phi)
sheafHom(SheafMap, SheafMap) := SheafMap => o -> (phi, psi) -> (dual phi) ** psi
sheafHom(SheafMap, CoherentSheaf) := SheafMap => o -> (phi, F) -> sheafHom(phi, id_F)
sheafHom(CoherentSheaf, SheafMap) := SheafMap => o -> (F, phi) -> sheafHom(id_F, phi)
sheafHom(SheafMap, SheafOfRings) := SheafMap => o -> (phi, O) -> sheafHom(phi, id_(O^1))
sheafHom(SheafOfRings, SheafMap) := SheafMap => o -> (O, phi) -> sheafHom(id_(O^1), phi)

-- TODO: bring this from DirectSummands
-- this uses Hom(Module, Module, ZZ) which is faster in a specific degree
--Hom(CoherentSheaf, CoherentSheaf) := Module => (F, G) -> (
--Hom(CoherentSheaf, CoherentSheaf) := Module => o -> (F, G) -> (
-- sameVariety(F, G); HH^0 sheaf(variety F, Hom(module F, module G, 0)))

-- See [Hartshorne, Ch. III Exercise 6.1, pp. 237]
Hom(CoherentSheaf, CoherentSheaf) := Module => (F, G) -> (
H := prune sheafHom(F, G);
Hom(CoherentSheaf, CoherentSheaf) := Module => opts -> (F, G) -> (
H := prune sheafHom(F, G, opts);
-- Note: this is only an isomorphism of coherent sheaves,
-- but we want the preimage of a map of global sections.
f := matrix H.cache.pruningMap;
Expand Down Expand Up @@ -261,7 +261,7 @@ inducedMap(M, N) -- anti-digonal
///

-- Note: homomorphism(Matrix) is defined to use V.cache.homomorphism
homomorphism' SheafMap := h -> moveToField basis(0, homomorphism' matrix h)
homomorphism' SheafMap := o -> h -> moveToField basis(0, homomorphism'(matrix h, o))

-----------------------------------------------------------------------------
-- homology
Expand Down Expand Up @@ -343,7 +343,7 @@ Ext(ZZ, CoherentSheaf, SheafMap) := Matrix => opts -> (m, F, f) -> (
a2 := max apply(n - l2 .. p2, j -> (max degrees P2_j)#0 - j);
r := max(a1, a2) - e - m + 1;
M = truncate(r, M));
moveToField basis(0, Ext^m(M, matrix f)))
moveToField basis(0, Ext^m(M, matrix f, opts)))

-----------------------------------------------------------------------------
-- Yoneda Ext
Expand Down
3 changes: 1 addition & 2 deletions M2/Macaulay2/packages/Varieties/tests.m2
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ hh^(1,2)(X) == 1
-----------------------------------------------------------------------------
-- TODO: is it possible to get this as the adjoint to f_*?

pullback = method(Options => {})
pullback(RingMap, Module) := Module -> opts -> (f, M) -> notImplemented()
pullback(RingMap, Module) := Module -> {} >> o -> (f, M) -> notImplemented()

RingMap^* := Functor => f -> new Functor from {
argument => X -> pullback functorArgs(f, X),
Expand Down

0 comments on commit 8cb5cc6

Please sign in to comment.