Skip to content

Commit

Permalink
fixed a bug in basis'
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed Nov 22, 2024
1 parent a7adc8c commit b137b77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 8 additions & 4 deletions M2/Macaulay2/packages/Truncations.m2
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,15 @@ basis'(List, Module) := Matrix => opts -> (degs, M) -> (
if M == 0 then return map(M, 0, 0);
if not truncateImplemented(R := ring M) then error "cannot use basis' with this ring type";
degs = checkOrMakeDegreeList(degs, degreeLength R);
B := if isFreeModule M then (
map(M, , basisMonomials(degs, M, "partial degrees" => opts#"partial degrees")))
-- TODO: "mingens image" seems silly ...
B := map(M, , if not M.?relations
then basisMonomials(degs, M, "partial degrees" => opts#"partial degrees")
else reduce(super M, raw basis'(degs, image generators M, opts)));
inducedMap(M, , mingens image B))
else if not M.?relations then map(M, ,
mingens image basisMonomials(degs, cover M, "partial degrees" => opts#"partial degrees"))
else inducedMap(M, ,
mingens image map(ambient M, ,
reduce(super M, raw gens image basis'(degs, image generators M))))
)

--------------------------------------------------------------------
----- Tests section
Expand Down
7 changes: 7 additions & 0 deletions M2/Macaulay2/packages/Truncations/basis-tests.m2
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ TEST ///
(t, B) = toSequence elapsedTiming basis(degree D, S^1);
assert(numcols B == 11 and t < 10)
///

TEST ///
needsPackage "NormalToricVarieties"
X = hirzebruchSurface 2
M = cotangentSheaf X
assert(HH^1(X, M) == QQ^2)
///

0 comments on commit b137b77

Please sign in to comment.