From 8cb5cc6dff4e366e89a89fe52978656a2d240528 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Tue, 2 Jan 2024 11:58:40 -0600 Subject: [PATCH] fixup Hom options --- M2/Macaulay2/m2/methods.m2 | 2 ++ M2/Macaulay2/packages/Varieties/SheafMaps.m2 | 20 ++++++++++---------- M2/Macaulay2/packages/Varieties/tests.m2 | 3 +-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/M2/Macaulay2/m2/methods.m2 b/M2/Macaulay2/m2/methods.m2 index 36176222bc9..d23a4b80c02 100644 --- a/M2/Macaulay2/m2/methods.m2 +++ b/M2/Macaulay2/m2/methods.m2 @@ -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 diff --git a/M2/Macaulay2/packages/Varieties/SheafMaps.m2 b/M2/Macaulay2/packages/Varieties/SheafMaps.m2 index c7566618991..f44ce762baa 100644 --- a/M2/Macaulay2/packages/Varieties/SheafMaps.m2 +++ b/M2/Macaulay2/packages/Varieties/SheafMaps.m2 @@ -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; @@ -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 @@ -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 diff --git a/M2/Macaulay2/packages/Varieties/tests.m2 b/M2/Macaulay2/packages/Varieties/tests.m2 index 46402c0228e..e4bad7c479d 100644 --- a/M2/Macaulay2/packages/Varieties/tests.m2 +++ b/M2/Macaulay2/packages/Varieties/tests.m2 @@ -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),