From eb001e2a8559c866332f69f3ca6ec85177d839f2 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Tue, 23 Jan 2024 09:56:34 -0500 Subject: [PATCH 01/14] resolved conflicts --- M2/Macaulay2/m2/exports.m2 | 1 + M2/Macaulay2/m2/matrix1.m2 | 139 +++++++++++------- M2/Macaulay2/m2/newring.m2 | 3 +- .../packages/Macaulay2Doc/M2-Singular-Book.m2 | 2 +- M2/Macaulay2/packages/Macaulay2Doc/doc.m2 | 13 +- M2/Macaulay2/packages/Macaulay2Doc/doc3.m2 | 4 +- M2/Macaulay2/packages/Macaulay2Doc/doc7.m2 | 4 +- M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 | 2 +- .../packages/Macaulay2Doc/doc_ideals.m2 | 20 ++- .../Macaulay2Doc/functions/comodule-doc.m2 | 4 +- .../functions/degreeLength-doc.m2 | 2 +- .../Macaulay2Doc/functions/degrees-doc.m2 | 3 +- .../Macaulay2Doc/functions/degreesRing-doc.m2 | 2 +- .../Macaulay2Doc/functions/generators-doc.m2 | 6 +- .../Macaulay2Doc/functions/ideal-doc.m2 | 32 ++-- .../functions/isHomogeneous-doc.m2 | 4 +- .../Macaulay2Doc/functions/isIdeal-doc.m2 | 4 +- .../Macaulay2Doc/functions/numgens-doc.m2 | 2 +- .../Macaulay2Doc/functions/promote-doc.m2 | 6 +- .../Macaulay2Doc/functions/ring-doc.m2 | 4 +- .../functions/symbol-underscore-doc.m2 | 10 +- .../packages/Macaulay2Doc/ov_ideals.m2 | 6 +- .../packages/MultiprojectiveVarieties.m2 | 2 +- M2/Macaulay2/packages/Varieties/euler-doc.m2 | 6 +- M2/Macaulay2/packages/Varieties/genera-doc.m2 | 2 +- M2/Macaulay2/packages/Varieties/genus-doc.m2 | 4 +- 26 files changed, 170 insertions(+), 117 deletions(-) diff --git a/M2/Macaulay2/m2/exports.m2 b/M2/Macaulay2/m2/exports.m2 index 3bcab8f7e95..e84346704dc 100644 --- a/M2/Macaulay2/m2/exports.m2 +++ b/M2/Macaulay2/m2/exports.m2 @@ -203,6 +203,7 @@ export { "Homogeneous", "Homogeneous2", "HorizontalSpace", + "LeftIdeal", "Ideal", "IgnoreExampleErrors", "ImmutableType", diff --git a/M2/Macaulay2/m2/matrix1.m2 b/M2/Macaulay2/m2/matrix1.m2 index 2da84a24fd8..35b5c573431 100644 --- a/M2/Macaulay2/m2/matrix1.m2 +++ b/M2/Macaulay2/m2/matrix1.m2 @@ -420,52 +420,54 @@ cokernel Matrix := Module => m -> ( cokernel RingElement := Module => f -> cokernel matrix {{f}} image RingElement := Module => f -> image matrix {{f}} -Ideal = new Type of HashTable +LeftIdeal = new Type of HashTable +Ideal = new Type of LeftIdeal Ideal.synonym = "ideal" ideal = method(Dispatch => Thing, TypicalValue => Ideal) -expression Ideal := (I) -> (expression ideal) unsequence apply(toSequence first entries generators I, expression) -net Ideal := (I) -> net expression I -toString Ideal := (I) -> toString expression I -toExternalString Ideal := (I) -> "ideal " | toExternalString generators I -texMath Ideal := (I) -> texMath expression I +expression LeftIdeal := (I) -> (expression ideal) unsequence apply(toSequence first entries generators I, expression) +net LeftIdeal := (I) -> net expression I +toString LeftIdeal := (I) -> toString expression I +toExternalString LeftIdeal := (I) -> "ideal " | toExternalString generators I +texMath LeftIdeal := (I) -> texMath expression I -isIdeal Ideal := I -> true -isHomogeneous Ideal := (I) -> isHomogeneous generators I +isIdeal LeftIdeal := I -> true +isHomogeneous LeftIdeal := (I) -> isHomogeneous generators I -degrees Ideal := I -> degrees source generators I +degrees LeftIdeal := I -> degrees source generators I -- TODO: deprecate these -degreeLength Ideal := I -> degreeLength ring I -degreesRing Ideal := I -> degreesRing ring I +degreeLength LeftIdeal := I -> degreeLength ring I +degreesRing LeftIdeal := I -> degreesRing ring I -promote(Ideal,Number) := -promote(Ideal,RingElement) := (I,R) -> ideal promote(generators I, R) +promote(LeftIdeal,Number) := +promote(LeftIdeal,RingElement) := (I,R) -> ideal promote(generators I, R) comodule Module := Module => M -> cokernel super map(M,M,1) quotient Module := Module => opts -> M -> comodule M -comodule Ideal := Module => I -> cokernel generators I -quotient Ideal := Module => opts -> I -> (ring I) / I -module Ideal := Module => (cacheValue symbol module) (I -> image generators I) +comodule LeftIdeal := Module => I -> cokernel generators I +quotient LeftIdeal := Module => opts -> I -> (ring I) / I +module LeftIdeal := Module => (cacheValue symbol module) (I -> image generators I) -genera Ideal := (I) -> genera ((ring I)^1/I) -genus Ideal := (I) -> genus ((ring I)^1/I) +genera LeftIdeal := I -> genera ((ring I)^1/I) +genus LeftIdeal := I -> genus ((ring I)^1/I) -eulers(Ideal) := (I) -> eulers((ring I)^1/I) -euler(Ideal) := (I) -> euler((ring I)^1/I) +eulers LeftIdeal := I -> eulers((ring I)^1/I) +euler LeftIdeal := I -> euler((ring I)^1/I) +-- two-sided ideal expected RingElement * Ideal := Ideal => (r,I) -> ideal (r ** generators I) Ideal * RingElement := Ideal => (I,r) -> ideal ((generators I)**r) ZZ * Ideal := (r,I) -> ideal (r * generators I) Ideal * ZZ := (I,r) -> ideal (r * generators I) -generators Ideal := Matrix => opts -> (I) -> I.generators -Ideal_* := I -> first entries generators I -Ideal / Function := List => (I,f) -> apply(flatten entries generators I, f) -Function \ Ideal := List => (f,I) -> apply(flatten entries generators I, f) +generators LeftIdeal := Matrix => opts -> (I) -> I.generators +LeftIdeal_* := I -> first entries generators I +LeftIdeal / Function := List => (I,f) -> apply(flatten entries generators I, f) +Function \ LeftIdeal := List => (f,I) -> apply(flatten entries generators I, f) generator = method() -generator Ideal := RingElement => (I) -> ( +generator LeftIdeal := RingElement => I -> ( if I.cache.?trim then I = I.cache.trim; R := ring I; n := numgens I; @@ -487,18 +489,34 @@ generator Module := RingElement => (M) -> ( if n == 1 then return M_0; error "expected ideal to have a single generator") -Ideal / Ideal := Module => (I,J) -> module I / module J +LeftIdeal / LeftIdeal := Module => (I,J) -> module I / module J + +-- two-sided ideal expected Module / Ideal := Module => (M,J) -> M / (J * M) -Ideal#AfterPrint = Ideal#AfterNoPrint = (I) -> (Ideal," of ",ring I) +LeftIdeal#AfterPrint = LeftIdeal#AfterNoPrint = I -> (LeftIdeal," of ",ring I) +Ideal#AfterPrint = Ideal#AfterNoPrint = I -> (Ideal," of ",ring I) +-- two-sided ideal expected Ideal ^ ZZ := Ideal => (I,n) -> ideal symmetricPower(n,generators I) Ideal * Ideal := Ideal => ((I,J) -> ideal flatten (generators I ** generators J)) @@ samering Ideal * Module := Module => ((I,M) -> subquotient (generators I ** generators M, relations M)) @@ samering -Ideal + Ideal := Ideal => ((I,J) -> ideal (generators I | generators J)) @@ tosamering -Ideal + RingElement := Ideal + Number := ((I,r) -> I + ideal r) @@ tosamering -RingElement + Ideal := Number + Ideal := ((r,I) -> ideal r + I) @@ tosamering -Ideal _ ZZ := RingElement => (I,n) -> (generators I)_(0,n) + +LeftIdeal + LeftIdeal := LeftIdeal => ((I,J) -> ideal (generators I | generators J)) @@ tosamering +-- Ideal + Ideal := Ideal => ((I,J) -> ideal (generators I | generators J)) @@ tosamering +LeftIdeal + RingElement := LeftIdeal + Number := ((I,r) -> I + ideal r) @@ tosamering +RingElement + LeftIdeal := Number + LeftIdeal := ((r,I) -> ideal r + I) @@ tosamering +LeftIdeal _ ZZ := RingElement => (I,n) -> (generators I)_(0,n) + + +Matrix % LeftIdeal := Matrix => ((f,I) -> + if numRows f === 1 + then f % gb I + else + error "not implemented (defined for two-sided ideals; see `code (symbol %, Matrix, Ideal)`)" + ) @@ samering + +-- two-sided ideal expected (note: R/I is a problem !!!) Matrix % Ideal := Matrix => ((f,I) -> if numRows f === 1 then f % gb I @@ -508,23 +526,28 @@ Matrix % Ideal := Matrix => ((f,I) -> S := R/I; lift(promote(f,S),R)) ) @@ samering -Vector % Ideal := (v,I) -> new class v from {v#0%I} -numgens Ideal := (I) -> numgens source generators I -leadTerm Ideal := Matrix => (I) -> leadTerm generators gb I -leadTerm(ZZ,Ideal) := Matrix => (n,I) -> leadTerm(n,generators gb I) -jacobian Ideal := Matrix => (I) -> jacobian generators I -Ideal _ List := (I,w) -> (module I)_w -ring Ideal := (I) -> I.ring +Vector % LeftIdeal := (v,I) -> new class v from {v#0%I} + +numgens LeftIdeal := I -> numgens source generators I +leadTerm LeftIdeal := Matrix => I -> leadTerm generators gb I +leadTerm(ZZ,LeftIdeal) := Matrix => (n,I) -> leadTerm(n,generators gb I) + +-- two-sided ideal expected (unless defined for non-polynomial rings!!!) +jacobian Ideal := Matrix => I -> jacobian generators I + +LeftIdeal _ List := (I,w) -> (module I)_w + +ring LeftIdeal := I -> I.ring -Ideal == Ring := (I,R) -> ( +LeftIdeal == Ring := (I,R) -> ( if ring I =!= R then error "expected ideal in the given ring"; 1_R % I == 0) -Ring == Ideal := (R,I) -> I == R +Ring == LeftIdeal := (R,I) -> I == R -Ideal == Ideal := (I,J) -> ( +LeftIdeal == LeftIdeal := (I,J) -> ( samering(I,J); ( generators I == generators J or -- if isHomogeneous I and isHomogeneous J -- can be removed later @@ -533,10 +556,10 @@ Ideal == Ideal := (I,J) -> ( isSubset(I,J) and isSubset(J,I) -- can be removed later )) -Ideal == Module := (I,M) -> module I == M -Module == Ideal := (M,I) -> M == module I +LeftIdeal == Module := (I,M) -> module I == M +Module == LeftIdeal := (M,I) -> M == module I -ideal Matrix := Ideal => (f) -> ( +ideal Matrix := LeftIdeal => f -> ( R := ring f; if not isFreeModule target f or not isFreeModule source f then error "expected map between free modules"; @@ -549,9 +572,13 @@ ideal Matrix := Ideal => (f) -> ( g := map(R^1,,f); -- in case the degrees are wrong if isHomogeneous g then f = g; ); - new Ideal from { symbol generators => f, symbol ring => R, symbol cache => new CacheTable } ) + new ( + -- Ideal == two-sided ideal + if isCommutative R or isSkewCommutative R then Ideal + else LeftIdeal + ) from { symbol generators => f, symbol ring => R, symbol cache => new CacheTable } ) -ideal Module := Ideal => (M) -> ( +ideal Module := LeftIdeal => M -> ( F := ambient M; if isSubmodule M and rank F === 1 then ideal generators M else error "expected a submodule of a free module of rank 1" @@ -560,13 +587,14 @@ idealPrepare = method() idealPrepare RingElement := idealPrepare Number := identity idealPrepare Matrix := m -> flatten entries m -idealPrepare Ideal := I -> I_* +idealPrepare LeftIdeal := I -> I_* idealPrepare Thing := x -> error "expected a list of numbers, matrices, ring elements or ideals" -ideal List := ideal Sequence := Ideal => v -> ideal matrix {flatten apply(toList splice v,idealPrepare)} -ideal RingElement := ideal Number := Ideal => v -> ideal {v} +ideal List := ideal Sequence := LeftIdeal => v -> ideal matrix {flatten apply(toList splice v,idealPrepare)} +ideal RingElement := ideal Number := LeftIdeal => v -> ideal {v} ideal Ring := R -> ideal map(R^1,R^0,0) -Ideal ^ Array := (I, e) -> ( +-- not well-defined (mathwise!!!) +Ideal ^ Array := (I, e) -> ( R := ring I; n := numgens R; -- Error if input is not correct. @@ -635,7 +663,7 @@ degree Matrix := List => (f) -> ( if N.?generators then d = d + getshift N.generators; d) -super(Matrix) := Matrix => (f) -> ( +super Matrix := Matrix => (f) -> ( M := target f; if M.?generators then map(super M, M, M.generators) * f else f @@ -644,18 +672,19 @@ super(Matrix) := Matrix => (f) -> ( isInjective Matrix := (f) -> kernel f == 0 isSurjective Matrix := (f) -> cokernel f == 0 +-- two-sided ideal expected scan({ZZ,QQ}, S -> ( lift(Ideal,S) := opts -> (I,S) -> ( -- this will be pretty slow if ring I === S then I else (ideal lift(generators I,S,opts)) + ideal (presentation ring I ** S)))); -content(RingElement) := Ideal => (f) -> ideal \\ last \ listForm f -content(RingElement, RingElement) := Ideal => (f,x) -> ideal last coefficients(f, Variables => {x}) +content RingElement := LeftIdeal => f -> ideal \\ last \ listForm f +content(RingElement, RingElement) := LeftIdeal => (f,x) -> ideal last coefficients(f, Variables => {x}) -cover(Matrix) := Matrix => (f) -> matrix f +cover Matrix := Matrix => f -> matrix f -rank Matrix := (f) -> ( +rank Matrix := f -> ( if hasEngineLinearAlgebra ring f and isBasicMatrix f then basicRank f else rank image f diff --git a/M2/Macaulay2/m2/newring.m2 b/M2/Macaulay2/m2/newring.m2 index 9a499802a15..3e7a79e6d38 100644 --- a/M2/Macaulay2/m2/newring.m2 +++ b/M2/Macaulay2/m2/newring.m2 @@ -75,7 +75,8 @@ tensor(QuotientRing, QuotientRing) := monoidTensorDefaults >> optns -> (R, S) fg := substitute(f,(vars AB)_{0 .. m-1}) | substitute(g,(vars AB)_{m .. m+n-1}); -- forceGB fg; -- if the monomial order chosen doesn't restrict, then this -- is an error!! MES - AB/image fg) + if isPolynomialRing A and isPolynomialRing B then AB else AB/image fg + ) ------------------------- -- Graph of a ring map -- diff --git a/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2 b/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2 index b93f253b500..c6b7765ab92 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2 @@ -496,7 +496,7 @@ document { "(gens K) % I" }, "In Macaulay2, inclusion of ideals can be tested using ", TO (isSubset,Ideal,Ideal), - " and equality can be checked using ", TO (symbol==,Ideal,Ideal), ". In both cases + " and equality can be checked using ", TO (symbol==,LeftIdeal,LeftIdeal), ". In both cases the necessary Groebner bases are computed, if they have not already been computed.", EXAMPLE { "isSubset(K,I)", diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 index 823757fd50b..c6878018ad3 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 @@ -226,7 +226,7 @@ document { (symbol +, ChainComplexMap, ZZ), (symbol +, RingElement, RingElement), (symbol +, InfiniteNumber, InfiniteNumber), - (symbol +, Ideal, RingElement), + (symbol +, LeftIdeal, RingElement), (symbol +, RingElement, ChainComplexMap), (symbol +, MutableMatrix, MutableMatrix), (symbol +, Matrix, Matrix), @@ -803,7 +803,8 @@ document { (symbol==, Matrix, Matrix), (symbol==, ProjectiveHilbertPolynomial, ProjectiveHilbertPolynomial), (symbol==, ZZ, ProjectiveHilbertPolynomial), (symbol==, ProjectiveHilbertPolynomial, ZZ), (symbol==, ChainComplex, ChainComplex), (symbol==, RingElement, RingElement), (symbol==, GradedModuleMap, GradedModuleMap), - (symbol==, Ideal, Ideal), (symbol==, MutableMatrix, MutableMatrix), (symbol ==,Boolean,Boolean), + (symbol==, LeftIdeal, LeftIdeal), + (symbol==, MutableMatrix, MutableMatrix), (symbol ==,Boolean,Boolean), (symbol ==,CC,CC), (symbol ==,CC,QQ), (symbol ==,CC,RR), (symbol ==,CC,ZZ), (symbol ==,Matrix,Number), (symbol ==,Number,Matrix), (symbol ==,QQ,CC), (symbol ==,QQ,QQ), (symbol ==,QQ,RR), (symbol ==,RR,CC), (symbol ==,RR,QQ), (symbol ==,RR,RR), (symbol ==,RR,ZZ), @@ -837,7 +838,7 @@ document { (symbol==, GradedModuleMap, RingElement), (symbol==, RingElement, GradedModuleMap), (symbol==, String, Net), - (symbol==, Ideal, Ring), + (symbol==, LeftIdeal, Ring), (symbol==, ZZ, Ideal), (symbol==, Ideal, ZZ), (symbol==, Matrix, RingElement), @@ -859,9 +860,9 @@ document { (symbol==, ChainComplexMap, ChainComplexMap), (symbol==, Net, Net), (symbol==, Net, String), - (symbol==, Module, Ideal), - (symbol==, Ideal, Module), - (symbol==, Ring, Ideal), + (symbol==, Module, LeftIdeal), + (symbol==, LeftIdeal, Module), + (symbol==, Ring, LeftIdeal), (symbol==, RingMap, ZZ), (symbol==, ZZ, RingMap) }, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc3.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc3.m2 index be87bd9e026..607621f2b35 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc3.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc3.m2 @@ -139,8 +139,8 @@ document { } document { - Key => { (symbol /,Ideal,Function), - (symbol \,Function,Ideal)}, + Key => { (symbol /,LeftIdeal,Function), + (symbol \,Function,LeftIdeal)}, Headline => "apply a function to generators of an ideal", Usage => "I/f\nf\\I", Inputs => { "I","f"}, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc7.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc7.m2 index 8d377f459eb..bd1ad2bbf20 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc7.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc7.m2 @@ -124,7 +124,7 @@ document { SeeAlso => {"leadCoefficient", "leadMonomial", "leadComponent"} } document { - Key => (leadTerm, Ideal), + Key => (leadTerm, LeftIdeal), Headline => "get the ideal of greatest terms", Usage => "leadTerm I", Inputs => {"I"}, @@ -183,7 +183,7 @@ document { SeeAlso => { "selectInSubring" } } document { - Key => (leadTerm, ZZ, Ideal), + Key => (leadTerm, ZZ, LeftIdeal), Headline => "get the ideal of lead polynomials", Usage => "leadTerm(n,I)", Inputs => {"n", "I"}, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 index 91659b1d050..b5e51c4e603 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 @@ -43,7 +43,7 @@ document { } document { - Key => (symbol /, Ideal, Ideal), + Key => (symbol /, LeftIdeal, LeftIdeal), Headline => "quotient module", Usage => "I/J", Inputs => { "I", "J" => {"in the same ring as ", TT "I"}}, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 index 1ecc4fc1658..92beb2f3840 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 @@ -1,6 +1,6 @@ -- -*- coding: utf-8 -*- document { - Key => (symbol _*,Ideal), + Key => (symbol _*,LeftIdeal), Headline => "get the list of generators of an ideal", Usage => "I_*", Inputs => {"I"}, @@ -15,7 +15,13 @@ document { document { Key => Ideal, - Headline => "the class of all ideals", + Headline => "the class of two-sided ideals", + SeeAlso => {"LeftIdeal", "ideals"} + } + +document { + Key => LeftIdeal, + Headline => "the class of left ideals", SeeAlso => "ideals", "For basic information about ideals in ", EM "Macaulay2", ", see ", TO "ideals", ".", @@ -32,16 +38,16 @@ document { }, "Common ways to get information about an ideal:", UL { - TO (generators, Ideal), - TO (symbol _*,Ideal), + TO (generators, LeftIdeal), + TO (symbol _*,LeftIdeal), TO (isSubset, Ideal, Ideal), TO "MinimalPrimes :: isPrime(Ideal)" }, "Common operations on ideals:", UL { - TO (symbol +,Ideal,Ideal), + TO (symbol +,LeftIdeal,LeftIdeal), TO (symbol *,Ideal,Ideal), - TO (symbol ==,Ideal,Ideal), + TO (symbol ==,LeftIdeal,LeftIdeal), TO (symbol ==,Ideal,ZZ), TO (symbol ^,Ideal,ZZ), TO (trim, Ideal) @@ -114,7 +120,7 @@ document { SeeAlso => {"ideals"} } document { - Key => {(symbol +,Ideal,Ideal), + Key => {(symbol +,LeftIdeal,LeftIdeal), (symbol +,Ideal,MonomialIdeal), (symbol +,MonomialIdeal,Ideal) }, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/comodule-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/comodule-doc.m2 index e812afb90dd..a86dbd9e6d2 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/comodule-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/comodule-doc.m2 @@ -4,9 +4,9 @@ document { Key => {comodule, - (comodule, Ideal), + (comodule, LeftIdeal), (comodule, Module), - (quotient, Ideal), + (quotient, LeftIdeal), (quotient, Module) }, Headline => "submodule to quotient module", diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/degreeLength-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/degreeLength-doc.m2 index d81cba6270e..aca3d3067fc 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/degreeLength-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/degreeLength-doc.m2 @@ -4,7 +4,7 @@ undocumented { (degreeLength, Module), - (degreeLength, Ideal), + (degreeLength, LeftIdeal), (degreeLength, InexactField), (degreeLength,PolynomialRing), (degreeLength,QuotientRing), diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/degrees-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/degrees-doc.m2 index d0dcde14e13..a0233f8fcef 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/degrees-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/degrees-doc.m2 @@ -11,7 +11,8 @@ document { (degrees, FractionField), (degrees, Module), (degrees, Monoid), - (degrees, Ideal)}, + (degrees, LeftIdeal), + (degrees, CoherentSheaf)}, Headline => "degrees of generators", Usage => "degrees A", Inputs => {"A" => { ofClass Ring, ", ", ofClass Ideal, ", ", ofClass Module, ", or ", ofClass Monoid } diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/degreesRing-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/degreesRing-doc.m2 index c2d27fff8e7..4d0bc7788bc 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/degreesRing-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/degreesRing-doc.m2 @@ -3,7 +3,7 @@ --- notes: undocumented { - (degreesRing, PolynomialRing), (degreesRing, QuotientRing), (degreesRing, Module), (degreesRing, Ideal), + (degreesRing, PolynomialRing), (degreesRing, QuotientRing), (degreesRing, Module), (degreesRing, LeftIdeal), (degreesMonoid, PolynomialRing), (degreesMonoid, QuotientRing), (degreesMonoid, Module), } diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/generators-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/generators-doc.m2 index 1c8567250d1..1eca448a95e 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/generators-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/generators-doc.m2 @@ -35,10 +35,10 @@ document { } document { - Key => {generator,(generator,Ideal),(generator,Module)}, + Key => {generator,(generator,LeftIdeal),(generator,Module)}, Headline => "provide a single generator", Usage => "generator I", - Inputs => { "I" => {ofClass{Ideal,Module}}}, + Inputs => { "I" => {ofClass{LeftIdeal,Module}}}, Outputs => {{"the single generator of ", TT "I", ", if it has just one"}}, PARA {"If the number of apparent generators is greater than 1, then ", TO "trim", " will be called."}, EXAMPLE lines /// @@ -112,7 +112,7 @@ document { SeeAlso => {monoid} } document { - Key => {(generators, Ideal), + Key => {(generators, LeftIdeal), (generators, MonomialIdeal)}, Headline => "the generator matrix of an ideal", Usage => "generators I\ngens I", diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/ideal-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/ideal-doc.m2 index 1f6c81678ce..0ada00dd9dd 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/ideal-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/ideal-doc.m2 @@ -15,9 +15,12 @@ document { "L" => {"or a ", TO2("Sequence","sequence"), " of ", TO2("RingElement", "ring elements")} }, Outputs => { - Ideal => {"which is generated by the ", TO2("List","list"), " or ", + LeftIdeal => {"which is generated by the ", TO2("List","list"), " or ", TO2("Sequence","sequence"), " of ", TO2("RingElement", "ring elements")} }, + PARA { + "If the input (generators) is in a commutative or skew-commutative ring the type of the output is a (two-sided) ", TO "Ideal","." + }, EXAMPLE { "R = ZZ/101[w,x,y,z];", "ideal{x^2-w*y, x*y-w*z, x*z-y^2}", @@ -37,7 +40,7 @@ document { ideal () promote(oo,R) ///, - SeeAlso => {Ideal, PolynomialRing} + SeeAlso => {LeftIdeal, Ideal, PolynomialRing} } document { Key => (ideal,Matrix), @@ -46,8 +49,11 @@ document { "M" => {"whose ", TO "entries", " are ", TO2("RingElement", "ring elements")} }, Outputs => { - Ideal => {"which is generated by all the entries in ", TT "M"} + LeftIdeal => {"which is generated by all the entries in ", TT "M"} }, + PARA { + "If the input (generators) is in a commutative or skew-commutative ring the type of the output is a (two-sided) ", TO "Ideal","." + }, EXAMPLE { "R = ZZ/7[w,x,y,z];", "f = vars R", @@ -68,8 +74,11 @@ document { "r" }, Outputs => { - Ideal => {"which is generated by the ", TO2("RingElement", "ring element"), " ", TT "r"} + LeftIdeal => {"which is generated by the ", TO2("RingElement", "ring element"), " ", TT "r"} }, + PARA { + "If the input (generator) is in a commutative or skew-commutative ring the type of the output is a (two-sided) ", TO "Ideal","." + }, EXAMPLE { "ideal 7", "R = ZZ/2[x,y];", @@ -101,9 +110,14 @@ document { Outputs => { Ideal => {"which is the defining ideal of ", TT "R"} }, - "A ", TO2("QuotientRing","quotient ring"), " is a the quotient of its ", TO "ambient", - " ", TO2("Ring","ring"), " by its defining ideal. Other rings have no ambient ring, - and the defining ideal is its zero ideal.", + PARA { + "If the input (generators) is in a commutative or skew-commutative ring the type of the output is a (two-sided) ", TO "Ideal","." + }, + PARA { + "A ", TO2("QuotientRing","quotient ring"), " is a the quotient of its ", TO "ambient", + " ", TO2("Ring","ring"), " by its defining ideal. Other rings have no ambient ring, + and the defining ideal is its zero ideal." + }, EXAMPLE { "S = ZZ/2[x,y,z];", "ideal S", @@ -141,7 +155,7 @@ document { "I * ideal I", "I + ideal(x*y+y*z)" }, - SeeAlso => {monomialIdeal, (generators,Ideal)} + SeeAlso => {monomialIdeal, (generators,LeftIdeal)} } document { Key => (ideal,Module), @@ -151,7 +165,7 @@ document { "M" => "which is a submodule of a free module of rank 1" }, Outputs => { - Ideal => {"given by the generators of ", TT "M"} + LeftIdeal => {"given by the generators of ", TT "M"} }, EXAMPLE { "R = QQ[w,x,y,z];", diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/isHomogeneous-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/isHomogeneous-doc.m2 index eae43af934e..27ed869b5f7 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/isHomogeneous-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/isHomogeneous-doc.m2 @@ -19,7 +19,7 @@ document { (isHomogeneous,ChainComplex), (isHomogeneous,RingMap), (isHomogeneous,Vector), - (isHomogeneous,Ideal)}, + (isHomogeneous,LeftIdeal)}, Headline => "whether something is homogeneous (graded)", Usage => "isHomogeneous x", Inputs => { @@ -27,7 +27,7 @@ document { TO RingElement, ", ", TO Vector, ", ", TO Matrix, ", ", - TO Ideal, ", ", + TO LeftIdeal, ", ", TO Module, ", ", TO RingMap, ", ", TO ChainComplex, ", or ", diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/isIdeal-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/isIdeal-doc.m2 index d6fb954b80e..beb9127ad22 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/isIdeal-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/isIdeal-doc.m2 @@ -3,14 +3,14 @@ --- notes: document { - Key => {isIdeal, (isIdeal,Thing), (isIdeal,Module),(isIdeal, Ideal),(isIdeal, MonomialIdeal)}, + Key => {isIdeal, (isIdeal,Thing), (isIdeal,Module),(isIdeal, LeftIdeal),(isIdeal, MonomialIdeal)}, Headline => "whether something is an ideal", Usage => "isIdeal I", Inputs => { "I" => Thing }, Outputs => { - Boolean => {TO "true", " if ", TT "I", " is either an ", TO2("Ideal", "ideal"), + Boolean => {TO "true", " if ", TT "I", " is either an ", TO2("LeftIdeal", "ideal"), ", a ", TO2("MonomialIdeal", "monomial ideal"), " or a ", TO2("Module", "module"), " which is a submodule of a free module of rank 1 with generators in degree 0 and ", TO "false", " otherwise"} diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/numgens-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/numgens-doc.m2 index a742a29214a..1aa1443c7d5 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/numgens-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/numgens-doc.m2 @@ -53,7 +53,7 @@ document { SeeAlso => {monoid} } document { - Key => (numgens,Ideal), + Key => (numgens,LeftIdeal), Headline => "number of generators of an ideal", Usage => "numgens I", Inputs => { diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2 index cfaa8ade0a0..900de39663d 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2 @@ -20,8 +20,8 @@ promote(Vector,type of RingElement) undocumented {(promote,CC,CC_*), (promote, Matrix, InexactNumber),(promote, Number, InexactNumber), - (promote, Ideal, Number), - (promote, Ideal, RingElement), + (promote, LeftIdeal, Number), + (promote, LeftIdeal, RingElement), (promote, List, QQ, CC_*), (promote, List, QQ, QQ), (promote, List, QQ, RR_*), @@ -99,7 +99,7 @@ document { Headline => "promote to another ring", Usage => "promote(f,R)", Inputs => { - "f" => {ofClass{RingElement, Ideal, Matrix}, " over some base ring of R"}, + "f" => {ofClass{RingElement, LeftIdeal, Matrix}, " over some base ring of R"}, "R" => Ring }, Outputs => { diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/ring-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/ring-doc.m2 index 660f463c89e..c81cf5ad104 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/ring-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/ring-doc.m2 @@ -6,8 +6,8 @@ document { Key => {ring, (ring,Vector), (ring,RingElement), (ring,GradedModule), (ring,ChainComplexMap),(ring, GradedModuleMap),(ring, GroebnerBasis),(ring, Number), (ring,Module),(ring,ChainComplex),(ring,Matrix), - (ring,MutableMatrix),(ring,Ideal), (ring,CC),(ring,RR),(ring,RRi),(ring,Resolution), - (ring,MonomialIdeal)}, + (ring,MutableMatrix),(ring,LeftIdeal), (ring,CC),(ring,RR),(ring,RRi),(ring,Resolution), + (ring,CoherentSheaf),(ring,MonomialIdeal)}, Headline => "get the associated ring of an object", Usage => "ring M", Inputs => {"M" => "an object with a ring associated to it"}, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/symbol-underscore-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/symbol-underscore-doc.m2 index 92888e5dd20..30da9213c8a 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/symbol-underscore-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/symbol-underscore-doc.m2 @@ -316,7 +316,7 @@ document { document { Key => {"generators of ideals and modules", - (symbol _, Ideal, ZZ), + (symbol _, LeftIdeal, ZZ), (symbol _, MonomialIdeal, ZZ), (symbol _, Module, ZZ), (symbol _, Matrix, ZZ)}, @@ -325,7 +325,7 @@ document { Heading => "Synopsis", Usage => "L_i", Inputs => { - "L" => ofClass{Ideal,MonomialIdeal,Module,Matrix}, + "L" => ofClass{LeftIdeal,MonomialIdeal,Module,Matrix}, "i" => ZZ }, Outputs => { @@ -442,11 +442,11 @@ document { } document { - Key => {(symbol _, Module, List), (symbol _, Ideal, List)}, + Key => {(symbol _, Module, List), (symbol _, LeftIdeal, List)}, Headline => "map from free module to some generators", Usage => "M_p", Inputs => { - "M" => {"or ", ofClass Ideal}, + "M" => {"or ", ofClass LeftIdeal}, "p" => "of integers" }, Outputs => { @@ -466,7 +466,7 @@ document { source g target g ///, - SeeAlso => { (module, Ideal), (symbol _, Module, ZZ) } + SeeAlso => { (module, LeftIdeal), (symbol _, Module, ZZ) } } document { diff --git a/M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 b/M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 index bf4eee0b669..9743b3d88c7 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 @@ -181,7 +181,7 @@ document { "I*J", "I^2" }, - "For more information see ", TO (symbol+,Ideal,Ideal), ", + "For more information see ", TO (symbol+,LeftIdeal,LeftIdeal), ", ", TO (symbol*,Ideal,Ideal), ", and ", TO (symbol^,Ideal,ZZ), "." } @@ -191,7 +191,7 @@ document { (or quotient of a polynomial ring) is checked by comparing their respective Groebner bases.", SUBSECTION "equal and not equal", - "Use ", TO (symbol==,Ideal,Ideal), " to test if two ideals in + "Use ", TO (symbol==,LeftIdeal,LeftIdeal), " to test if two ideals in the same ring are equal.", EXAMPLE { @@ -236,7 +236,7 @@ document { "S == 0" }, SeeAlso => { - (symbol==,Ideal,Ideal), + (symbol==,LeftIdeal,LeftIdeal), (symbol==,Ideal,ZZ), symbol!=, (symbol%,RingElement,Ideal), diff --git a/M2/Macaulay2/packages/MultiprojectiveVarieties.m2 b/M2/Macaulay2/packages/MultiprojectiveVarieties.m2 index 50440e6ba50..0d949eafd7d 100644 --- a/M2/Macaulay2/packages/MultiprojectiveVarieties.m2 +++ b/M2/Macaulay2/packages/MultiprojectiveVarieties.m2 @@ -2733,7 +2733,7 @@ EXAMPLE {"O = 0_(PP_(ZZ/101)^{2,1});", "X = random({2,1},O);", "Y = random({1,1},O);", "X * Y"}, -SeeAlso => {(symbol +,MultiprojectiveVariety,MultiprojectiveVariety),(symbol +,Ideal,Ideal),(⋂,List)}} +SeeAlso => {(symbol +,MultiprojectiveVariety,MultiprojectiveVariety),(symbol +,LeftIdeal,LeftIdeal),(⋂,List)}} document {Key => {⋂,(⋂,List)}, Headline => "intersection of multi-projective varieties", diff --git a/M2/Macaulay2/packages/Varieties/euler-doc.m2 b/M2/Macaulay2/packages/Varieties/euler-doc.m2 index b5d8b78e83c..9dcfb1db3e3 100644 --- a/M2/Macaulay2/packages/Varieties/euler-doc.m2 +++ b/M2/Macaulay2/packages/Varieties/euler-doc.m2 @@ -86,9 +86,9 @@ document { } document { - Key => (euler,Ideal), + Key => (euler,LeftIdeal), "This needs to be documented.", - SeeAlso => {(eulers,Ideal),genus} + SeeAlso => {(eulers,LeftIdeal),genus} } document { @@ -130,7 +130,7 @@ document { SeeAlso => {genera,genus} } document { - Key => (eulers,Ideal), + Key => (eulers,LeftIdeal), Usage => "eulers I", Inputs => {"I" }, diff --git a/M2/Macaulay2/packages/Varieties/genera-doc.m2 b/M2/Macaulay2/packages/Varieties/genera-doc.m2 index 3565855f714..69c253271e4 100644 --- a/M2/Macaulay2/packages/Varieties/genera-doc.m2 +++ b/M2/Macaulay2/packages/Varieties/genera-doc.m2 @@ -47,7 +47,7 @@ document { SeeAlso => {euler} } document { - Key => (genera,Ideal), + Key => (genera,LeftIdeal), Usage => "genera I", Inputs => {"I" }, diff --git a/M2/Macaulay2/packages/Varieties/genus-doc.m2 b/M2/Macaulay2/packages/Varieties/genus-doc.m2 index d355fede049..ae1622854f5 100644 --- a/M2/Macaulay2/packages/Varieties/genus-doc.m2 +++ b/M2/Macaulay2/packages/Varieties/genus-doc.m2 @@ -8,9 +8,9 @@ document { SeeAlso => {genera, euler} } document { - Key => {(genus,CoherentSheaf),(genus,Module),(genus, Ideal)}, + Key => {(genus,CoherentSheaf),(genus,Module),(genus, LeftIdeal)}, Usage => "genus F", - Inputs => {"F" => {ofClass{CoherentSheaf,Module,Ideal} }}, + Inputs => {"F" => {ofClass{CoherentSheaf,Module,LeftIdeal} }}, Outputs => {ZZ }, "Computes the arithmetic genus of the coherent sheaf ", TT "F", " that is (-1)^dim-support * (chi(F) - 1)). If ", TT "F", " is a module over a ring, then the genus of ", TT "F~", " is computed. If ", TT "I", " is an ideal in a ring ", TT "R", " then the genus of ", TT "(R/I)~", " is From 87f0f2794552f84cd7a7c3d5f8adf14d64f0048d Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Tue, 3 Oct 2023 12:32:54 -0400 Subject: [PATCH 02/14] LeftIdeal update: more packages install now; checks pass for Dmodules, but not for BernsteinSato yet --- M2/Macaulay2/m2/gb.m2 | 2 +- M2/Macaulay2/m2/intersect.m2 | 12 ++--- M2/Macaulay2/m2/matrix2.m2 | 12 ++--- M2/Macaulay2/m2/modules2.m2 | 10 ++-- M2/Macaulay2/m2/newring.m2 | 14 ++++-- M2/Macaulay2/m2/ringmap.m2 | 12 ++--- .../BernsteinSato/DOC/Drestriction.m2 | 4 +- .../packages/BernsteinSato/DOC/bFunctions.m2 | 8 ++-- .../packages/BernsteinSato/Dresolution.m2 | 6 +-- .../packages/BernsteinSato/bFunction.ideal.m2 | 6 +-- .../packages/BernsteinSato/globalBFunction.m2 | 8 ++-- .../packages/BernsteinSato/localBFunction.m2 | 8 ++-- .../packages/WeylAlgebras/DOC/basics.m2 | 46 +++++++++---------- M2/Macaulay2/packages/WeylAlgebras/Dbasic.m2 | 17 +++---- M2/Macaulay2/packages/WeylAlgebras/Gbw.m2 | 8 ++-- .../packages/WeylAlgebras/TST/Dbasic.m2 | 7 +-- .../packages/WeylAlgebras/makeCyclic.m2 | 2 +- .../packages/WeylAlgebras/stafford.m2 | 6 +-- 18 files changed, 95 insertions(+), 93 deletions(-) diff --git a/M2/Macaulay2/m2/gb.m2 b/M2/Macaulay2/m2/gb.m2 index 64e7f7200c4..21872a87040 100644 --- a/M2/Macaulay2/m2/gb.m2 +++ b/M2/Macaulay2/m2/gb.m2 @@ -304,7 +304,7 @@ degreeToHeft = (R, d) -> ( ----------------------------------------------------------------------------- gb = method(TypicalValue => GroebnerBasis, Options => gbDefaults) -gb Ideal := GroebnerBasis => opts -> I -> gb (module I, opts) +gb LeftIdeal := GroebnerBasis => opts -> I -> gb (module I, opts) gb Module := GroebnerBasis => opts -> M -> ( if M.?relations then ( if not M.cache#?"full gens" then M.cache#"full gens" = generators M | relations M; diff --git a/M2/Macaulay2/m2/intersect.m2 b/M2/Macaulay2/m2/intersect.m2 index 197adf05efc..ddd751f475a 100644 --- a/M2/Macaulay2/m2/intersect.m2 +++ b/M2/Macaulay2/m2/intersect.m2 @@ -68,7 +68,7 @@ moduleIntersectOpts := { } -- ideally this should be unnecessary, but some code seems to depend on this -intersect Ideal := Ideal => idealIntersectOpts >> opts -> I -> doTrim(opts, I) +intersect LeftIdeal := LeftIdeal => idealIntersectOpts >> opts -> I -> doTrim(opts, I) intersect Module := Module => moduleIntersectOpts >> opts -> M -> doTrim(opts, M) -- intersect is a MethodFunctionBinary, so arbitrary lists @@ -77,12 +77,12 @@ intersect Module := Module => moduleIntersectOpts >> opts -> M -> doTrim(opts, M -- installing a method (intersect, S, T) => T enables intersect(S, T, T, ...) -- installing a method (intersect, S, S) => S enables intersect(S, S, T, T, ...) -- installing a method (intersect, T, S) => S enables intersect(S, T, S, T, ...) -intersect(Ideal, Ideal) := Ideal => idealIntersectOpts >> opts -> L -> intersectHelper(L, (intersect, Ideal, Ideal), opts) +intersect(LeftIdeal, LeftIdeal) := LeftIdeal => idealIntersectOpts >> opts -> L -> intersectHelper(L, (intersect, LeftIdeal, LeftIdeal), opts) intersect(Module, Module) := Module => moduleIntersectOpts >> opts -> L -> intersectHelper(L, (intersect, Module, Module), opts) -- Specializations for intersecting many objects at once, e.g. Modules, -- can be installed on (symbol intersect, T), which calls T.intersect -Ideal.intersect = idealIntersectOpts >> opts -> L -> intersectHelper(L, (intersect, Ideal, Ideal), opts) +LeftIdeal.intersect = idealIntersectOpts >> opts -> L -> intersectHelper(L, (intersect, LeftIdeal, LeftIdeal), opts) Module.intersect = moduleIntersectOpts >> opts -> L -> intersectHelper(L, (intersect, Module, Module), opts) ----------------------------------------------------------------------------- @@ -112,7 +112,7 @@ scan({Default}, strategy -> ----------------------------------------------------------------------------- -algorithms#(intersect, Ideal, Ideal) = new MutableHashTable from { +algorithms#(intersect, LeftIdeal, LeftIdeal) = new MutableHashTable from { Default => (opts, L) -> ideal intersect(opts, apply(L, module)), -- TODO: can this be extended to do more than 2 at once? @@ -145,6 +145,6 @@ algorithms#(intersect, Ideal, Ideal) = new MutableHashTable from { newMonomialIdeal(R, rawIntersect(raw monomialIdeal I, raw monomialIdeal J)))), } --- Installing hooks for intersect(Ideal, Ideal) +-- Installing hooks for intersect(LeftIdeal, LeftIdeal) scan({Default, "Elimination", Monomial}, strategy -> - addHook(key := (intersect, Ideal, Ideal), algorithms#key#strategy, Strategy => strategy)) + addHook(key := (intersect, LeftIdeal, LeftIdeal), algorithms#key#strategy, Strategy => strategy)) diff --git a/M2/Macaulay2/m2/matrix2.m2 b/M2/Macaulay2/m2/matrix2.m2 index 8bd42f69535..077664457ea 100644 --- a/M2/Macaulay2/m2/matrix2.m2 +++ b/M2/Macaulay2/m2/matrix2.m2 @@ -136,7 +136,7 @@ complement Matrix := Matrix => (f) -> ( else error "complement: expected matrix over affine ring or finitely generated ZZ-algebra") -- the method is declared in gb.m2 -mingens Ideal := Matrix => opts -> I -> mingens(module I, opts) +mingens LeftIdeal := Matrix => opts -> I -> mingens(module I, opts) mingens Module := Matrix => opts -> (cacheValue symbol mingens) ((M) -> ( c := runHooks((mingens, Module), (opts, M)); if c =!= null then c else error "mingens: no method implemented for this type of module")) @@ -175,7 +175,7 @@ trim QuotientRing := opts -> (R) -> ( A/(trim(ideal f,opts))) -- TODO: why is the caching key an Option? -trim Ideal := Ideal => opts -> (cacheValue (symbol trim => opts)) ((I) -> ideal trim(module I, opts)) +trim LeftIdeal := LeftIdeal => opts -> (cacheValue (symbol trim => opts)) ((I) -> ideal trim(module I, opts)) trim Module := Module => opts -> (cacheValue symbol trim) (M -> ( if isFreeModule M then return M; c := runHooks((trim, Module), (opts, M)); @@ -405,12 +405,12 @@ RingElement % Matrix := (r,f) -> ( else error "expected target of matrix to be free, and of rank 1" ) -RingElement % Ideal := (r,I) -> ( +RingElement % LeftIdeal := (r,I) -> ( R := ring I; if ring r =!= R then error "expected ring element and ideal for the same ring"; if r == 0 then return r; r % if isHomogeneous I and heft R =!= null then gb(I, DegreeLimit => degree r) else gb I) -Number % Ideal := (r,I) -> ( +Number % LeftIdeal := (r,I) -> ( R := ring I; r = promote(r,R); if r == 0 then return r; @@ -441,7 +441,7 @@ support = method() support RingElement := support Matrix := (f) -> ( x := rawIndices raw f; apply(x, i -> (ring f)_i)) -support Ideal := (I) -> rsort toList sum apply(flatten entries generators I, f -> set support f) +support LeftIdeal := (I) -> rsort toList sum apply(flatten entries generators I, f -> set support f) -------------------- -- homogenization -- -------------------- @@ -489,7 +489,7 @@ homogenize(Module,RingElement) := Module => (M,z) -> ( if M.?generators then homogenize(generators gb M.generators,z), if M.?relations then homogenize(generators gb M.relations,z))) -homogenize(Ideal,RingElement) := Ideal => (I,z) -> ideal homogenize(module I, z) +homogenize(LeftIdeal,RingElement) := LeftIdeal => (I,z) -> ideal homogenize(module I, z) homogenize(Module,RingElement,List) := Module => (M,z,wts) -> ( if isFreeModule M then M diff --git a/M2/Macaulay2/m2/modules2.m2 b/M2/Macaulay2/m2/modules2.m2 index 1dc3a660a14..78738d2d6fc 100644 --- a/M2/Macaulay2/m2/modules2.m2 +++ b/M2/Macaulay2/m2/modules2.m2 @@ -114,8 +114,8 @@ issub := (f, g) -> ( -- TODO: we can do better in the homogeneous case! addHook(ContainmentHooks, Strategy => Inhomogeneous, (f, g) -> -1 === rawGBContains(raw gb g, raw f)) -ZZ == Ideal := (n,I) -> I == n -Ideal == ZZ := (I,n) -> ( +ZZ == LeftIdeal := (n,I) -> I == n +LeftIdeal == ZZ := (I,n) -> ( if n === 0 then I.generators == 0 else if n === 1 @@ -367,9 +367,9 @@ isSubset(Module,Module) := (M,N) -> ( false ) ) -isSubset(Ideal,Ideal) := (I,J) -> isSubset(module I, module J) -isSubset(Module,Ideal) := (M,J) -> isSubset(M, module J) -isSubset(Ideal,Module) := (I,N) -> isSubset(module I, N) +isSubset(LeftIdeal,LeftIdeal) := (I,J) -> isSubset(module I, module J) +isSubset(Module,LeftIdeal) := (M,J) -> isSubset(M, module J) +isSubset(LeftIdeal,Module) := (I,N) -> isSubset(module I, N) -- Local Variables: -- compile-command: "make -C $M2BUILDDIR/Macaulay2/m2 " diff --git a/M2/Macaulay2/m2/newring.m2 b/M2/Macaulay2/m2/newring.m2 index 3e7a79e6d38..9194f7f237f 100644 --- a/M2/Macaulay2/m2/newring.m2 +++ b/M2/Macaulay2/m2/newring.m2 @@ -62,7 +62,13 @@ QuotientRing ** PolynomialRing := PolynomialRing ** QuotientRing := QuotientRing ** QuotientRing := (R,S) -> tensor(R,S) -tensor(PolynomialRing, PolynomialRing) := +tensor(PolynomialRing, PolynomialRing) := monoidTensorDefaults >> optns -> (R, S) -> ( + k := coefficientRing R; + if k =!= coefficientRing S + then error "expected rings to have the same coefficient ring"; + k tensor(monoid R, monoid S, optns) + ) + tensor(QuotientRing, PolynomialRing) := tensor(PolynomialRing, QuotientRing) := tensor(QuotientRing, QuotientRing) := monoidTensorDefaults >> optns -> (R, S) -> ( @@ -71,11 +77,11 @@ tensor(QuotientRing, QuotientRing) := monoidTensorDefaults >> optns -> (R, S) then error "expected rings to have the same coefficient ring"; f := presentation R; A := ring f; M := monoid A; m := numgens M; g := presentation S; B := ring g; N := monoid B; n := numgens N; - AB := k tensor(M, N, optns); - fg := substitute(f,(vars AB)_{0 .. m-1}) | substitute(g,(vars AB)_{m .. m+n-1}); + MN := k tensor(M, N, optns); + fg := substitute(f,(vars MN)_{0 .. m-1}) | substitute(g,(vars MN)_{m .. m+n-1}); -- forceGB fg; -- if the monomial order chosen doesn't restrict, then this -- is an error!! MES - if isPolynomialRing A and isPolynomialRing B then AB else AB/image fg + MN/image fg ) ------------------------- diff --git a/M2/Macaulay2/m2/ringmap.m2 b/M2/Macaulay2/m2/ringmap.m2 index b26c8a18462..1a865c48ee2 100644 --- a/M2/Macaulay2/m2/ringmap.m2 +++ b/M2/Macaulay2/m2/ringmap.m2 @@ -197,7 +197,7 @@ RingMap Vector := Vector => (p,m) -> ( f := p new Matrix from m; new target f from f) -RingMap Ideal := Ideal => (f, I) -> ideal f module I +RingMap LeftIdeal := LeftIdeal => (f, I) -> ideal f module I RingMap Module := Module => (f, M) -> ( (S, R) := (target f, source f); if R =!= ring M then error "expected module over source ring"; @@ -413,18 +413,18 @@ substitute(RingElement,Matrix) := RingElement => (r,f) -> (map(ring f,ring r,f)) substitute(Vector,Matrix) := Vector => (v,f) -> (map(ring f,ring v,f)) v substitute(Matrix,Matrix) := Matrix => (m,f) -> (map(ring f,ring m,f)) m substitute(Module,Matrix) := Module => (M,f) -> (map(ring f,ring M,f)) M -substitute(Ideal,Matrix) := Ideal => (I,f) -> (map(ring f,ring I,f)) I +substitute(LeftIdeal,Matrix) := LeftIdeal => (I,f) -> (map(ring f,ring I,f)) I substitute(Matrix,Ring) := Matrix => (m,S) -> (map(S,ring m)) m substitute(Module,Ring) := Module => (M,S) -> (map(S,ring M)) M -substitute(Ideal,Ring) := Ideal => (I,S) -> (map(S,ring I)) I +substitute(LeftIdeal,Ring) := LeftIdeal => (I,S) -> (map(S,ring I)) I substitute(Vector,Ring) := Vector => (v,S) -> (map(S,ring v)) v substitute(Number,Ring) := substitute(RingElement,Ring) := RingElement => (r,S) -> (map(S,ring r)) r substitute(Matrix,RingFamily) := Matrix => (m,S) -> substitute(m, default S) substitute(Module,RingFamily) := Module => (M,S) -> substitute(M, default S) -substitute(Ideal,RingFamily) := Ideal => (I,S) -> substitute(I, default S) +substitute(LeftIdeal,RingFamily) := LeftIdeal => (I,S) -> substitute(I, default S) substitute(Vector,RingFamily) := Vector => (v,S) -> substitute(v, default S) substitute(Number,RingFamily) := substitute(RingElement,RingFamily) := RingElement => (r,S) -> substitute(r, default S) @@ -493,13 +493,13 @@ sub2 = (S,R,v) -> ( -- S is the target ring or might be null, meaning targ substitute(Matrix,List) := Matrix => (f,v) -> (sub2(,ring f,v)) f substitute(Module,List) := Module => (M,v) -> (sub2(,ring M,v)) M -substitute(Ideal,List) := Ideal => (I,v) -> (sub2(,ring I,v)) I +substitute(LeftIdeal,List) := LeftIdeal => (I,v) -> (sub2(,ring I,v)) I substitute(Vector,List) := Vector => (f,v) -> (sub2(,ring f,v)) f substitute(RingElement,List) := RingElement => (f,v) -> (sub2(,ring f,v)) f substitute(Matrix,Option) := (f,v) -> (sub2(,ring f,{v})) f substitute(Module,Option) := (M,v) -> (sub2(,ring M,{v})) M -substitute(Ideal,Option) := (I,v) -> (sub2(,ring I,{v})) I +substitute(LeftIdeal,Option) := (I,v) -> (sub2(,ring I,{v})) I substitute(Vector,Option) := (f,v) -> (sub2(,ring f,{v})) f substitute(RingElement,Option) := (f,v) -> (sub2(,ring f,{v})) f diff --git a/M2/Macaulay2/packages/BernsteinSato/DOC/Drestriction.m2 b/M2/Macaulay2/packages/BernsteinSato/DOC/Drestriction.m2 index e06b9943426..fd870b58ece 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DOC/Drestriction.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DOC/Drestriction.m2 @@ -24,8 +24,8 @@ document { } document { - Key => {Dresolution, (Dresolution,Module), (Dresolution,Ideal,List), - (Dresolution,Module,List), (Dresolution,Ideal)}, + Key => {Dresolution, (Dresolution,Module), (Dresolution,LeftIdeal,List), + (Dresolution,Module,List), (Dresolution,LeftIdeal)}, Headline => "resolution of a D-module", Usage => "Dresolution M, Dresolution I, Dresolution(M,w), Dresolution(I,w)", Inputs => { diff --git a/M2/Macaulay2/packages/BernsteinSato/DOC/bFunctions.m2 b/M2/Macaulay2/packages/BernsteinSato/DOC/bFunctions.m2 index a96e2d72440..464fe12b545 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DOC/bFunctions.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DOC/bFunctions.m2 @@ -2,7 +2,7 @@ document { Key => bFunction, Headline => "b-function", UL { - {TO (bFunction, Ideal,List), " - for an ideal"}, + {TO (bFunction, LeftIdeal,List), " - for an ideal"}, {TO (bFunction, Module,List,List), " - for a module"} } } @@ -40,7 +40,7 @@ document { } document { - Key => (bFunction, Ideal, List), + Key => (bFunction, LeftIdeal, List), Headline => "b-function of an ideal", Usage => "b = bFunction(I,w)", Inputs => { @@ -310,7 +310,7 @@ document { } document { - Key => {(globalB, Ideal, RingElement), globalB}, + Key => {(globalB, LeftIdeal, RingElement), globalB}, Headline => "compute global b-function and b-operator for a D-module and a polynomial", Usage => "H = globalB(I,f)", @@ -350,7 +350,7 @@ document { } document { - Key => {(localBFunction,RingElement,Ideal), localBFunction}, + Key => {(localBFunction,RingElement,LeftIdeal), localBFunction}, Headline => "local b-function (a.k.a. the local Bernstein-Sato polynomial)", Usage => "b = localBFunction(f,P)", Inputs => { diff --git a/M2/Macaulay2/packages/BernsteinSato/Dresolution.m2 b/M2/Macaulay2/packages/BernsteinSato/Dresolution.m2 index b5f38ac6ac4..13f3c81a3ae 100644 --- a/M2/Macaulay2/packages/BernsteinSato/Dresolution.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/Dresolution.m2 @@ -63,7 +63,7 @@ kerGB := m -> ( -------------------------------------------------------------------------------- Dresolution = method( Options => {Strategy => Schreyer, LengthLimit => infinity} ) -Dresolution Ideal := options -> I -> Dresolution(comodule I, options) +Dresolution LeftIdeal := options -> I -> Dresolution(comodule I, options) Dresolution Module := options -> M -> ( pInfo (1, "ENTERING Dresolution ... "); @@ -100,9 +100,7 @@ Dresolution Module := options -> M -> ( M.cache.resolution ) -Dresolution (Ideal, List) := options -> (I, w) -> ( - Dresolution ((ring I)^1/I, w, options) - ) +Dresolution (LeftIdeal, List) := options -> (I, w) -> Dresolution ((ring I)^1/I, w, options) Dresolution (Module, List) := options -> (M, w) -> ( diff --git a/M2/Macaulay2/packages/BernsteinSato/bFunction.ideal.m2 b/M2/Macaulay2/packages/BernsteinSato/bFunction.ideal.m2 index 09a8d60f1fb..bc38f61ad1f 100644 --- a/M2/Macaulay2/packages/BernsteinSato/bFunction.ideal.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/bFunction.ideal.m2 @@ -40,7 +40,7 @@ makeQQ := f -> ( -- trivial intersection strategy (internal) bfIntRing := method() -bfIntRing(Ideal, List) := (I, w) -> ( +bfIntRing(LeftIdeal, List) := (I, w) -> ( local tInfo; -- prep work if not (ring I).?IntRing then @@ -91,7 +91,7 @@ bfIntRing(Ideal, List) := (I, w) -> ( -- TryGeneric or NonGeneric strategy (internal) bfGenericOrNonGeneric := method(Options => {Strategy => TryGeneric}) -bfGenericOrNonGeneric(Ideal, List) := o -> (I, w) -> ( +bfGenericOrNonGeneric(LeftIdeal, List) := o -> (I, w) -> ( local tInfo; -- prep work if not (ring I).?ThetaRing then @@ -195,7 +195,7 @@ bfGenericOrNonGeneric(Ideal, List) := o -> (I, w) -> ( makeQQ bfcn ); -bFunction(Ideal, List) := RingElement => o -> (I, w) -> ( +bFunction(LeftIdeal, List) := RingElement => o -> (I, w) -> ( result := ( if o.Strategy == IntRing then bfIntRing(I, w) else if o.Strategy == TryGeneric or o.Strategy == NonGeneric diff --git a/M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 b/M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 index 35096086649..12ebed03374 100644 --- a/M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 @@ -20,7 +20,7 @@ makeMonic := f -> ( if coefficientRing ring f === QQ -- also used in multiplierIdeals.m2 star = method() -star (Ideal,List) := (I,vw) -> ( +star (LeftIdeal,List) := (I,vw) -> ( W := ring I; n := numgens W; u := symbol u; @@ -116,7 +116,7 @@ globalRBAnnFs (RingElement,Ideal,Boolean) := RingElement => (f,AnnI,isRed) -> ( -------------------------------------------------------------------------------- globalB = method() -globalB(Ideal, RingElement) := HashTable => (I, f) -> ( +globalB(LeftIdeal, RingElement) := HashTable => (I, f) -> ( W := ring I; AnnI := AnnIFs (I,f); Ws := ring AnnI; @@ -210,10 +210,10 @@ generalB (List, RingElement) := RingElement => o->(F,g) -> ( inw(intersect(AnnI, ideal sub(g, DY)), -w|w) ) else if m===null and o.Strategy===StarIdeal then ( - star(AnnI,-w|w) + sub(g*ideal F,DY) + star(AnnI,-w|w) + sub(ideal(g*F),DY) ) else if m=!=null then ( - star(AnnI,-w|w) + (sub(ideal F, DY))^m + star(AnnI,-w|w) + ideal symmetricPower(m, gens sub(ideal F, DY)) ) else error "uknwnown Strategy"; diff --git a/M2/Macaulay2/packages/BernsteinSato/localBFunction.m2 b/M2/Macaulay2/packages/BernsteinSato/localBFunction.m2 index e4d904468a1..099f8fdabbc 100644 --- a/M2/Macaulay2/packages/BernsteinSato/localBFunction.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/localBFunction.m2 @@ -1,7 +1,7 @@ -- internal, also used in multiplierIdeals.m2 -- TODO: move to Dbasic? eliminateWA = method() -eliminateWA(Ideal, List) := Ideal => (I, v) -> ( +eliminateWA(LeftIdeal, List) := LeftIdeal => (I, v) -> ( R := ring I; if not isSubset(v, gens R) then error "expected generators of the ring"; w := apply(gens R, g -> if member(g, v) then 1 else 0); @@ -17,7 +17,7 @@ protect s -- is this right? should s be visible to the user? -- internal computeJf = method() -computeJf RingElement := Ideal => f -> ( +computeJf RingElement := LeftIdeal => f -> ( if #(options (ring f).monoid)#WeylAlgebra > 0 -- isWA then ( D := ring f; @@ -87,7 +87,7 @@ exceptionalLocusB (RingElement,RingElement) := RingElement => o -> (f,b) -> ( protect ColonIdeal -- this version performs the computation given (ring f, I3, b) -exceptionalLocusB (Ring,Ideal,RingElement) := RingElement => o -> (R,I3,b) -> ( +exceptionalLocusB (Ring,LeftIdeal,RingElement) := RingElement => o -> (R,I3,b) -> ( Rs := ring I3; K := coefficientRing Rs; s := Rs_0; @@ -176,7 +176,7 @@ localBFunctionStrata RingElement := HashTable => f -> ( ) localBFunction = method(TypicalValue => RingElement) -localBFunction (RingElement,Ideal) := RingElement => (f,P) -> ( +localBFunction (RingElement,LeftIdeal) := RingElement => (f,P) -> ( if ring f =!= ring P then error "same ring for polynomial and ideal expected"; R := ring f; D := makeWeylAlgebra(R,SetVariables=>false); diff --git a/M2/Macaulay2/packages/WeylAlgebras/DOC/basics.m2 b/M2/Macaulay2/packages/WeylAlgebras/DOC/basics.m2 index 7eb776a0262..12cd2c7288f 100644 --- a/M2/Macaulay2/packages/WeylAlgebras/DOC/basics.m2 +++ b/M2/Macaulay2/packages/WeylAlgebras/DOC/basics.m2 @@ -1,7 +1,7 @@ doc /// Key gbw - (gbw, Ideal, List) + (gbw, LeftIdeal, List) (gbw, Matrix, List) [gbw, Strategy] Headline @@ -10,7 +10,7 @@ doc /// gbI = gbw(I, w) gbM = gbw(M, w) Inputs - I:Ideal + I:LeftIdeal in the Weyl algebra M:Matrix with entries in the Weyl algebra @@ -19,7 +19,7 @@ doc /// Strategy=>Thing if set to @TT "homogenize"@ the input is homogenized in the homogeneous Weyl algebra Outputs - gbI:Ideal + gbI:LeftIdeal with the generators forming a Gröbner basis of the ideal with respect to the weight vector gbM:Matrix with the columns forming a Gröbner basis of the submodule generated by the columns of the @@ -54,7 +54,7 @@ doc /// inw (inw, Matrix, List) (inw, RingElement, List) - (inw, Ideal, List) + (inw, LeftIdeal, List) Headline get the initial term or ideal with respect to a weight vector Usage @@ -63,14 +63,14 @@ doc /// inM = inw(M, w) Inputs F:RingElement - I:Ideal + I:LeftIdeal M:Matrix w:List of weights Outputs inF:RingElement the initial form of @EM "F"@ with respect to the weight vector - inI:Ideal + inI:LeftIdeal the initial ideal of @EM "I"@ with respect to the weight vector inM:Matrix with the columns generating the initial module of the image of @EM "M"@ with respect to the weight vector @@ -113,12 +113,12 @@ doc /// Fourier (Fourier,Matrix) (Fourier,RingElement) - (Fourier,Ideal) + (Fourier,LeftIdeal) (Fourier,Module) (Fourier,ChainComplex) FourierInverse (FourierInverse, ChainComplex) - (FourierInverse, Ideal) + (FourierInverse, LeftIdeal) (FourierInverse, Matrix) (FourierInverse, Module) (FourierInverse, RingElement) @@ -128,10 +128,10 @@ doc /// Fourier A FourierInverse A Inputs - A:{Matrix, RingElement, Ideal, ChainComplex} + A:{Matrix, RingElement, LeftIdeal, ChainComplex} over the Weyl algebra Outputs - :{Matrix, RingElement, Ideal, ChainComplex} + :{Matrix, RingElement, LeftIdeal, ChainComplex} the Fourier transform of @TT "A"@ as a matrix, function, ideal, or chain complex over the Weyl algebra Description Text @@ -184,7 +184,7 @@ doc /// Key Dtransposition (Dtransposition,Matrix) - (Dtransposition,Ideal) + (Dtransposition,LeftIdeal) (Dtransposition,ChainComplex) (Dtransposition,RingElement) Headline @@ -247,16 +247,16 @@ doc /// doc /// Key stafford - (stafford, Ideal) + (stafford, LeftIdeal) Headline computes 2 generators for a given ideal in the Weyl algebra Usage stafford I Inputs - I:Ideal + I:LeftIdeal of the Weyl algebra Outputs - :Ideal + :LeftIdeal with 2 generators (that has the same extension as I in k(x)) Description Text @@ -282,7 +282,7 @@ doc /// Key isHolonomic (isHolonomic, Module) - (isHolonomic, Ideal) + (isHolonomic, LeftIdeal) Headline determines whether a D-module (or ideal in Weyl algebra) is holonomic Usage @@ -319,7 +319,7 @@ doc /// Key DsingularLocus (DsingularLocus,Module) - (DsingularLocus,Ideal) + (DsingularLocus,LeftIdeal) Headline singular locus of a D-module Usage @@ -328,10 +328,10 @@ doc /// Inputs M:Module over the Weyl algebra @EM "D"@ - I:Ideal + I:LeftIdeal which represents the module @EM "M = D/I"@ Outputs - :Ideal + :LeftIdeal the singular locus of @EM "M"@ Description Text @@ -357,7 +357,7 @@ doc /// doc /// Key characteristicIdeal - (characteristicIdeal,Ideal) + (characteristicIdeal,LeftIdeal) (characteristicIdeal,Module) Headline characteristic ideal of a D-module @@ -366,10 +366,10 @@ doc /// Inputs M:Module over the Weyl algebra @EM "D"@ - I:Ideal + I:LeftIdeal which represents the module @EM "M = D/I"@ Outputs - :Ideal + :LeftIdeal the characteristic ideal of @EM "M"@ Description Text @@ -408,7 +408,7 @@ doc /// Key holonomicRank (holonomicRank,Module) - (holonomicRank,Ideal) + (holonomicRank,LeftIdeal) Headline holonomic rank of a D-module Usage @@ -461,7 +461,7 @@ doc /// doc /// Key Ddim - (Ddim,Ideal) + (Ddim,LeftIdeal) (Ddim,Module) Headline dimension of a D-module diff --git a/M2/Macaulay2/packages/WeylAlgebras/Dbasic.m2 b/M2/Macaulay2/packages/WeylAlgebras/Dbasic.m2 index c297a8599be..113ab7b2203 100644 --- a/M2/Macaulay2/packages/WeylAlgebras/Dbasic.m2 +++ b/M2/Macaulay2/packages/WeylAlgebras/Dbasic.m2 @@ -121,7 +121,7 @@ createCommAlgebra PolynomialRing := W -> ( -- These routines compute the Fourier transform which is the automorphism -- of the Weyl algebra sending x -> -dx, dx -> x. --- Input: RingElement f, Matrix m, Ideal I, ChainComplex C, or Module M +-- Input: RingElement f, Matrix m, LeftIdeal I, ChainComplex C, or Module M -- Output: Fourier transform of f, m, I, C, or M Fourier = method() FourierLocal := M -> ( @@ -145,7 +145,7 @@ FourierLocal := M -> ( FMap M ) Fourier RingElement := M -> (FourierLocal M) -Fourier Ideal := M -> (FourierLocal M) +Fourier LeftIdeal := M -> (FourierLocal M) Fourier Matrix := M -> (FourierLocal M) Fourier ChainComplex := M -> (FourierLocal M) Fourier Module := M -> (cokernel FourierLocal relations prune M) @@ -172,7 +172,7 @@ FourierInverseLocal := M -> ( FInvMap M ) FourierInverse RingElement := M -> (FourierInverseLocal M) -FourierInverse Ideal := M -> (FourierInverseLocal M) +FourierInverse LeftIdeal := M -> (FourierInverseLocal M) FourierInverse Matrix := M -> (FourierInverseLocal M) FourierInverse ChainComplex := M -> (FourierInverseLocal M) FourierInverse Module := M -> (cokernel FourierInverseLocal relations prune M) @@ -214,7 +214,7 @@ Dtransposition Matrix := m -> ( mtrans ) -Dtransposition Ideal := I -> ( +Dtransposition LeftIdeal := I -> ( ideal Dtransposition gens I ) @@ -236,7 +236,7 @@ Dtransposition ChainComplex := C -> ( -- This routine computes the dimension of a D-module Ddim = method() -Ddim Ideal := (cacheValue Ddim) (I -> ( +Ddim LeftIdeal := (cacheValue Ddim) (I -> ( -- preprocessing W := ring I; -- error checking @@ -269,7 +269,7 @@ addHook((codim, Module), Strategy => WeylAlgebra, -- This routine determines whether a D-module is holonomic isHolonomic = method() -isHolonomic Ideal := I -> ( +isHolonomic LeftIdeal := I -> ( -- preprocessing W := ring I; -- error checking @@ -296,10 +296,7 @@ isHolonomic Module := M -> ( -- This routine computes the rank of a D-module -- QUESTION: this changes the current ring? holonomicRank = method() -holonomicRank Ideal := I -> ( - holonomicRank ((ring I)^1/I) - ) - +holonomicRank LeftIdeal := I -> holonomicRank cokernel gens I holonomicRank Module := M -> ( W := ring M; createDpairs W; diff --git a/M2/Macaulay2/packages/WeylAlgebras/Gbw.m2 b/M2/Macaulay2/packages/WeylAlgebras/Gbw.m2 index 80010b6b3db..d59e8e5dbde 100644 --- a/M2/Macaulay2/packages/WeylAlgebras/Gbw.m2 +++ b/M2/Macaulay2/packages/WeylAlgebras/Gbw.m2 @@ -22,7 +22,7 @@ inw (RingElement, List) := (L, w) -> ( mw := max apply(lf,t->sum(#w,i->t#0#i*w#i)); part(mw,w,L) ) -inw(Ideal, List) := (I, w) -> ideal inw(gens I, w) +inw(LeftIdeal, List) := (I, w) -> ideal inw(gens I, w) inw(Matrix, List) := (m, w) -> ( -- preprocessing W := ring m; @@ -120,7 +120,7 @@ inw(Matrix, List) := (m, w) -> ( -- this routine computes a grobner basis of an ideal or matrix with respect -- a weight vector w. gbw = method(Options => { Strategy => null }) -gbw(Ideal, List) := opts -> (I, w) -> ideal gbw(gens I, w, opts) +gbw(LeftIdeal, List) := opts -> (I, w) -> ideal gbw(gens I, w, opts) gbw(Matrix, List) := opts -> (m, w) -> ( -- preprocessing W := ring m; @@ -187,7 +187,7 @@ gbw(Matrix, List) := opts -> (m, w) -> ( -- This routine computes the characteristic ideal of a D-module characteristicIdeal = method() -characteristicIdeal Ideal := I -> ( +characteristicIdeal LeftIdeal := I -> ( if not isWeylAlgebra(W := ring I) then error "expected an ideal in a Weyl algebra"; createDpairs W; w := apply( toList(0..numgens W - 1), @@ -209,7 +209,7 @@ characteristicIdeal Module := M -> ( -- This routine computes the singular locus of a D-ideal -- SHOULD IT BE CHANGED SO THAT OUTPUT IS IN POLY SUBRING? DsingularLocus = method() -DsingularLocus Ideal := I -> DsingularLocus comodule I +DsingularLocus LeftIdeal := I -> DsingularLocus comodule I DsingularLocus Module := M -> ( if not isWeylAlgebra(W := ring M) then error "expected a module over a Weyl algebra"; createDpairs W; diff --git a/M2/Macaulay2/packages/WeylAlgebras/TST/Dbasic.m2 b/M2/Macaulay2/packages/WeylAlgebras/TST/Dbasic.m2 index b7c95995c7f..e02d1442895 100644 --- a/M2/Macaulay2/packages/WeylAlgebras/TST/Dbasic.m2 +++ b/M2/Macaulay2/packages/WeylAlgebras/TST/Dbasic.m2 @@ -55,9 +55,10 @@ TEST/// D = QQ[u,v,Du,Dv, WeylAlgebra => {u => Du, v => Dv}]; assert (Dtransposition (u*Du) ==-Du*u); assert (Dtransposition ideal (u*Dv^2+Du^2*Dv) == ideal (u*Dv^2-Du^2*Dv)); - assert (entries Dtransposition matrix {{u*Du, v}, {v*Dv^2, u^2}} == entries matrix {{-Du*u, v}, {Dv^2*v, u^2}}); - C1 = Dtransposition res ideal(u*Du); - C2 = res ideal(-Du*u); + assert (entries Dtransposition matrix {{u*Du, v}, {v*Dv^2, u^2}} == entries matrix {{-Du*u, v}, {Dv^2*v, u^2}}); + needsPackage "BernsteinSato" + C1 = Dtransposition Dres ideal(u*Du); + C2 = Dres ideal(-Du*u); assert (C1_1==C2_1); /// diff --git a/M2/Macaulay2/packages/WeylAlgebras/makeCyclic.m2 b/M2/Macaulay2/packages/WeylAlgebras/makeCyclic.m2 index 85b334498bd..3b16b73c353 100644 --- a/M2/Macaulay2/packages/WeylAlgebras/makeCyclic.m2 +++ b/M2/Macaulay2/packages/WeylAlgebras/makeCyclic.m2 @@ -211,7 +211,7 @@ assert (singLocus h.AnnG == singLocus cokernel M) -- R^1 / dx^3 ------------------------- use R -M = presentation image map( R^1/ideal dx^3, R^3, matrix{{1, x, x^2}} ) +M = presentation image map( cokernel matrix{{dx^3}}, R^3, matrix{{1, x, x^2}} ) h = makeCyclic M b1 = bFunction(ideal dx^3, {1}) b2 = bFunction(cokernel M, {1}, {0,-1,-2}) diff --git a/M2/Macaulay2/packages/WeylAlgebras/stafford.m2 b/M2/Macaulay2/packages/WeylAlgebras/stafford.m2 index 24dd2903cc9..078d7bf488d 100644 --- a/M2/Macaulay2/packages/WeylAlgebras/stafford.m2 +++ b/M2/Macaulay2/packages/WeylAlgebras/stafford.m2 @@ -326,7 +326,7 @@ mainStep = (a,b,c) -> ( ) stafford = method(); -stafford Ideal := I -> ( +stafford LeftIdeal := I -> ( g := first entries gens I; while #g>2 do g = mainStep(g#0,g#1,g#2) | drop(g,3); ideal g @@ -607,7 +607,7 @@ isAll (ZZ,Matrix) := (k,M) -> ( t := target M; all(toList(0..numgens t - 1), i->reduceInCalR(k,t_{i},M)==0) ) -isAll (ZZ, Ideal) := (k,I) -> ( +isAll (ZZ, LeftIdeal) := (k,I) -> ( return isAll(k, gens gb I); R := ring I; n := numgens R // 2; @@ -645,4 +645,4 @@ R = QQ[x_1..x_n,D_1..D_n, WeylAlgebra=>(apply(n,i->x_(i+1)=>D_(i+1)))] a = D_1; b = D_2; c = D_3; d = D_4; stafford ideal (a,b,c,d) assert(ideal(a,b,c,d)==oo) -/// \ No newline at end of file +/// From 72b1f4003d7a7c2064abe69d89bd1f9fe46c5c12 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Wed, 15 Nov 2023 22:03:50 -0500 Subject: [PATCH 03/14] docs in packages/Macaulay2Doc/... fixed --- .../packages/Macaulay2Doc/M2-Singular-Book.m2 | 2 +- M2/Macaulay2/packages/Macaulay2Doc/doc.m2 | 6 +++--- M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 | 2 +- M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 | 14 +++++++------- .../packages/Macaulay2Doc/doc_ringmaps.m2 | 14 +++++++------- .../packages/Macaulay2Doc/functions/gb-doc.m2 | 2 +- .../Macaulay2Doc/functions/intersect-doc.m2 | 16 ++++++++-------- .../Macaulay2Doc/functions/isSubset-doc.m2 | 4 ++-- .../Macaulay2Doc/functions/mingens-doc.m2 | 2 +- .../functions/minimalPresentation-doc.m2 | 2 +- .../Macaulay2Doc/functions/support-doc.m2 | 2 +- .../Macaulay2Doc/functions/symbol-percent-doc.m2 | 4 ++-- .../packages/Macaulay2Doc/functions/trim-doc.m2 | 2 +- M2/Macaulay2/packages/Macaulay2Doc/groebner.m2 | 2 +- M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 | 8 ++++---- .../packages/Macaulay2Doc/ov_ringmaps.m2 | 2 +- 16 files changed, 42 insertions(+), 42 deletions(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2 b/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2 index c6b7765ab92..13f530a16ed 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2 @@ -495,7 +495,7 @@ document { "K = ideal(f,x^2*y^7+y^14);", "(gens K) % I" }, - "In Macaulay2, inclusion of ideals can be tested using ", TO (isSubset,Ideal,Ideal), + "In Macaulay2, inclusion of ideals can be tested using ", TO (isSubset,LeftIdeal,LeftIdeal), " and equality can be checked using ", TO (symbol==,LeftIdeal,LeftIdeal), ". In both cases the necessary Groebner bases are computed, if they have not already been computed.", EXAMPLE { diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 index c6878018ad3..90f64f21db4 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 @@ -432,7 +432,7 @@ document { (symbol %, RR, RR), (symbol %, RR, ZZ), (symbol %, Number, GroebnerBasis), - (symbol %, Number, Ideal), + (symbol %, Number, LeftIdeal), (symbol %, ZZ, MonomialIdeal), (symbol %, ZZ, ZZ) }, @@ -839,8 +839,8 @@ document { (symbol==, RingElement, GradedModuleMap), (symbol==, String, Net), (symbol==, LeftIdeal, Ring), - (symbol==, ZZ, Ideal), - (symbol==, Ideal, ZZ), + (symbol==, ZZ, LeftIdeal), + (symbol==, LeftIdeal, ZZ), (symbol==, Matrix, RingElement), (symbol==, MonomialIdeal, Ideal), (symbol==, ZZ, GradedModuleMap), diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 index b5e51c4e603..318a2994618 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc8.m2 @@ -269,7 +269,7 @@ document { ----------------------------------------------------------------------------- document { - Key => {homogenize,(homogenize, Ideal, RingElement),(homogenize, Matrix, RingElement), + Key => {homogenize,(homogenize, LeftIdeal, RingElement),(homogenize, Matrix, RingElement), (homogenize, Matrix, RingElement, List),(homogenize, Module, RingElement), (homogenize, Module, RingElement, List),(homogenize, RingElement, RingElement),(homogenize, RingElement, RingElement, List), (homogenize, Vector, RingElement),(homogenize, Vector, RingElement, List)}, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 index 92beb2f3840..6223fb620e3 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc_ideals.m2 @@ -40,7 +40,7 @@ document { UL { TO (generators, LeftIdeal), TO (symbol _*,LeftIdeal), - TO (isSubset, Ideal, Ideal), + TO (isSubset, LeftIdeal, LeftIdeal), TO "MinimalPrimes :: isPrime(Ideal)" }, "Common operations on ideals:", @@ -48,9 +48,9 @@ document { TO (symbol +,LeftIdeal,LeftIdeal), TO (symbol *,Ideal,Ideal), TO (symbol ==,LeftIdeal,LeftIdeal), - TO (symbol ==,Ideal,ZZ), + TO (symbol ==,LeftIdeal,ZZ), TO (symbol ^,Ideal,ZZ), - TO (trim, Ideal) + TO (trim, LeftIdeal) }, "Gröbner bases, normal forms, free resolutions", UL { @@ -58,7 +58,7 @@ document { TO leadTerm, TO codim, TO dim, - TO (symbol%,Matrix,Ideal), + TO (symbol%,Matrix,LeftIdeal), TO resolution, TO betti }, @@ -115,7 +115,7 @@ document { "I = ideal(a,(t+1)*c) * ideal(a^2,b^2)" }, "The generators produced are not generally minimal. Use ", - TO (trim,Ideal), " or ", TO (mingens,Ideal), " to find a smaller + TO (trim,LeftIdeal), " or ", TO (mingens,LeftIdeal), " to find a smaller generating set.", SeeAlso => {"ideals"} } @@ -135,7 +135,7 @@ document { "I = ideal(a,(t+1)*c) + ideal(a^2,b^2)" }, "The generators produced are not generally minimal. Use ", - TO (trim,Ideal), " or ", TO (mingens,Ideal), " to find a smaller + TO (trim,LeftIdeal), " or ", TO (mingens,LeftIdeal), " to find a smaller generating set.", EXAMPLE { "trim I" @@ -156,7 +156,7 @@ document { "I^3" }, "The generators produced are often not minimal. Use ", - TO (trim,Ideal), " or ", TO (mingens,Ideal), " to find a smaller + TO (trim,LeftIdeal), " or ", TO (mingens,LeftIdeal), " to find a smaller generating set.", EXAMPLE { "trim I^3" diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc_ringmaps.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc_ringmaps.m2 index b48b6805d5a..4785eae2035 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc_ringmaps.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc_ringmaps.m2 @@ -16,7 +16,7 @@ document { document { Key => {(symbol SPACE, RingMap, RingElement), - (symbol SPACE, RingMap, Ideal), + (symbol SPACE, RingMap, LeftIdeal), (symbol SPACE, RingMap, Matrix), (symbol SPACE, RingMap, Vector), (symbol SPACE, RingMap, Module), @@ -57,13 +57,13 @@ document { (substitute, Vector, Option), (substitute, Product, Thing), (substitute, Matrix, List), - (substitute, Ideal, List), + (substitute, LeftIdeal, List), (substitute, Module, Matrix), (substitute, Matrix, Ring), (substitute, Matrix, ZZ), - (substitute, Ideal, Ring), + (substitute, LeftIdeal, Ring), (substitute, Module, Option), - (substitute,Ideal,RingFamily), + (substitute,LeftIdeal,RingFamily), (substitute,Matrix,RingFamily), (substitute,Module,RingFamily), (substitute,Number,RingFamily), @@ -74,13 +74,13 @@ document { (substitute, Vector, Ring), (substitute, RingElement, Option), (substitute, Matrix, Matrix), - (substitute, Ideal, Matrix), + (substitute, LeftIdeal, Matrix), (substitute, Module, List), (substitute, Divide, Thing), (substitute, Module, Ring), (substitute, Matrix, Option), (substitute, Sum, Thing), - (substitute, Ideal, Option), + (substitute, LeftIdeal, Option), (substitute, Vector, Matrix), (substitute, RingElement, List), (substitute, Power, Thing), @@ -91,7 +91,7 @@ document { Inputs => { "f" => {ofClass RingElement, ", ", ofClass Matrix,", ", - ofClass Ideal,", ", + ofClass LeftIdeal,", ", ofClass Module,", ", ofClass Vector,", or ", ofClass Expression, " over a ring ", TT "R"}, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/gb-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/gb-doc.m2 index d588a342765..e30d7eabf97 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/gb-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/gb-doc.m2 @@ -7,7 +7,7 @@ undocumented (NewFromMethod, GroebnerBasis, Sequence) document { Key => {gb, - (gb,Ideal), + (gb,LeftIdeal), (gb,Matrix), (gb,Module), [gb,Algorithm], diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/intersect-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/intersect-doc.m2 index cb11f913e91..c2b74cc5bee 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/intersect-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/intersect-doc.m2 @@ -5,10 +5,10 @@ doc /// Node Key - (intersect, Ideal, Ideal) - [(intersect, Ideal, Ideal), Strategy] - [(intersect, Ideal, Ideal), MinimalGenerators] - (intersect, Ideal) + (intersect, LeftIdeal, LeftIdeal) + [(intersect, LeftIdeal, LeftIdeal), Strategy] + [(intersect, LeftIdeal, LeftIdeal), MinimalGenerators] + (intersect, LeftIdeal) (intersect, Module, Module) [(intersect, Module, Module), Strategy] [(intersect, Module, Module), MinimalGenerators] @@ -19,15 +19,15 @@ Node intersect(M, N) intersect(M, N, ..., P) Inputs - :{Ideal,Module} - :{Ideal,Module} + :{LeftIdeal,Module} + :{LeftIdeal,Module} submodules of the same module or ideals in the same ring Strategy=>Thing specifies the algorithm MinimalGenerators=>Boolean indicates whether the output should be @TO2 {trim, "trimmed"}@ Outputs - :{Ideal,Module} + :{LeftIdeal,Module} the intersection of the sequence of objects Description Text @@ -52,7 +52,7 @@ Node Multiple strategies are implemented via @TO2 {"Macaulay2Doc :: using hooks", "hooks"}@ and can be listed using the function @TO hooks@. More strategies may be added using @TO addHook@. Example - hooks(intersect, Ideal, Ideal) + hooks(intersect, LeftIdeal, LeftIdeal) hooks(intersect, Module, Module) Text By default, the strategies are attempted in the reverse order in which the were added, until one is successful. diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/isSubset-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/isSubset-doc.m2 index 76e2be98bd3..dac20b55980 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/isSubset-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/isSubset-doc.m2 @@ -26,7 +26,7 @@ document { } document { - Key => {(isSubset,Module,Module),(isSubset,Ideal,Module),(isSubset,Module,Ideal)}, + Key => {(isSubset,Module,Module),(isSubset,LeftIdeal,Module),(isSubset,Module,LeftIdeal)}, Usage => "isSubset(M,N)", Inputs => { "M", "N" }, Outputs => { Boolean => {"whether ", TT "M", " is contained in ", TT "N"} }, @@ -40,7 +40,7 @@ document { } document { - Key => {(isSubset,Ideal,Ideal)}, + Key => {(isSubset,LeftIdeal,LeftIdeal)}, Usage => "isSubset(I,J)", Inputs => { "I", "J" }, Outputs => { Boolean => {"whether ", TT "I", " is contained in ", TT "J"} }, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/mingens-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/mingens-doc.m2 index 3d66c92cf52..7abba3c39a7 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/mingens-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/mingens-doc.m2 @@ -63,7 +63,7 @@ document { } document { - Key => {(mingens,Module),(mingens,Ideal)}, + Key => {(mingens,Module),(mingens,LeftIdeal)}, Usage => "mingens I", Inputs => { "I" => "or an ideal" diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/minimalPresentation-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/minimalPresentation-doc.m2 index acb915d6f9b..49552676362 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/minimalPresentation-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/minimalPresentation-doc.m2 @@ -88,7 +88,7 @@ document { I = ideal(x-x^2-y,z+x*y,w^2-u^2); minimalPresentation(I, Exclude=>{1}) ///, - SeeAlso => {(minimalPresentation,Ring), (trim, Ideal)} + SeeAlso => {(minimalPresentation,Ring), (trim, LeftIdeal)} } document { diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/support-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/support-doc.m2 index 666ac38f95d..d940ffab758 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/support-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/support-doc.m2 @@ -40,7 +40,7 @@ document { } document { - Key => {(support,Ideal)}, + Key => {(support,LeftIdeal)}, Headline => "list of variables occurring in the generators of an ideal", Usage => "support I", Inputs => { "I" => "an ideal in a polynomial ring" }, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/symbol-percent-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/symbol-percent-doc.m2 index 9c4b25cc105..edac4d90c20 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/symbol-percent-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/symbol-percent-doc.m2 @@ -6,11 +6,11 @@ document { Key => { "methods for normal forms and remainder", - (symbol %, RingElement, Ideal), + (symbol %, RingElement, LeftIdeal), (symbol %, RingElement, MonomialIdeal), (symbol %, RingElement, Matrix), (symbol %, RingElement, RingElement), - (symbol %, Matrix, Ideal), + (symbol %, Matrix, LeftIdeal), (symbol %, Matrix, MonomialIdeal), (symbol %, Matrix, RingElement), (symbol %, Matrix, Module), diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/trim-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/trim-doc.m2 index a483b1efb4f..8f606d220cc 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/trim-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/trim-doc.m2 @@ -43,7 +43,7 @@ Node Node Key trim - (trim, Ideal) + (trim, LeftIdeal) (trim, Ring) (trim, Module) (trim, MonomialIdeal) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/groebner.m2 b/M2/Macaulay2/packages/Macaulay2Doc/groebner.m2 index 665472640c0..dea789847b8 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/groebner.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/groebner.m2 @@ -134,7 +134,7 @@ document { f = x^3+y^3+z^3 f % I ///, - SeeAlso => {"Gröbner bases", (symbol %, RingElement, Ideal)}, + SeeAlso => {"Gröbner bases", (symbol %, RingElement, LeftIdeal)}, } -- we should be able to link to the right nodes without this: diff --git a/M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 b/M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 index 9743b3d88c7..ae47f4d6eee 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/ov_ideals.m2 @@ -203,7 +203,7 @@ document { }, SUBSECTION "normal form with respect to a Groebner basis and membership", - "The function ", TO (symbol%,RingElement,Ideal), + "The function ", TO (symbol%,RingElement,LeftIdeal), " reduces an element with respect to a Groebner basis of the ideal.", EXAMPLE { @@ -237,10 +237,10 @@ document { }, SeeAlso => { (symbol==,LeftIdeal,LeftIdeal), - (symbol==,Ideal,ZZ), + (symbol==,LeftIdeal,ZZ), symbol!=, - (symbol%,RingElement,Ideal), - (isSubset,Ideal,Ideal), + (symbol%,RingElement,LeftIdeal), + (isSubset,LeftIdeal,LeftIdeal), "MinimalPrimes :: radicalContainment" } } diff --git a/M2/Macaulay2/packages/Macaulay2Doc/ov_ringmaps.m2 b/M2/Macaulay2/packages/Macaulay2Doc/ov_ringmaps.m2 index 5f1ad98f295..d9e4db12f72 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/ov_ringmaps.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/ov_ringmaps.m2 @@ -68,7 +68,7 @@ document { UL { TO (symbol SPACE, RingMap, RingElement), TO (symbol SPACE, RingMap, Matrix), - TO (symbol SPACE, RingMap, Ideal), + TO (symbol SPACE, RingMap, LeftIdeal), TO (symbol SPACE, RingMap, Module), TO (symbol *, RingMap, RingMap), }, From 7a0a5dccef8017cfebaffeb3afb74c49f8f8b4c4 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Sat, 18 Nov 2023 08:44:21 -0500 Subject: [PATCH 04/14] LeftIdeal --> Macaulay2Doc, HolonomicSystems; breaks at B-S --- M2/Macaulay2/m2/matrix1.m2 | 4 ++-- .../HolonomicSystems/DOC/canonicalSeries.m2 | 24 +++++++++---------- .../HolonomicSystems/canonicalSeries.m2 | 22 ++++++++--------- .../Macaulay2Doc/functions/hooks-doc.m2 | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/M2/Macaulay2/m2/matrix1.m2 b/M2/Macaulay2/m2/matrix1.m2 index 35b5c573431..980a2616717 100644 --- a/M2/Macaulay2/m2/matrix1.m2 +++ b/M2/Macaulay2/m2/matrix1.m2 @@ -574,8 +574,8 @@ ideal Matrix := LeftIdeal => f -> ( ); new ( -- Ideal == two-sided ideal - if isCommutative R or isSkewCommutative R then Ideal - else LeftIdeal + if isWeylAlgebra R then LeftIdeal + else Ideal ) from { symbol generators => f, symbol ring => R, symbol cache => new CacheTable } ) ideal Module := LeftIdeal => M -> ( diff --git a/M2/Macaulay2/packages/HolonomicSystems/DOC/canonicalSeries.m2 b/M2/Macaulay2/packages/HolonomicSystems/DOC/canonicalSeries.m2 index b9008b46fe1..29c4284e020 100644 --- a/M2/Macaulay2/packages/HolonomicSystems/DOC/canonicalSeries.m2 +++ b/M2/Macaulay2/packages/HolonomicSystems/DOC/canonicalSeries.m2 @@ -87,7 +87,7 @@ doc /// doc /// Key distraction - (distraction, Ideal, Ring) + (distraction, LeftIdeal, Ring) (distraction, RingElement, Ring) Headline the image in the thetaRing of a torus-fixed element or ideal in a Weyl algebra @@ -95,7 +95,7 @@ doc /// distraction(I,thetaRing) distraction(f,thetaRing) Inputs - I:Ideal + I:LeftIdeal f:RingElement thetaRing:PolynomialRing a stand in for the subring $k[\theta]$ generated by @TT "theta = x*dx"@ @@ -128,13 +128,13 @@ doc /// doc /// Key indicialIdeal - (indicialIdeal, Ideal, List) + (indicialIdeal, LeftIdeal, List) Headline the image in the thetaRing of an indicial ideal in a Weyl algebra Usage indicialIdeal(I,w) Inputs - I:Ideal + I:LeftIdeal in a WeylAlgebra that is torus-fixed w:List (generic) weights for $I$, of length half the number of variables in the Weyl algebra @@ -167,13 +167,13 @@ doc /// doc /// Key cssExpts - (cssExpts, Ideal, List) + (cssExpts, LeftIdeal, List) Headline the exponents of the canonical series solutions of I in the direction of a weight vector Usage cssExpts(I,w) Inputs - I:Ideal + I:LeftIdeal (regular) holonomic ideal in the Weyl algebra w:List (generic) weights for $I$, of length half the number of variables in the Weyl algebra @@ -200,13 +200,13 @@ doc /// doc /// Key cssExptsMult - (cssExptsMult, Ideal, List) + (cssExptsMult, LeftIdeal, List) Headline the exponents and multiplicities of the canonical series solutions Usage cssExptsMult(I,w) Inputs - I:Ideal + I:LeftIdeal (regular) holonomic ideal in the Weyl algebra w:List (generic) weights for $I$, of length half the number of variables in the Weyl algebra @@ -236,13 +236,13 @@ doc /// doc /// Key isTorusFixed - (isTorusFixed, Ideal) + (isTorusFixed, LeftIdeal) Headline checks if an ideal in a Weyl algebra is torus-fixed Usage isTorusFixed I Inputs - I:Ideal + I:LeftIdeal in a WeylAlgebra Outputs :Boolean @@ -298,13 +298,13 @@ doc /// doc /// Key cssLeadTerm - (cssLeadTerm, Ideal, List) + (cssLeadTerm, LeftIdeal, List) Headline lead term of the canonical series solutions of I Usage cssLeadTerm(I, w) Inputs - I:Ideal + I:LeftIdeal (regular) holonomic ideal in the Weyl algebra w:List (generic) weights for $I$, of length half the number of variables in the Weyl algebra diff --git a/M2/Macaulay2/packages/HolonomicSystems/canonicalSeries.m2 b/M2/Macaulay2/packages/HolonomicSystems/canonicalSeries.m2 index 0b8d1825fe3..b4db57a0d50 100644 --- a/M2/Macaulay2/packages/HolonomicSystems/canonicalSeries.m2 +++ b/M2/Macaulay2/packages/HolonomicSystems/canonicalSeries.m2 @@ -12,7 +12,7 @@ --Input: J an ideal in a Weyl algebra --Output: True if ideal is torus fixed, as in SST Lem. 2.3.1. False if not. isTorusFixed = method(); -isTorusFixed(Ideal) := Boolean => (J)->( +isTorusFixed LeftIdeal := Boolean => J->( n := numgens ring J//2; J' := ideal flatten apply(J_*,f->( apply(apbFactor(f @@ -66,7 +66,7 @@ distraction = method() --Input: torus-fixed left D-ideal J --Output: the distraction of J, viewed in ThetaRing --Note: this was called thetaIdeal in the past -distraction(Ideal, Ring) := Ideal => (J, ThetaRing) -> sum(J_*, j -> ideal distraction(j, ThetaRing)) +distraction(LeftIdeal, Ring) := Ideal => (J, ThetaRing) -> sum(J_*, j -> ideal distraction(j, ThetaRing)) --Input: element in a torus-fixed left D-ideal --Output: list of corresponding gens from homogeneous pieces in the distraction, viewed in ThetaRing distraction(RingElement, Ring) := List => (f, ThetaRing) -> ( @@ -81,7 +81,7 @@ distraction(RingElement, Ring) := List => (f, ThetaRing) -> ( --Input: holonomic ideal I, weight w in the form of a List --Output: the indicial ideal of I with respect to w indicialIdeal = method(); -indicialIdeal(Ideal, List) := Ideal => (I, w) -> distraction(inw(I, -w|w), first createThetaRing ring I) +indicialIdeal(LeftIdeal, List) := Ideal => (I, w) -> distraction(inw(I, -w|w), first createThetaRing ring I) --Input: 0-dimensional primary ideal I --Output: corresponding point, as a vector @@ -94,7 +94,7 @@ solveMax Ideal := List => I -> first entries lift(vars ring I % radical I, coeff --Output: list of 0-dimensional ideals encoding css exponents and their multiplicities -- internal beginExptComp = method(); -beginExptComp(Ideal,List,ZZ,Ring) := List => (H,w,n,S)->( +beginExptComp(LeftIdeal,List,ZZ,Ring) := List => (H,w,n,S)->( if not isHolonomic(H) then error "ideal is not holonomic"; if #w != n then error "weight vector has wrong length"; J := inw(H,(-w)|w); @@ -105,7 +105,7 @@ beginExptComp(Ideal,List,ZZ,Ring) := List => (H,w,n,S)->( --Input: holonomic D-ideal H, weight vector w as List --Output: list of starting monomial exponents for H wrt w cssExpts = method(); -cssExpts(Ideal,List) := List => (H,w)->( +cssExpts(LeftIdeal,List) := List => (H,w)->( n:= (numgens ring H)//2; t := symbol t; S := QQ(monoid [t_1..t_n]); @@ -116,7 +116,7 @@ cssExpts(Ideal,List) := List => (H,w)->( --Input: holonomic D-ideal H, weight vector w as List, --Output: list of starting monomial exponents for H wrt w, with multiplicities cssExptsMult = method(); -cssExptsMult(Ideal,List) := List => (H,w)->( +cssExptsMult(LeftIdeal,List) := List => (H,w)->( n:= (numgens ring H)//2; t := symbol t; S := QQ(monoid [t_1..t_n]); @@ -246,7 +246,7 @@ solveFrobeniusIdeal(Ideal, Ring) := List => (I, W) -> ( --Input: I regular holonomic ideal in a Weyl algebra on n vars, weight vector w in \ZZ^n as a List --Output: starting monomials for the css for I for weight w, as a List of ring elements in vars for I and their logs cssLeadTerm = method() -cssLeadTerm(Ideal, List) := List => (I, w) -> solveFrobeniusIdeal(indicialIdeal(I, w), ring I) +cssLeadTerm(LeftIdeal, List) := List => (I, w) -> solveFrobeniusIdeal(indicialIdeal(I, w), ring I) --TODO: where should this go? --Input: cone C, weight vector k @@ -261,7 +261,7 @@ truncate(Cone, List, ZZ) := List => {} >> o -> (C, w, k) -> polyhedronFromHData( --NOTE: We are assuming that the ideal I is provided with LT of weight 0. --We will adjust to this case using nonpositiveWeightGens nilssonSupport = method() -nilssonSupport(Ideal, List) := Cone => (I, w) -> ( +nilssonSupport(LeftIdeal, List) := Cone => (I, w) -> ( -- See description before SST Thm 2.5.14 n := length w; G := gbw(I, fw := -w|w); @@ -275,12 +275,12 @@ nilssonSupport(Ideal, List) := Cone => (I, w) -> ( tailCone polar polyhedronFromHData(concatRows first L, concatRows last L)) --Input: I regular holonomic ideal in a Weyl algebra on n vars, weight vector w in \ZZ^n as a List, weight k --Output: lattice points in cone of weight \leq k, as a List of Lists -nilssonSupport(Ideal, List, ZZ) := List => (I, w, k) -> entries transpose concatCols latticePoints truncate(nilssonSupport(I, w), w, k) +nilssonSupport(LeftIdeal, List, ZZ) := List => (I, w, k) -> entries transpose concatCols latticePoints truncate(nilssonSupport(I, w), w, k) --Input: I regular holonomic ideal in a Weyl algebra on n vars, weight vector w in \ZZ^n as a List --Output: list of generators of gbw(I) times monomial in variables, so that all inw terms have w-weight zero nonpositiveWeightGens = method() -nonpositiveWeightGens(Ideal, List) := List => (I, w) -> ( +nonpositiveWeightGens(LeftIdeal, List) := List => (I, w) -> ( W := ring I; n := length w; G := gbw(I, fw := -w|w); @@ -293,7 +293,7 @@ nonpositiveWeightGens(Ideal, List) := List => (I, w) -> ( ) truncatedCanonicalSeries = method() -truncatedCanonicalSeries(Ideal, List, ZZ) := List => (I, w, k) -> ( +truncatedCanonicalSeries(LeftIdeal, List, ZZ) := List => (I, w, k) -> ( W := ring I; n := numgens W // 2; r := holonomicRank I; diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/hooks-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/hooks-doc.m2 index 9829e577a43..b818936b817 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/hooks-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/hooks-doc.m2 @@ -160,7 +160,7 @@ Node of those hooks associated with @TT "key"@ or stored in @TT "store"@ Description Example - hooks(intersect, Ideal, Ideal) + hooks(intersect, LeftIdeal, LeftIdeal) code 0 hooks(quotient, Strategy => Iterate) SeeAlso From a1ac40185885712df40f2b2b1f4c833b97dd5f12 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Mon, 20 Nov 2023 08:32:24 -0500 Subject: [PATCH 05/14] working on B.-S.: stuck on colon ideal --- .../packages/BernsteinSato/multiplierIdeals.m2 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/BernsteinSato/multiplierIdeals.m2 b/M2/Macaulay2/packages/BernsteinSato/multiplierIdeals.m2 index 25c4062500d..ebac78d3cf2 100644 --- a/M2/Macaulay2/packages/BernsteinSato/multiplierIdeals.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/multiplierIdeals.m2 @@ -18,6 +18,18 @@ isInMultiplierIdeal(RingElement, Ideal, QQ) := o -> (g,I,c) -> ( -c > max roots ) +-- power of a (left) ideal and +-- quotient -- LeftIdeal:RingElement +-- product -- RingElement:LeftIdeal +-- are _not_ well defined in general in the Weyl algebra, +-- ... but are used by some methods below in a limited context (for commuting elements) +powerIdealZZ = method() +powerIdealZZ(LeftIdeal,ZZ) := (I,n) -> ideal symmetricPower(n,generators I) +quotientInWeylAlgebra = method() +quotientInWeylAlgebra(LeftIdeal,RingElement) := (I,f) -> (new Ideal from I) : (new Ideal from ideal f) +productInWeylAlgebra = method() +productInWeylAlgebra(RingElement,LeftIdeal) := (f,I) -> f * (new Ideal from ideal I) + multiplierIdeal = method(Options => {Strategy=>ViaElimination, DegreeLimit=>null}) multiplierIdeal (Ideal, ZZ) := o -> (a,c) -> multiplierIdeal(a, promote(c,QQ), Strategy=>o.Strategy, DegreeLimit=>o.DegreeLimit) multiplierIdeal (Ideal, QQ) := o -> (a,c) -> first multiplierIdeal(a, {c}, Strategy=>o.Strategy, DegreeLimit=>o.DegreeLimit) @@ -51,7 +63,7 @@ multiplierIdeal (Ideal, List) := o -> (a,cs) -> ( SXring := K(monoid [SX,MonomialOrder=>Eliminate 1]); SDYtoSX := map(SXring,SDY, gens SXring | toList(n+2*r:0) ); -- - I2' := sub(Istar,SDY) + (sub(a, SDY))^m + ideal (SDY_0 + sum(r,i->dT#i*T#i)); -- Istar + a^m + (s-\sigma) + I2' := sub(Istar,SDY) + powerIdealZZ(sub(a, SDY),m) + ideal (SDY_0 + sum(r,i->dT#i*T#i)); -- Istar + a^m + (s-\sigma) if o.Strategy == ViaElimination then I2 := SDYtoSX eliminateWA(I2', notSX); pInfo(1, "J_I("|toString m|") = "|toString I2); -- b-function part @@ -97,7 +109,7 @@ multiplierIdeal (Ideal, List) := o -> (a,cs) -> ( while d <= o.DegreeLimit do ( -- add reductions of all monomials of degree d times b(s) new'monoms = false; - for f in ((ideal X)^d)_* do ( + for f in (powerIdealZZ(ideal X,d))_* do ( -- taking monomials not in the initial ideal of ret -- could be optimized more: delete the initial terms discovered on the previous step from monoms and f'b'sigma (MutableList? MutableHashTable?) if ret === null or sub(f,R) % ideal( (flatten entries gens gb ret)/ leadMonomial ) != 0 @@ -122,7 +134,7 @@ multiplierIdeal (Ideal, List) := o -> (a,cs) -> ( else if o.Strategy == ViaElimination then exceptionalLocusB(R,I2,b) -- ring I2 has to eliminate s else if o.Strategy == ViaColonIdeal then ( - I2'' := I2' : ( (map(SDY, ring b, {sigma})) b ); + I2'' := quotientInWeylAlgebra(I2',(map(SDY, ring b, {sigma})) b); notX := {SDY_0}|notSX; SDYtoSX eliminateWA(I2'', notX) ) From 422a508832006250e0c4d07b8956094dbb7c4569 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Wed, 22 Nov 2023 17:21:34 -0500 Subject: [PATCH 06/14] BernsteinSato; added quotientHelper quotient(LeftIdeal,RingElement) --- M2/Macaulay2/packages/BernsteinSato/DHom.m2 | 81 ++++++++++--------- .../packages/BernsteinSato/DOC/DHom.m2 | 50 ++++++------ .../packages/BernsteinSato/DOC/Dlocalize.m2 | 6 +- .../BernsteinSato/DOC/Drestriction.m2 | 54 ++++++------- .../packages/BernsteinSato/DOC/WeylClosure.m2 | 8 +- .../packages/BernsteinSato/DOC/annFs.m2 | 4 +- .../packages/BernsteinSato/DOC/localCohom.m2 | 38 ++++----- .../packages/BernsteinSato/Dlocalize.m2 | 8 +- .../packages/BernsteinSato/Dresolution.m2 | 4 +- .../packages/BernsteinSato/Drestriction.m2 | 48 +++++------ .../packages/BernsteinSato/TST/tests.m2 | 2 +- .../packages/BernsteinSato/WeylClosure.m2 | 6 +- M2/Macaulay2/packages/BernsteinSato/annFs.m2 | 6 +- .../BernsteinSato/intersectionCohom.m2 | 2 +- .../packages/BernsteinSato/localCohom.m2 | 40 ++++----- .../BernsteinSato/multiplierIdeals.m2 | 2 +- .../packages/BernsteinSato/paramBpoly.m2 | 7 +- M2/Macaulay2/packages/Saturation.m2 | 32 ++++++-- 18 files changed, 210 insertions(+), 188 deletions(-) diff --git a/M2/Macaulay2/packages/BernsteinSato/DHom.m2 b/M2/Macaulay2/packages/BernsteinSato/DHom.m2 index 38edc51a51e..38c0afe0c91 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DHom.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DHom.m2 @@ -56,7 +56,7 @@ divideOutGCD Matrix := m -> ( -------------------------------------------------------------------------------- Ddual = method() -Ddual Ideal := I -> Ddual comodule I +Ddual LeftIdeal := I -> Ddual comodule I Ddual Module := M -> ( pInfo(1, "ENTERING Ddual ... "); W := ring M; @@ -86,11 +86,11 @@ Ddual Module := M -> ( -------------------------------------------------------------------------------- polynomialSolutions = method(Options => {Alg => GD} ) -polynomialSolutions Ideal := options -> I -> ( - polynomialSolutions((ring I)^1/I, options) ) +polynomialSolutions LeftIdeal := options -> I -> ( + polynomialSolutions(coker gens I, options) ) -polynomialSolutions(Ideal,List) := options -> (I,w) -> ( - polynomialSolutions((ring I)^1/I, w, options) ) +polynomialSolutions(LeftIdeal,List) := options -> (I,w) -> ( + polynomialSolutions(coker gens I, w, options) ) polynomialSolutions Module := options -> M -> ( W := ring M; @@ -255,8 +255,8 @@ polynomialSolutions(Module, List) := options -> (M, w) -> ( -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- polynomialExt = method(Options => {Strategy => Schreyer}) -polynomialExt Ideal := options -> I -> ( - polynomialExt ((ring I)^1/I, options) +polynomialExt LeftIdeal := options -> I -> ( + polynomialExt (coker gens I, options) ) polynomialExt Module := options -> (M) -> ( @@ -273,8 +273,8 @@ polynomialExt Module := options -> (M) -> ( homologyTable ) -polynomialExt(ZZ, Ideal) := options -> (k, I) -> ( - if not I.?quotient then I.quotient = (ring I)^1/I; +polynomialExt(ZZ, LeftIdeal) := options -> (k, I) -> ( + if not I.?quotient then I.quotient = coker gens I; polynomialExt (k, I.quotient, options) ) @@ -297,7 +297,7 @@ polynomialExt(ZZ, Module) := options -> (k, M) -> ( -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- rationalFunctionSolutions = method() -rationalFunctionSolutions(Ideal) := (I) -> ( +rationalFunctionSolutions(LeftIdeal) := (I) -> ( W := ring I; createDpairs W; w := toList(#W.dpairVars#0: 1); @@ -305,19 +305,19 @@ rationalFunctionSolutions(Ideal) := (I) -> ( rationalFunctionSolutions(I, f, w) ) -rationalFunctionSolutions(Ideal, List) := (I, w) -> ( +rationalFunctionSolutions(LeftIdeal, List) := (I, w) -> ( f := (singLocus I)_0; rationalFunctionSolutions(I, f, w) ) -rationalFunctionSolutions(Ideal, RingElement) := (I, f) -> ( +rationalFunctionSolutions(LeftIdeal, RingElement) := (I, f) -> ( W := ring I; createDpairs W; w := toList(#W.dpairVars#0: 1); rationalFunctionSolutions(I, f, w) ) -rationalFunctionSolutions(Ideal, RingElement, List) := (I, f, w) -> ( +rationalFunctionSolutions(LeftIdeal, RingElement, List) := (I, f, w) -> ( W := ring I; bfunc := (globalB(I, f))#Bpolynomial; k := (max getIntRoots bfunc) + 1; @@ -332,7 +332,7 @@ rationalFunctionSolutions(Ideal, RingElement, List) := (I, f, w) -> ( solsList ) -rationalFunctionSolutions(Ideal, List, List) := (I, f, w) -> ( +rationalFunctionSolutions(LeftIdeal, List, List) := (I, f, w) -> ( W := ring I; createDpairs W; bfuncs := apply(f, i -> (globalB(I, i))#Bpolynomial); @@ -353,10 +353,10 @@ rationalFunctionSolutions(Ideal, List, List) := (I, f, w) -> ( -- internal TwistOperator = method() -TwistOperator(Ideal, RingElement, ZZ) := (I, f, k) -> ( +TwistOperator(LeftIdeal, RingElement, ZZ) := (I, f, k) -> ( ideal apply((entries gens I)#0, L -> TwistOperator(L, f, k)) ) -TwistOperator(Ideal, List, List) := (I, f, k) -> ( +TwistOperator(LeftIdeal, List, List) := (I, f, k) -> ( ideal apply((entries gens I)#0, L -> TwistOperator(L, f, k)) ) @@ -450,7 +450,7 @@ TwistOperator(RingElement, List, List) := (L, f, k) -> ( -------------------------------------------------------------------------------- rationalFunctionExt = method(Options => {Strategy => Schreyer} ) -rationalFunctionExt Ideal := options -> I -> ( +rationalFunctionExt LeftIdeal := options -> I -> ( f := (singLocus(I))_0; rationalFunctionExt (I, f) ) @@ -468,8 +468,8 @@ rationalFunctionExt Module := options -> M -> ( ) -rationalFunctionExt(Ideal, RingElement) := options -> (I, f) -> ( - rationalFunctionExt ((ring I)^1/I, f, options) +rationalFunctionExt(LeftIdeal, RingElement) := options -> (I, f) -> ( + rationalFunctionExt (coker gens I, f, options) ) rationalFunctionExt(Module, RingElement) := options -> (M, f) -> ( @@ -499,13 +499,13 @@ rationalFunctionExt(ZZ, Module) := options -> (k, M) -> ( rationalFunctionExt (k, M, f) ) -rationalFunctionExt(ZZ, Ideal) := options -> (k, I) -> ( +rationalFunctionExt(ZZ, LeftIdeal) := options -> (k, I) -> ( f := (singLocus(I))_0; rationalFunctionExt (k, I, f) ) -rationalFunctionExt(ZZ, Ideal, RingElement) := options -> (k, I, f) -> ( - rationalFunctionExt (k, (ring I)^1/I, f, options) +rationalFunctionExt(ZZ, LeftIdeal, RingElement) := options -> (k, I, f) -> ( + rationalFunctionExt (k, coker gens I, f, options) ) rationalFunctionExt(ZZ, Module, RingElement) := options -> (k, M, f) -> ( @@ -531,12 +531,12 @@ rationalFunctionExt(ZZ, Module, RingElement) := options -> (k, M, f) -> ( DHom = method(Options => {Strategy => Schreyer}) -DHom(Ideal, Ideal) := options -> (I, J) -> ( +DHom(LeftIdeal, LeftIdeal) := options -> (I, J) -> ( W := ring I; createDpairs W; n := #W.dpairVars#0; w := toList(2*n:1); - DHom(W^1/I, W^1/J, w, options) + DHom(coker gens I, coker gens J, w, options) ) DHom(Module, Module) := options -> (M, N) -> ( @@ -903,20 +903,19 @@ compareSpans (List, List) := (list1, list2) -> ( -TEST /// -- TESTS TO WRITE (exported symbols); --- polynomialExt Ideal +-- polynomialExt LeftIdeal -- polynomialExt Module --- polynomialExt (ZZ, Ideal) +-- polynomialExt (ZZ, LeftIdeal) -- polynomialExt (ZZ, Module) --- rationalFunctionExt Ideal +-- rationalFunctionExt LeftIdeal -- rationalFunctionExt Module --- rationalFunctionExt (Ideal, RingElement) +-- rationalFunctionExt (LeftIdeal, RingElement) -- rationalFunctionExt (Module, rationalFunctionExt) -- rationalFunctionExt (ZZ, Module) --- rationalFunctionExt (ZZ, Ideal) --- rationalFunctionExt (ZZ, Ideal, RingElement) +-- rationalFunctionExt (ZZ, LeftIdeal) +-- rationalFunctionExt (ZZ, LeftIdeal, RingElement) -- rationalFunctionExt (ZZ, Module, RingElement) -- DHom (Module, Module, List) @@ -934,12 +933,14 @@ TEST /// -- divideOutGCD RingElement -- divideOutGCD Matrix --- TwistOperator (Ideal, RingElement, ZZ) --- TwistOperator (Ideal, List, List) +-- TwistOperator (LeftIdeal, RingElement, ZZ) +-- TwistOperator (LeftIdeal, List, List) -- TwistOperator (RingElement, RingElement, ZZ) -- TwistOperator (RingElement, List, List) +TEST /// importFrom_"BernsteinSato" {"compareSpans"} + ---------------- TESTS for compareSpan ----------------------- -- Test 1: S = QQ[x,y,z]; @@ -962,14 +963,14 @@ mylist1 = {1, x, y}; mylist2 = {x + y, x-y}; assert(not compareSpans(mylist1, mylist2)); - ----------------------- TESTS for ^ ----------------------- x = symbol x; y = symbol y; z = symbol z; R = QQ[x,y,z]; assert({x,y,z}^{2,3,4} == x^2*y^3*z^4); +/// - - +TEST/// +importFrom_"BernsteinSato" {"compareSpans"} ----------------------- TESTS for polynomialSolutions ------------------------- -- Test 1: Simple example x = symbol x; Dx = symbol Dx; @@ -998,11 +999,12 @@ ansGD = polynomialSolutions(I, weight); R = ring ansGD#0; ansDuality = polynomialSolutions(I, Alg => Duality) / (f -> sub(f, R)); assert(compareSpans(ansGD, ansDuality)); - +/// --------------------- TESTS for polynomialExt ----------------------- - +TEST/// +importFrom_"BernsteinSato" {"compareSpans"} --------------------- TESTS for rationalFunctionSolutions ----------------------- -- Test 1: x = symbol x; Dx = symbol Dx; @@ -1025,8 +1027,9 @@ ans = {(-x+y)/(-y^4 + 3*y^3 - 3*y^2 + y), (-x*y^3 + 3*x*y^2 - 3*x*y + 4*x - 3*y) thelcd = lcm((allSols | ans) / denominator); assert compareSpans( thelcd*allSols / (f -> lift(f, R)), thelcd*ans / (f -> lift(f, R))); +/// - +TEST/// ---------------------- TESTS forDHom and DExt ------------------------ -- Test 1: Simple ODE examples x = symbol x; dx = symbol dx; diff --git a/M2/Macaulay2/packages/BernsteinSato/DOC/DHom.m2 b/M2/Macaulay2/packages/BernsteinSato/DOC/DHom.m2 index 1bd8c12ed5d..6d82f867441 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DOC/DHom.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DOC/DHom.m2 @@ -4,14 +4,14 @@ document { TO [Dresolution,Strategy] } document { - Key => {DHom, (DHom,Module,Module), (DHom,Module,Module,List), (DHom,Ideal,Ideal)}, + Key => {DHom, (DHom,Module,Module), (DHom,Module,Module,List), (DHom,LeftIdeal,LeftIdeal)}, Headline=>"D-homomorphisms between holonomic D-modules", Usage => "DHom(M,N), DHom(M,N,w), DHom(I,J)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, "N" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, - "J" => Ideal => {"which represents the module ", EM "N = D/J"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, + "J" => LeftIdeal => {"which represents the module ", EM "N = D/J"}, "w" => List => "a positive weight vector" }, Outputs => { @@ -37,8 +37,8 @@ document { the restriction algorithm."}, EXAMPLE lines /// W = QQ[x, D, WeylAlgebra=>{x=>D}] - M = W^1/ideal(D-1) - N = W^1/ideal((D-1)^2) + M = coker gens ideal(D-1) + N = coker gens ideal((D-1)^2) DHom(M,N) ///, Caveat => {"Input modules ", EM "M", ", ", EM "N", ", ", @@ -102,8 +102,8 @@ document { the restriction algorithm."}, EXAMPLE lines /// W = QQ[x, D, WeylAlgebra=>{x=>D}] - M = W^1/ideal(x*(D-1)) - N = W^1/ideal((D-1)^2) + M = coker gens ideal(x*(D-1)) + N = coker gens ideal((D-1)^2) DExt(M,N) ///, Caveat =>{ @@ -115,12 +115,12 @@ document { } document { - Key => {Ddual, (Ddual,Module), (Ddual,Ideal)}, + Key => {Ddual, (Ddual,Module), (Ddual,LeftIdeal)}, Headline => "holonomic dual of a D-module", Usage => "Ddual M, Ddual I", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"} + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"} }, Outputs => { Module => {"the holonomic dual of ", EM "M"} @@ -148,12 +148,12 @@ document { TO [Dresolution,Strategy] } document { - Key => {polynomialExt, (polynomialExt,Module), (polynomialExt,ZZ,Ideal), (polynomialExt,ZZ,Module), (polynomialExt,Ideal)}, + Key => {polynomialExt, (polynomialExt,Module), (polynomialExt,ZZ,LeftIdeal), (polynomialExt,ZZ,Module), (polynomialExt,LeftIdeal)}, Headline => "Ext groups between a holonomic module and a polynomial ring", Usage => "polynomialExt M, polynomialExt I; rationalFunctionExt(i,M), rationalFunctionExt(i,I)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "i" => ZZ => "nonnegative" }, Outputs => { @@ -172,7 +172,7 @@ document { the restriction algorithm."}, EXAMPLE lines /// W = QQ[x, D, WeylAlgebra=>{x=>D}] - M = W^1/ideal(x^2*D^2) + M = coker gens ideal(x^2*D^2) polynomialExt(M) ///, Caveat =>{"Does not yet compute explicit representations of @@ -187,15 +187,15 @@ document { } document { - Key => {rationalFunctionExt, (rationalFunctionExt,Module), (rationalFunctionExt,ZZ,Ideal,RingElement), (rationalFunctionExt,ZZ,Ideal), - (rationalFunctionExt,Ideal,RingElement), (rationalFunctionExt,Ideal),(rationalFunctionExt,ZZ,Module,RingElement), + Key => {rationalFunctionExt, (rationalFunctionExt,Module), (rationalFunctionExt,ZZ,LeftIdeal,RingElement), (rationalFunctionExt,ZZ,LeftIdeal), + (rationalFunctionExt,LeftIdeal,RingElement), (rationalFunctionExt,LeftIdeal),(rationalFunctionExt,ZZ,Module,RingElement), (rationalFunctionExt,ZZ,Module), (rationalFunctionExt,Module,RingElement)}, Headline => "Ext(holonomic D-module, polynomial ring localized at the singular locus)", Usage => "rationalFunctionExt M, rationalFunctionExt I; rationalFunctionExt(M,f), rationalFunctionExt(I,f); rationalFunctionExt(i,M), rationalFunctionExt(i,I); rationalFunctionExt(i,M,f), rationalFunctionExt(i,I,f)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "f" => RingElement => "a polynomial", "i" => ZZ => "nonnegative" }, @@ -215,7 +215,7 @@ document { the restriction algorithm."}, EXAMPLE lines /// W = QQ[x, D, WeylAlgebra=>{x=>D}] - M = W^1/ideal(x*D+5) + M = coker gens ideal(x*D+5) rationalFunctionExt M ///, Caveat =>{"Input modules M or D/I should be holonomic."}, @@ -226,9 +226,9 @@ doc /// Key polynomialSolutions (polynomialSolutions,Module) - (polynomialSolutions,Ideal,List) + (polynomialSolutions,LeftIdeal,List) (polynomialSolutions,Module,List) - (polynomialSolutions,Ideal) + (polynomialSolutions,LeftIdeal) Headline polynomial solutions of a holonomic system Usage @@ -239,7 +239,7 @@ doc /// Inputs M:Module over the Weyl algebra $D$ - I:Ideal + I:LeftIdeal holonomic ideal in the Weyl algebra $D$ w:List a weight vector @@ -292,11 +292,11 @@ document { doc /// Key rationalFunctionSolutions - (rationalFunctionSolutions,Ideal,List,List) - (rationalFunctionSolutions,Ideal,RingElement,List) - (rationalFunctionSolutions,Ideal,List) - (rationalFunctionSolutions,Ideal,RingElement) - (rationalFunctionSolutions,Ideal) + (rationalFunctionSolutions,LeftIdeal,List,List) + (rationalFunctionSolutions,LeftIdeal,RingElement,List) + (rationalFunctionSolutions,LeftIdeal,List) + (rationalFunctionSolutions,LeftIdeal,RingElement) + (rationalFunctionSolutions,LeftIdeal) Headline rational solutions of a holonomic system Usage @@ -306,7 +306,7 @@ doc /// rationalFunctionSolutions(I,ff) rationalFunctionSolutions(I,ff,w) Inputs - I:Ideal + I:LeftIdeal holonomic ideal in the Weyl algebra @EM "D"@ f:RingElement a polynomial diff --git a/M2/Macaulay2/packages/BernsteinSato/DOC/Dlocalize.m2 b/M2/Macaulay2/packages/BernsteinSato/DOC/Dlocalize.m2 index ed46c86b7a6..4f1d76cd581 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DOC/Dlocalize.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DOC/Dlocalize.m2 @@ -38,7 +38,7 @@ document { EXAMPLE lines /// W = QQ[x,y,Dx,Dy, WeylAlgebra => {x=>Dx,y=>Dy}] - M = W^1/(ideal(x*Dx+1, Dy)) + M = coker gens ideal(x*Dx+1, Dy) f = x^2-y^3 Mf = Dlocalize(M, f) ///, @@ -61,7 +61,7 @@ document { " that computes the localization map.", EXAMPLE lines /// W = QQ[x,y,Dx,Dy, WeylAlgebra => {x=>Dx,y=>Dy}] - M = W^1/(ideal(x*Dx+1, Dy)) + M = coker gens ideal(x*Dx+1, Dy) f = x^2-y^3 DlocalizeMap(M, f) ///, @@ -105,7 +105,7 @@ doc /// $s$ such that (the images of) the generators of $M$ are $f^{-s}$ times the generators of $M_f$. Example W = makeWeylAlgebra(QQ[x,y]) - M = W^1/ideal(x*dx + 1, dy) + M = coker gens ideal(x*dx + 1, dy) f = x^2 - y^3 Mfall = DlocalizeAll(M, f) gens image Mfall.LocMap == f^(-Mfall.GeneratorPower) * gens Mfall.LocModule diff --git a/M2/Macaulay2/packages/BernsteinSato/DOC/Drestriction.m2 b/M2/Macaulay2/packages/BernsteinSato/DOC/Drestriction.m2 index fd870b58ece..87cb56db404 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DOC/Drestriction.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DOC/Drestriction.m2 @@ -30,7 +30,7 @@ document { Usage => "Dresolution M, Dresolution I, Dresolution(M,w), Dresolution(I,w)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector" }, Outputs => { @@ -81,14 +81,14 @@ document { } document { - Key => {Drestriction, (Drestriction,ZZ,Module,List), (Drestriction,Ideal,List), - (Drestriction,Module,List), (Drestriction,ZZ,Ideal,List)}, + Key => {Drestriction, (Drestriction,ZZ,Module,List), (Drestriction,LeftIdeal,List), + (Drestriction,Module,List), (Drestriction,ZZ,LeftIdeal,List)}, Headline => "restriction modules of a D-module", Usage => "N = Drestriction(M,w), NI = Drestriction(I,w), Ni = Drestriction(i,M,w), NIi = Drestriction(i,I,w)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector", "i" => ZZ => "nonnegative" }, @@ -131,15 +131,15 @@ document { } document { - Key => {DrestrictionIdeal, (DrestrictionIdeal, Ideal, List)}, + Key => {DrestrictionIdeal, (DrestrictionIdeal, LeftIdeal, List)}, Headline => "restriction ideal of a D-module", Usage => "DrestrictionIdeal(I,w)", Inputs => { - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector" }, Outputs => { - Ideal => {"the restriction ideal of ", EM "M", " w.r.t. the weight vector ", EM "w"} + LeftIdeal => {"the restriction ideal of ", EM "M", " w.r.t. the weight vector ", EM "w"} }, "A supplementary function for ", TO "Drestriction", " that computes the restriction ideal.", @@ -156,12 +156,12 @@ document { } document { - Key => {DrestrictionAll, (DrestrictionAll, Module, List), (DrestrictionAll, Ideal, List)}, + Key => {DrestrictionAll, (DrestrictionAll, Module, List), (DrestrictionAll, LeftIdeal, List)}, Headline => "restriction modules of a D-module (extended version)", Usage => "N = DrestrictionAll(M,w), NI = DrestrictionAll(I,w)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector" }, Outputs => { @@ -184,12 +184,12 @@ document { } document { - Key => {DrestrictionComplex, (DrestrictionComplex, Module, List), (DrestrictionComplex, Ideal, List)}, + Key => {DrestrictionComplex, (DrestrictionComplex, Module, List), (DrestrictionComplex, LeftIdeal, List)}, Headline => "derived restriction complex of a D-module", Usage => "N = DrestrictionComplex(M,w), NI = DrestrictionComplex(I,w)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector" }, Outputs => { @@ -212,14 +212,14 @@ document { document { - Key => {DrestrictionClasses, (DrestrictionClasses,ZZ,Module,List), (DrestrictionClasses,Ideal,List), (DrestrictionClasses,Module,List), - (DrestrictionClasses,ZZ,Ideal,List)}, + Key => {DrestrictionClasses, (DrestrictionClasses,ZZ,Module,List), (DrestrictionClasses,LeftIdeal,List), (DrestrictionClasses,Module,List), + (DrestrictionClasses,ZZ,LeftIdeal,List)}, Headline => "restriction classes of a D-module", Usage => "N = DrestrictionClasses(M,w), NI = DrestrictionClasses(I,w), Ni = DrestrictionClasses(i,M,w), NIi = DrestrictionClasses(i,I,w), ", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector", "i" => ZZ => "nonnegative" }, @@ -297,14 +297,14 @@ document { } document { - Key => { Dintegration, (Dintegration,ZZ,Module,List), (Dintegration,Ideal,List), - (Dintegration,Module,List), (Dintegration,ZZ,Ideal,List) }, + Key => { Dintegration, (Dintegration,ZZ,Module,List), (Dintegration,LeftIdeal,List), + (Dintegration,Module,List), (Dintegration,ZZ,LeftIdeal,List) }, Headline => "integration modules of a D-module", Usage => "N = Dintegration(M,w), NI = Dintegration(I,w), Ni = Dintegration(i,M,w), NIi = Dintegration(i,I,w), ", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector", "i" => ZZ => "nonnegative" }, @@ -344,15 +344,15 @@ document { } document { - Key => {DintegrationIdeal, (DintegrationIdeal, Ideal, List)}, + Key => {DintegrationIdeal, (DintegrationIdeal, LeftIdeal, List)}, Headline => "integration ideal of a D-module", Usage => "DintegrationIdeal(I,w)", Inputs => { - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector" }, Outputs => { - Ideal => {"the integration ideal of ", EM "M", " w.r.t. the weight vector ", EM "w"} + LeftIdeal => {"the integration ideal of ", EM "M", " w.r.t. the weight vector ", EM "w"} }, "A supplementary function for ", TO "Dintegration", " that computes the integration ideal.", @@ -369,12 +369,12 @@ document { } document { - Key => {DintegrationAll, (DintegrationAll, Module, List), (DintegrationAll, Ideal, List)}, + Key => {DintegrationAll, (DintegrationAll, Module, List), (DintegrationAll, LeftIdeal, List)}, Headline => "integration modules of a D-module (extended version)", Usage => "N = DintegrationAll(M,w), NI = DintegrationAll(I,w)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector" }, Outputs => { @@ -397,12 +397,12 @@ document { } document { - Key => {DintegrationComplex, (DintegrationComplex, Module, List), (DintegrationComplex, Ideal, List)}, + Key => {DintegrationComplex, (DintegrationComplex, Module, List), (DintegrationComplex, LeftIdeal, List)}, Headline => "derived integration complex of a D-module", Usage => "N = DintegrationComplex(M,w), NI = DintegrationComplex(I,w)", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector" }, Outputs => { @@ -425,14 +425,14 @@ document { document { - Key => {DintegrationClasses, (DintegrationClasses,ZZ,Module,List), (DintegrationClasses,Ideal,List), (DintegrationClasses,Module,List), - (DintegrationClasses,ZZ,Ideal,List)}, + Key => {DintegrationClasses, (DintegrationClasses,ZZ,Module,List), (DintegrationClasses,LeftIdeal,List), (DintegrationClasses,Module,List), + (DintegrationClasses,ZZ,LeftIdeal,List)}, Headline => "integration classes of a D-module", Usage => "N = DintegrationClasses(M,w), NI = DintegrationClasses(I,w), Ni = DintegrationClasses(i,M,w), NIi = DintegrationClasses(i,I,w), ", Inputs => { "M" => Module => {"over the Weyl algebra ", EM "D"}, - "I" => Ideal => {"which represents the module ", EM "M = D/I"}, + "I" => LeftIdeal => {"which represents the module ", EM "M = D/I"}, "w" => List => "a weight vector", "i" => ZZ => "nonnegative" }, diff --git a/M2/Macaulay2/packages/BernsteinSato/DOC/WeylClosure.m2 b/M2/Macaulay2/packages/BernsteinSato/DOC/WeylClosure.m2 index 06bf8056cd1..a8d877e4495 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DOC/WeylClosure.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DOC/WeylClosure.m2 @@ -1,20 +1,20 @@ doc /// Key WeylClosure - (WeylClosure, Ideal) - (WeylClosure, Ideal, RingElement) + (WeylClosure, LeftIdeal) + (WeylClosure, LeftIdeal, RingElement) Headline Weyl closure of an ideal Usage WeylClosure I WeylClosure(I,f) Inputs - I:Ideal + I:LeftIdeal a left ideal of the Weyl Algebra f:RingElement a polynomial Outputs - :Ideal + :LeftIdeal the Weyl closure (w.r.t. $f$) of $I$ Description Text diff --git a/M2/Macaulay2/packages/BernsteinSato/DOC/annFs.m2 b/M2/Macaulay2/packages/BernsteinSato/DOC/annFs.m2 index dd9cd987851..b17e5399896 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DOC/annFs.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DOC/annFs.m2 @@ -27,7 +27,7 @@ doc /// /// document { - Key => {(AnnIFs, Ideal,RingElement), AnnIFs}, + Key => {(AnnIFs, LeftIdeal,RingElement), AnnIFs}, Headline => "the annihilating ideal of f^s for an arbitrary D-module", Usage => "AnnIFs(I,f)", Inputs => { @@ -40,7 +40,7 @@ document { " (should contain no differential variables)"} }, Outputs => { - Ideal => {"the annihilating ideal of ", TEX "A_n[f^{-1},s] f^s", " tensored with ", + LeftIdeal => {"the annihilating ideal of ", TEX "A_n[f^{-1},s] f^s", " tensored with ", TEX "A_n/I", " over the ring of polynomials" } }, EXAMPLE lines /// diff --git a/M2/Macaulay2/packages/BernsteinSato/DOC/localCohom.m2 b/M2/Macaulay2/packages/BernsteinSato/DOC/localCohom.m2 index a6c57992b3a..390f8010330 100644 --- a/M2/Macaulay2/packages/BernsteinSato/DOC/localCohom.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/DOC/localCohom.m2 @@ -69,20 +69,20 @@ document { Headline => "local cohomology", "Local cohomology of a polynomial ring:", UL { - {TO (localCohom, Ideal)}, - {TO (localCohom, List, Ideal)}, - {TO (localCohom, ZZ, Ideal)} + {TO (localCohom, LeftIdeal)}, + {TO (localCohom, List, LeftIdeal)}, + {TO (localCohom, ZZ, LeftIdeal)} }, "Local cohomology of a holonomic module:", UL { - {TO (localCohom, Ideal, Module)}, - {TO (localCohom, ZZ, Ideal, Module)}, - {TO (localCohom, List, Ideal, Module)} + {TO (localCohom, LeftIdeal, Module)}, + {TO (localCohom, ZZ, LeftIdeal, Module)}, + {TO (localCohom, List, LeftIdeal, Module)} }, SeeAlso => {"pruneLocalCohom"} } document { - Key => (localCohom, Ideal), + Key => (localCohom, LeftIdeal), Headline => "local cohomology of a polynomial ring", Usage => "H = localCohom I", Inputs => { @@ -109,12 +109,12 @@ document { } document { - Key => (localCohom, List, Ideal), + Key => (localCohom, List, LeftIdeal), Headline => "local cohomology of a polynomial ring", Usage => "localCohom(l,I)", Inputs => { "l", "I" }, Outputs => { { "the local cohomology of ", TT "I", " in the degrees specified by ", EM "l" } }, - "See ", TO (localCohom, Ideal), " for the full description.", + "See ", TO (localCohom, LeftIdeal), " for the full description.", EXAMPLE { "W = QQ[X, dX, Y, dY, Z, dZ, WeylAlgebra=>{X=>dX, Y=>dY, Z=>dZ}]", "I = ideal (X*(Y-Z), X*Y*Z)", @@ -125,12 +125,12 @@ document { } document { - Key => (localCohom, ZZ, Ideal), + Key => (localCohom, ZZ, LeftIdeal), Headline => "local cohomology of a polynomial ring", Usage => "localCohom(d,I)", Inputs => { "d", "I" }, Outputs => {{ "the local cohomology of ", TT "I", " in degree ", EM "d" }}, - "See ", TO (localCohom, Ideal), " for the full description.", + "See ", TO (localCohom, LeftIdeal), " for the full description.", EXAMPLE { "W = QQ[X, dX, Y, dY, Z, dZ, WeylAlgebra=>{X=>dX, Y=>dY, Z=>dZ}]", "I = ideal (X*(Y-Z), X*Y*Z)", @@ -141,7 +141,7 @@ document { } document { - Key => (localCohom, Ideal, Module), + Key => (localCohom, LeftIdeal, Module), Headline => "local cohomology of a D-module", Usage => "H = localCohom(I,M)", Inputs => { @@ -163,7 +163,7 @@ document { EXAMPLE { "W = QQ[X, dX, Y, dY, Z, dZ, WeylAlgebra=>{X=>dX, Y=>dY, Z=>dZ}]", "I = ideal (X*(Y-Z), X*Y*Z)", - "h = localCohom(I, W^1 / ideal{dX,dY,dZ})", + "h = localCohom(I, coker gens ideal{dX,dY,dZ})", "pruneLocalCohom h" }, Caveat => {"The modules returned are not simplified, @@ -172,7 +172,7 @@ document { } document { - Key => (localCohom, ZZ, Ideal, Module), + Key => (localCohom, ZZ, LeftIdeal, Module), Headline => "local cohomology of a D-module", Usage => "localCohom(d,I,M)", Inputs => { "d", "I", "M" }, @@ -181,18 +181,18 @@ document { EM {"H", SUB "I", "(M)"}, " in degree ", EM "d", ", where ", EM "I", " is an ideal in a polynomial ring and ", EM "M", " is a D-module" }}, - "See ", TO "localCohom(Ideal,Module)", " for the full description.", + "See ", TO "localCohom(LeftIdeal,Module)", " for the full description.", EXAMPLE { "W = QQ[X, dX, Y, dY, Z, dZ, WeylAlgebra=>{X=>dX, Y=>dY, Z=>dZ}]", "I = ideal (X*(Y-Z), X*Y*Z)", - "h = localCohom(2, I, W^1 / ideal{dX,dY,dZ})", + "h = localCohom(2, I, coker gens ideal{dX,dY,dZ})", "pruneLocalCohom h" }, SeeAlso => {"pruneLocalCohom"} } document { - Key => (localCohom, List, Ideal, Module), + Key => (localCohom, List, LeftIdeal, Module), Headline => "local cohomology of a D-module", Usage => "localCohom(l,I,M)", Inputs => { "l", "I", "M" }, @@ -202,11 +202,11 @@ document { ", where ", EM "I", " is an ideal in a polynomial ring and ", EM "M", " is a D-module" }}, - "See ", TO "localCohom(Ideal,Module)", " for the full description.", + "See ", TO "localCohom(LeftIdeal,Module)", " for the full description.", EXAMPLE { "W = QQ[X, dX, Y, dY, Z, dZ, WeylAlgebra=>{X=>dX, Y=>dY, Z=>dZ}]", "I = ideal (X*(Y-Z), X*Y*Z)", - "h = localCohom({1,2}, I, W^1 / ideal{dX,dY,dZ})", + "h = localCohom({1,2}, I, coker gens ideal{dX,dY,dZ})", "pruneLocalCohom h" }, SeeAlso => {"pruneLocalCohom"} diff --git a/M2/Macaulay2/packages/BernsteinSato/Dlocalize.m2 b/M2/Macaulay2/packages/BernsteinSato/Dlocalize.m2 index 1d4947e91a0..a3a15c93b19 100644 --- a/M2/Macaulay2/packages/BernsteinSato/Dlocalize.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/Dlocalize.m2 @@ -110,7 +110,7 @@ computeLocalization = (M, f, output, options) -> ( bestPower := min (getIntRoots (bpoly)); if bestPower == infinity then bestPower = 0; locIdeal := substitute(substitute(AnnI, {Ws_(ns-1) => bestPower}), W); - locModule := W^1/locIdeal; + locModule := coker gens locIdeal; local locMap; if member (LocMap, output) then ( @@ -122,7 +122,7 @@ computeLocalization = (M, f, output, options) -> ( bestPower = 0; locIdeal = substitute(substitute(AnnI, {Ws_(ns-1) => bestPower}), W); - locModule = W^1/locIdeal; + locModule = coker gens locIdeal; locMap = map(locModule, M, matrix{{f^(-bestPower)}}) ) else locMap = map(locModule, M, matrix{{f^(-bestPower)}}); @@ -315,7 +315,7 @@ computeLocalization = (M, f, output, options) -> ( ) AnnIFs2 = method() -AnnIFs2(Ideal, RingElement) := (I, f) -> ( +AnnIFs2(LeftIdeal, RingElement) := (I, f) -> ( pInfo(1, "computing AnnIFs... "); W := ring I; n := numgens W; @@ -402,7 +402,7 @@ u = symbol u; Du = symbol Du; n = 4; W = QQ[u_1..u_n, Du_1..Du_n, WeylAlgebra => apply(toList(1..n), i -> u_i => Du_i)]; -M = W^1/ideal(Du_1..Du_n); +M = coker gens ideal(Du_1..Du_n); f = sum(toList(1..n), i -> u_i^2); assert(Dlocalize(M, f) == Dlocalize(M, f, Strategy => Oaku)); assert(DlocalizeMap(M, f) == DlocalizeMap(M, f, Strategy => Oaku)); diff --git a/M2/Macaulay2/packages/BernsteinSato/Dresolution.m2 b/M2/Macaulay2/packages/BernsteinSato/Dresolution.m2 index 13f3c81a3ae..a24b3d54488 100644 --- a/M2/Macaulay2/packages/BernsteinSato/Dresolution.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/Dresolution.m2 @@ -100,7 +100,7 @@ Dresolution Module := options -> M -> ( M.cache.resolution ) -Dresolution (LeftIdeal, List) := options -> (I, w) -> Dresolution ((ring I)^1/I, w, options) +Dresolution (LeftIdeal, List) := options -> (I, w) -> Dresolution (coker gens I, w, options) Dresolution (Module, List) := options -> (M, w) -> ( @@ -250,10 +250,8 @@ I = ideal 0_W; J = ideal 1_W; w = {-1,1} assert( Dres(I) == Dres(I, w) ); -assert( Dres(W^1/I) == Dres(W^1/I, w) ); assert( Dres(module I) == Dres(module I, w) ); assert( Dres(J) == Dres(J, w) ); -assert( Dres(W^1/J) == Dres(W^1/J, w) ); assert( Dres (module J) == Dres(module J, w) ); -- Resolutions in the same res Grobner cone diff --git a/M2/Macaulay2/packages/BernsteinSato/Drestriction.m2 b/M2/Macaulay2/packages/BernsteinSato/Drestriction.m2 index 9b5b3be75e4..b2405dcf39a 100644 --- a/M2/Macaulay2/packages/BernsteinSato/Drestriction.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/Drestriction.m2 @@ -72,7 +72,7 @@ ensureQuotientModule(Module, String) := (M,errorString) -> ( -------------------------------------------------------------------------------- Drestriction = method( Options => {Strategy => Schreyer} ) -Drestriction(Ideal, List) := options -> (I,w) -> Drestriction(comodule I, w, options) +Drestriction(LeftIdeal, List) := options -> (I,w) -> Drestriction(comodule I, w, options) Drestriction(Module, List) := options -> (M,w) -> ( ensureQuotientModule(M, "Drestriction currently only handles quotient modules"); @@ -83,7 +83,7 @@ Drestriction(Module, List) := options -> (M,w) -> ( outputTable#HomologyModules ) -Drestriction(ZZ, Ideal, List) := options -> (k,I,w) -> Drestriction (k, comodule I, w, options) +Drestriction(ZZ, LeftIdeal, List) := options -> (k,I,w) -> Drestriction (k, comodule I, w, options) Drestriction(ZZ,Module,List) := options -> (k,M,w) -> ( ensureQuotientModule(M, "Drestriction currently only handles quotient modules"); @@ -101,7 +101,7 @@ Drestriction(ZZ,Module,List) := options -> (k,M,w) -> ( -------------------------------------------------------------------------------- DrestrictionClasses = method( Options => {Strategy => Schreyer} ) -DrestrictionClasses(Ideal, List) := options -> (I,w) -> DrestrictionClasses(comodule I, w, options) +DrestrictionClasses(LeftIdeal, List) := options -> (I,w) -> DrestrictionClasses(comodule I, w, options) DrestrictionClasses(Module, List) := options -> (M,w) -> ( ensureQuotientModule(M, "Drestriction currently only handles quotient modules"); @@ -116,7 +116,7 @@ DrestrictionClasses(Module, List) := options -> (M,w) -> ( outputTable ) -DrestrictionClasses(ZZ, Ideal, List) := options -> (k,I,w) -> DrestrictionClasses (k, comodule I, w, options) +DrestrictionClasses(ZZ, LeftIdeal, List) := options -> (k,I,w) -> DrestrictionClasses (k, comodule I, w, options) DrestrictionClasses(ZZ,Module,List) := options -> (k,M,w) -> ( ensureQuotientModule(M, "Drestriction currently only handles quotient modules"); @@ -147,8 +147,8 @@ DrestrictionClasses(ZZ,Module,List) := options -> (k,M,w) -> ( -------------------------------------------------------------------------------- DrestrictionComplex = method( Options => {Strategy => Schreyer} ) -DrestrictionComplex(Ideal,List) := options -> (I,w) -> ( - DrestrictionComplex ((ring I)^1/I, w, options) ) +DrestrictionComplex(LeftIdeal,List) := options -> (I,w) -> ( + DrestrictionComplex (coker gens I, w, options) ) protect RestrictComplex @@ -165,10 +165,10 @@ DrestrictionComplex(Module, List) := options -> (M,w) -> ( -------------------------------------------------------------------------------- DrestrictionIdeal = method( Options => {Strategy => Schreyer} ) -DrestrictionIdeal(Ideal,List) := options -> (I,w) -> ( +DrestrictionIdeal(LeftIdeal,List) := options -> (I,w) -> ( d := #positions(w, i -> (i>0)); outputRequest := {RestrictComplex, Explicit}; - outputTable := computeRestriction ((ring I)^1/I, w, -1, 1, + outputTable := computeRestriction (coker gens I, w, -1, 1, outputRequest, options); M := cokernel (outputTable#RestrictComplex).dd#1; R := ring M; @@ -184,8 +184,8 @@ DrestrictionIdeal(Ideal,List) := options -> (I,w) -> ( -------------------------------------------------------------------------------- DrestrictionAll = method( Options => {Strategy => Schreyer} ) -DrestrictionAll(Ideal,List) := options -> (I,w) -> ( - DrestrictionAll ((ring I)^1/I, w, options) ) +DrestrictionAll(LeftIdeal,List) := options -> (I,w) -> ( + DrestrictionAll (coker gens I, w, options) ) DrestrictionAll(Module, List) := options -> (M,w) -> ( ensureQuotientModule(M, @@ -212,8 +212,8 @@ DrestrictionAll(Module, List) := options -> (M,w) -> ( -------------------------------------------------------------------------------- Dintegration = method( Options => {Strategy => Schreyer} ) -Dintegration(Ideal,List) := options -> (I,w) -> ( - Dintegration ((ring I)^1/I, w, options) ) +Dintegration(LeftIdeal,List) := options -> (I,w) -> ( + Dintegration (coker gens I, w, options) ) Dintegration(Module, List) := options -> (M,w) -> ( W := ring M; @@ -235,8 +235,8 @@ Dintegration(Module, List) := options -> (M,w) -> ( Mout ) -Dintegration(ZZ, Ideal, List) := options -> (k,I,w) -> ( - Dintegration (k, (ring I)^1/I, w, options) ) +Dintegration(ZZ, LeftIdeal, List) := options -> (k,I,w) -> ( + Dintegration (k, coker gens I, w, options) ) Dintegration(ZZ, Module, List) := options -> (k,M,w) -> ( W := ring M; @@ -261,8 +261,8 @@ Dintegration(ZZ, Module, List) := options -> (k,M,w) -> ( -------------------------------------------------------------------------------- DintegrationClasses = method( Options => {Strategy => Schreyer} ) -DintegrationClasses(Ideal,List) := options -> (I,w) -> ( - DintegrationClasses ((ring I)^1/I, w, options) ) +DintegrationClasses(LeftIdeal,List) := options -> (I,w) -> ( + DintegrationClasses (coker gens I, w, options) ) DintegrationClasses(Module, List) := options -> (M,w) -> ( W := ring M; @@ -294,8 +294,8 @@ DintegrationClasses(Module, List) := options -> (M,w) -> ( hashTable outputList ) -DintegrationClasses(ZZ,Ideal,List) := options -> (k,I,w) -> ( - DintegrationClasses (k, (ring I)^1/I, w, options) ) +DintegrationClasses(ZZ,LeftIdeal,List) := options -> (k,I,w) -> ( + DintegrationClasses (k, coker gens I, w, options) ) DintegrationClasses(ZZ,Module,List) := options -> (k,M,w) -> ( W := ring M; @@ -343,8 +343,8 @@ DintegrationClasses(ZZ,Module,List) := options -> (k,M,w) -> ( -------------------------------------------------------------------------------- DintegrationComplex = method( Options => {Strategy => Schreyer} ) -DintegrationComplex(Ideal, List) := options -> (I,w) -> ( - DintegrationComplex ((ring I)^1/I, w, options) ) +DintegrationComplex(LeftIdeal, List) := options -> (I,w) -> ( + DintegrationComplex (coker gens I, w, options) ) DintegrationComplex(Module, List) := options -> (M,w) -> ( W := ring M; @@ -365,13 +365,13 @@ DintegrationComplex(Module, List) := options -> (M,w) -> ( -------------------------------------------------------------------------------- DintegrationIdeal = method( Options => {Strategy => Schreyer} ) -DintegrationIdeal(Ideal,List) := options -> (I,w) -> ( +DintegrationIdeal(LeftIdeal,List) := options -> (I,w) -> ( W := ring I; d := #positions(w, i -> (i>0)); n := numgens W; IF := Fourier I; outputRequest := {RestrictComplex, Explicit}; - outputTable := computeRestriction (W^1/IF, w, -1, 1, + outputTable := computeRestriction (coker gens IF, w, -1, 1, outputRequest, options); M := cokernel (outputTable#RestrictComplex).dd#1; resW := ring M; @@ -390,8 +390,8 @@ DintegrationIdeal(Ideal,List) := options -> (I,w) -> ( -------------------------------------------------------------------------------- DintegrationAll = method( Options => {Strategy => Schreyer} ) -DintegrationAll(Ideal,List) := options -> (I,w) -> ( - DintegrationAll ((ring I)^1/I, w, options) ) +DintegrationAll(LeftIdeal,List) := options -> (I,w) -> ( + DintegrationAll (coker gens I, w, options) ) DintegrationAll(Module, List) := options -> (M,w) -> ( W := ring M; diff --git a/M2/Macaulay2/packages/BernsteinSato/TST/tests.m2 b/M2/Macaulay2/packages/BernsteinSato/TST/tests.m2 index b4c3e2a96fb..a878c52db5d 100644 --- a/M2/Macaulay2/packages/BernsteinSato/TST/tests.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/TST/tests.m2 @@ -7,7 +7,7 @@ TEST /// I = PolyAnn f; J = RatAnn f; K = RatAnn (u-v^2, f); - L = directSum (W^1/I, W^1/J); + L = directSum (coker gens I, coker gens J); assert ( isHolonomic I ); assert ( isHolonomic J ); assert ( isHolonomic K ); diff --git a/M2/Macaulay2/packages/BernsteinSato/WeylClosure.m2 b/M2/Macaulay2/packages/BernsteinSato/WeylClosure.m2 index 77ec81aaded..6d01bd4b4ba 100644 --- a/M2/Macaulay2/packages/BernsteinSato/WeylClosure.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/WeylClosure.m2 @@ -8,7 +8,7 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- WeylClosure = method() -WeylClosure(Ideal, RingElement) := (I, f) -> ( +WeylClosure(LeftIdeal, RingElement) := (I, f) -> ( W := ring I; if W.monoid.Options.WeylAlgebra === {} then error "Expected a Weyl algebra" ; @@ -22,7 +22,7 @@ WeylClosure(Ideal, RingElement) := (I, f) -> ( ideal gens gb J ) -WeylClosure Ideal := I -> ( +WeylClosure LeftIdeal := I -> ( W := ring I; outputList :={}; if W.monoid.Options.WeylAlgebra === {} then @@ -66,4 +66,4 @@ f = (x^3-y^2*z^2); I = ideal(f^2*Dx+3*x^2, f^2*Dy-2*y*z^2, f^2*Dz-2*y^2*z); assert ( WeylClosure(I) == I + ideal(y*Dy-z*Dz, y^2*z^3*Dz-(2/3)*x^4*Dx-2*x^3*z*Dz-2)); -/// \ No newline at end of file +/// diff --git a/M2/Macaulay2/packages/BernsteinSato/annFs.m2 b/M2/Macaulay2/packages/BernsteinSato/annFs.m2 index 397dfe2886f..db98d2275b2 100644 --- a/M2/Macaulay2/packages/BernsteinSato/annFs.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/annFs.m2 @@ -4,7 +4,7 @@ --------------------------------------------------------------------------------- AnnFs = method() -AnnFs RingElement := Ideal => f -> ( +AnnFs RingElement := LeftIdeal => f -> ( -- Input: f, a polynomial in n variables -- (has to be an element of A_n, the Weyl algebra). -- Output: Ann f^s, an ideal in A_n[s]. @@ -67,7 +67,7 @@ MalgrangeIdeal List := Ideal => F -> ( ------------------------------------------------------------------------------ --This needs documentation. AnnIFs = method() -AnnIFs(Ideal, RingElement) := Ideal => (I, f) -> ( +AnnIFs(LeftIdeal, RingElement) := LeftIdeal => (I, f) -> ( pInfo(1, "AnnIFs: Warning! The method expects an f-saturated module"); W := ring I; createDpairs W; @@ -354,7 +354,7 @@ rationalFunctionAnnihilator(RingElement, RingElement) := (g,f) -> ( if a == -1 and g == 1_W then Ia else ( compensate := -1 - a; - F := map(W^1/Ia, W^1, matrix{{g*f^compensate}}); + F := map(coker gens Ia, W^1, matrix{{g*f^compensate}}); ideal mingens kernel F) ) diff --git a/M2/Macaulay2/packages/BernsteinSato/intersectionCohom.m2 b/M2/Macaulay2/packages/BernsteinSato/intersectionCohom.m2 index fd3defcae04..7b4a235aef5 100644 --- a/M2/Macaulay2/packages/BernsteinSato/intersectionCohom.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/intersectionCohom.m2 @@ -27,7 +27,7 @@ IHmodule(Ideal) := options -> I -> ( for i from 0 to c-1 do J=J+ideal(sub(g#i,W)); -- submodule of H^c_I(R) generated by F^-1 m := minors (c,jacobian(I)); l := (flatten entries (mingens m))#0; - image map(W^1/J, W^1, matrix{{sub(l,W)}}) -- D-mod generated by fundamental class + image map(coker gens J, W^1, matrix{{sub(l,W)}}) -- D-mod generated by fundamental class ) else ( S := flatten entries mingens(ideal singularLocus P); diff --git a/M2/Macaulay2/packages/BernsteinSato/localCohom.m2 b/M2/Macaulay2/packages/BernsteinSato/localCohom.m2 index 7bafd7f12b7..4a95715ae38 100644 --- a/M2/Macaulay2/packages/BernsteinSato/localCohom.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/localCohom.m2 @@ -18,9 +18,9 @@ localCohom = method(Options => {Strategy => Walther, LocStrategy => null}) -- option: Strategy (sets the way localizations are computed) ---------------------------------------------------------------------------------------- -localCohom( Ideal) := HashTable => o -> I -> localCohom(toList (0..numgens I), I, o) -localCohom(ZZ, Ideal) := HashTable => o -> (n,I) -> (localCohom({n}, I, o))#n -localCohom(List, Ideal) := HashTable => o -> (l,I) -> ( +localCohom( LeftIdeal) := HashTable => o -> I -> localCohom(toList (0..numgens I), I, o) +localCohom(ZZ, LeftIdeal) := HashTable => o -> (n,I) -> (localCohom({n}, I, o))#n +localCohom(List, LeftIdeal) := HashTable => o -> (l,I) -> ( -- Promote I to the Weyl algebra if it is not already there if #(ring I).monoid.Options.WeylAlgebra == 0 then I = sub(I, makeWA ring I); -- TODO: what degrees are best for the differentials? @@ -30,7 +30,7 @@ localCohom(List, Ideal) := HashTable => o -> (l,I) -> ( else ( R := ring I; createDpairs R; - localCohom(l, I, R^1 / ideal R.dpairVars#1, o) + localCohom(l, I, coker gens ideal R.dpairVars#1, o) ) ); @@ -104,9 +104,9 @@ localCohomUli = (l, I) -> ( -- option: Strategy (sets the way localizations are computed) ---------------------------------------------------------------------- -localCohom( Ideal, Module) := HashTable => o -> (I,M) -> localCohom(toList (0..numgens I), I, M, o) -localCohom(ZZ, Ideal, Module) := HashTable => o -> (n,I,M) -> localCohom({n}, I, M, o) -localCohom(List, Ideal, Module) := HashTable => o -> (l,I,M) -> ( +localCohom( LeftIdeal, Module) := HashTable => o -> (I,M) -> localCohom(toList (0..numgens I), I, M, o) +localCohom(ZZ, LeftIdeal, Module) := HashTable => o -> (n,I,M) -> localCohom({n}, I, M, o) +localCohom(List, LeftIdeal, Module) := HashTable => o -> (l,I,M) -> ( -- Promote I to the Weyl algebra if it is not already there if #(ring I).monoid.Options.WeylAlgebra == 0 then ( @@ -130,7 +130,7 @@ localCohom(List, Ideal, Module) := HashTable => o -> (l,I,M) -> ( -- iterated localizations + localize by Oaku ---------------------------------------------------------- localCohomILOaku = method() -localCohomILOaku(List, Ideal, Module) := (l, I, M) -> ( +localCohomILOaku(List, LeftIdeal, Module) := (l, I, M) -> ( -- error checking to be added -- I is assumed to be an ideal in WA generated by polynomials f := first entries gens I; @@ -169,7 +169,7 @@ localCohomILOaku(List, Ideal, Module) := (l, I, M) -> ( subMap := map(W, ring I, vars W | matrix {{(FPower#i)_W}}); locIdeal := ideal subMap gens I; L#theta = new HashTable from { - LocModule => W^1/locIdeal, + LocModule => coker gens locIdeal, Generator => L#theta'#Generator * (f_i)^(-FPower#i) }; theta => L#theta#LocModule @@ -220,7 +220,7 @@ localCohomILOaku(List, Ideal, Module) := (l, I, M) -> ( -- iterated localizations + localize by OTW ---------------------------------------------------------- localCohomILOTW = method() -localCohomILOTW(List, Ideal, Module) := (l, I, M) -> ( +localCohomILOTW(List, LeftIdeal, Module) := (l, I, M) -> ( -- error checking to be added -- I is assumed to be an ideal in WA generated by polynomials f := first entries gens I; @@ -298,7 +298,7 @@ localCohomILOTW(List, Ideal, Module) := (l, I, M) -> ( -- caveat: not smart, does not iterate localizations. ---------------------------------------------------------------------------------------- localCohomRegular = method() -localCohomRegular(List,Ideal,Module) := (l, I, M) -> ( +localCohomRegular(List,LeftIdeal,Module) := (l, I, M) -> ( -- error checking to be added -- I is assumed to be an ideal in WA generated by polynomials f := first entries gens I; @@ -383,13 +383,13 @@ pruneLocalCohom(HashTable) := HashTable => h -> ( -------------------------------------------------------------------------------- localCohomOT = method() -localCohomOT(Ideal, Ideal) := (I, J) -> ( - if not J.?quotient then J.quotient = (ring J)^1/J; +localCohomOT(LeftIdeal, LeftIdeal) := (I, J) -> ( + if not J.?quotient then J.quotient = coker gens J; localCohomOT(I, J.quotient) ) -localCohomOT(Ideal, Module) := (I, M) -> computeLocalCohomOT(I, M, 0, min(numgens I, (dim ring I)//2)) +localCohomOT(LeftIdeal, Module) := (I, M) -> computeLocalCohomOT(I, M, 0, min(numgens I, (dim ring I)//2)) -localCohomOT(List, Ideal, Module) := (l, I, M) -> ( +localCohomOT(List, LeftIdeal, Module) := (l, I, M) -> ( locOut := computeLocalCohomOT(I, M, min l, max l); locOut = hashTable apply(keys locOut, i -> if member(i, l) then i => locOut#i); @@ -461,7 +461,7 @@ I = ideal (x*(y-z), x*y*z) J = ideal (dx, dy, dz) time h = localCohom I -time h = localCohom (I, W^1/J, Strategy=>Walther) +time h = localCohom (I, coker gens J, Strategy=>Walther) time h = localCohom (I, Strategy=>Walther, LocStrategy=>OaTaWa) time h = localCohom (I, Strategy=>Walther, LocStrategy=>Oaku) time h = localCohom (I, Strategy=>OaTa) @@ -473,7 +473,7 @@ J = ideal (dx, dy); K = ideal(x^3,y^3); time h = localCohom I -time h = localCohom (I, W^1/J, Strategy=>Walther) +time h = localCohom (I, coker gens J, Strategy=>Walther) time h = localCohom (I, Strategy=>Walther, LocStrategy=>OTW) time h = localCohom (I, Strategy=>Walther, LocStrategy=>Oaku) time h = localCohom (I, Strategy=>OaTa) @@ -486,14 +486,14 @@ assert (rank L#1 == 0); assert (rank L#2 == 1); Mat = Dprune localCohom(2,I); assert (sub((minimalPrimes charIdeal Mat)_0,W)==ideal(x,y)); -L' = localCohom (m, W^1/K, Strategy=>OaTa); -assert (L'#0==W^1/ideal(x^3,y^3)); +L' = localCohom (m, coker gens K, Strategy=>OaTa); +assert (L'#0==coker gens ideal(x^3,y^3)); --------------------------------------------------------------- x = symbol x; dx = symbol dx; W = QQ[x, dx, WeylAlgebra=>{x=>dx}] I = ideal {x, x^2, x^2+x, x^3, x^4+2*x} -M = W^1 / ideal dx +M = coker gens ideal dx time h = localCohom (I, M, Strategy=>Walther, LocStrategy=>Oaku) time h' = localCohom (ideal x) h = pruneLocalCohom h diff --git a/M2/Macaulay2/packages/BernsteinSato/multiplierIdeals.m2 b/M2/Macaulay2/packages/BernsteinSato/multiplierIdeals.m2 index ebac78d3cf2..d104688d728 100644 --- a/M2/Macaulay2/packages/BernsteinSato/multiplierIdeals.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/multiplierIdeals.m2 @@ -26,7 +26,7 @@ isInMultiplierIdeal(RingElement, Ideal, QQ) := o -> (g,I,c) -> ( powerIdealZZ = method() powerIdealZZ(LeftIdeal,ZZ) := (I,n) -> ideal symmetricPower(n,generators I) quotientInWeylAlgebra = method() -quotientInWeylAlgebra(LeftIdeal,RingElement) := (I,f) -> (new Ideal from I) : (new Ideal from ideal f) +quotientInWeylAlgebra(LeftIdeal,RingElement) := (I,f) -> quotient(I,f) productInWeylAlgebra = method() productInWeylAlgebra(RingElement,LeftIdeal) := (f,I) -> f * (new Ideal from ideal I) diff --git a/M2/Macaulay2/packages/BernsteinSato/paramBpoly.m2 b/M2/Macaulay2/packages/BernsteinSato/paramBpoly.m2 index 68d4b7bd4c6..7143b8f697a 100644 --- a/M2/Macaulay2/packages/BernsteinSato/paramBpoly.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/paramBpoly.m2 @@ -535,7 +535,7 @@ gbWparam(Ideal, List) := (I, w) -> ( -- computes in_w(I). The result is a WA ideal (as opposed to -- an ideal in the associated commutative ring) inWparam = method() -inWparam(Ideal,List) := (I, w) -> ( +inWparam(LeftIdeal,List) := (I, w) -> ( I2 := homGBparam(I, w); GB := paramGB (I2); I3 := leadTerm(1, gensGB GB); @@ -923,8 +923,9 @@ isdivisible := (f,g) -> ( -- ChangeMatrix=>false: option -- output: { Groebner basis generators for I [, changematrix] } -paramGB = I -> ( - if class I === Ideal then I = gens I; +paramGB = method() +paramGB LeftIdeal := I -> paramGB gens I +paramGB Matrix := I -> ( R := ring I; WAflag := R.monoid.Options.WeylAlgebra =!= {}; if WAflag then ( diff --git a/M2/Macaulay2/packages/Saturation.m2 b/M2/Macaulay2/packages/Saturation.m2 index ef46f130b68..0a024fa3cd6 100644 --- a/M2/Macaulay2/packages/Saturation.m2 +++ b/M2/Macaulay2/packages/Saturation.m2 @@ -49,6 +49,7 @@ override' := (def, opts) -> nonnull apply(keys def, key -> if opts#?key and opts ambient' = method() ambient' Module := Module => ambient ambient' Ideal := Ideal => I -> (if instance(I, MonomialIdeal) then monomialIdeal else ideal) 1_(ring I) +ambient' LeftIdeal := LeftIdeal => I -> ideal 1_(ring I) -- TODO: remove this once the Ideal vs. MonomialIdeal dichotomy is resolved uniform' := L -> all(L, l -> instance(l, Ideal)) or uniform L @@ -123,7 +124,7 @@ QuotientComputation = new Type of Computation QuotientComputation.synonym = "quotient computation" -- TODO: try to find a compatible context that can be used in the computation -new QuotientContext from Sequence := (C, S) -> ( (A, B) := S; QuotientContext{ mingens B } ) +new QuotientContext from Sequence := (C, S) -> ( (A, B) := S; QuotientContext{ if instance(B,RingElement) then matrix{{B}} else mingens B } ) new QuotientComputation from Sequence := (C, S) -> new QuotientComputation from { BasisElementLimit => (S#2).BasisElementLimit, DegreeLimit => (S#2).DegreeLimit, @@ -151,6 +152,9 @@ Ideal : Ideal := Ideal => (I, J) -> quotient(I, J) Ideal : Number := Ideal : RingElement := Ideal => (I, f) -> quotient(I, f) +-- LeftIdeal +quotient(LeftIdeal, RingElement) := LeftIdeal => opts -> (I, f) -> quotientHelper(I, f, (quotient, LeftIdeal, RingElement), opts) + -- TODO: why is this the right thing to do? quotient(MonomialIdeal, RingElement) := MonomialIdeal => opts -> (I, f) -> ( quotient(I, if size f === 1 and leadCoefficient f == 1 then monomialIdeal f else ideal f, opts)) @@ -183,19 +187,19 @@ quotientHelper = (A, B, key, opts) -> ( -- this logic runs the strategies in order, or the specified strategy computation := (opts, container) -> ( if R =!= ring B then error "expected objects in the same ring"; - if instance(B, RingElement) then B = ideal B; - if uniform' {A, B} and ambient' A != ambient' B + idealOrModuleB := if instance(B, RingElement) then ideal B else B; + if uniform' {A, idealOrModuleB} and ambient' A != ambient' idealOrModuleB then error "expected objects to be contained in the same ambient object"; -- note: if B \subset A then A:B should be "everything", but computing -- a gb for A can be slow, so isSubset' doesn't compute a gb - if isSubset'(B, A) then return if uniform' {A, B} then cast 1_R else ambient' A; + if isSubset'(idealOrModuleB, A) then return if uniform' {A, idealOrModuleB} then cast 1_R else ambient' A; -- note: ideal(..A..) : f = A <==> f is nzd / A -- note: ideal(..A..) : ideal(..B..) = A <==> -- note: module(.A.) : ideal(..B..) = A <==> B is not contained in any associated primes of A -- TODO: can either of the above be efficiently checked? -- TODO: module(.A.) : module(.B.) = ? <==> A \subset B - if instance(B, Ideal) then -- see the above TODO item - if isSubset'(ambient' A, B) then return A; + if instance(idealOrModuleB, Ideal) then -- see the above TODO item + if isSubset'(ambient' A, idealOrModuleB) then return A; -- TODO: add speedup for when isSubset'(A, B), being cautious of (a3):(a3,bc) in kk[abc]/ac -- TODO: what would adding {SyzygyLimit => opts.BasisElementLimit, BasisElementLimit => null} do? @@ -263,6 +267,22 @@ algorithms#(quotient, Ideal, Ideal) = new MutableHashTable from { scan({Quotient, Iterate-*, Linear*-, Monomial}, strategy -> addHook(key := (quotient, Ideal, Ideal), algorithms#key#strategy, Strategy => strategy)) +-- Installing a hook for LeftIdeal : RingElement +addHook( + (quotient, LeftIdeal, RingElement), + (opts, I, f) -> ( + R := ring I; + g := syz gb( + matrix{{f}} | gens I, + opts, + Strategy => LongPolynomial, + Syzygies => true, + SyzygyRows => 1); + ideal g + ), + Strategy => Quotient + ) + -------------------------------------------------------------------- -- Algorithms for Module : Ideal algorithms#(quotient, Module, Ideal) = new MutableHashTable from { From 401837d2a0fdc24946b8365c22919acd7dbf95db Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Thu, 30 Nov 2023 08:08:22 -0500 Subject: [PATCH 07/14] one more B-S method needed LeftIdeal --- M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 | 2 +- M2/Macaulay2/packages/BernsteinSato/localCohom.m2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 b/M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 index 12ebed03374..a7909363b17 100644 --- a/M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/globalBFunction.m2 @@ -79,7 +79,7 @@ globalRB (RingElement,Boolean) := RingElement => (f,isRed) -> ( globalRBAnnFs(f, AnnI, isRed); ) -globalRBAnnFs (RingElement,Ideal,Boolean) := RingElement => (f,AnnI,isRed) -> ( +globalRBAnnFs (RingElement,LeftIdeal,Boolean) := RingElement => (f,AnnI,isRed) -> ( W := ring f; Ws := ring AnnI; ns := numgens Ws; diff --git a/M2/Macaulay2/packages/BernsteinSato/localCohom.m2 b/M2/Macaulay2/packages/BernsteinSato/localCohom.m2 index 4a95715ae38..7dfda741eec 100644 --- a/M2/Macaulay2/packages/BernsteinSato/localCohom.m2 +++ b/M2/Macaulay2/packages/BernsteinSato/localCohom.m2 @@ -71,7 +71,7 @@ localCohomUli = (l, I) -> ( -- Step 3. -- Compute the Cech complex - C := applyValues(subISets, S -> directSum apply(S, theta -> (theta => W^1 / J#theta))); + C := applyValues(subISets, S -> directSum apply(S, theta -> (theta => coker gens J#theta))); M := new HashTable from apply(Lmaps, k -> k => map (C#(k+1), C#k, (i,j) -> ( i0 := (indices C#k)_j; j0 := (indices C#(k+1))_i; From 3ec8cd7373e3b54cfe5228fd63d0a41ff9853575 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Thu, 7 Dec 2023 11:02:29 -0500 Subject: [PATCH 08/14] lift and eliminate take LeftIdeal now --- M2/Macaulay2/m2/matrix1.m2 | 2 +- M2/Macaulay2/m2/matrix2.m2 | 2 +- M2/Macaulay2/packages/Elimination.m2 | 21 ++++++++----------- .../Macaulay2Doc/functions/lift-doc.m2 | 10 ++++----- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/M2/Macaulay2/m2/matrix1.m2 b/M2/Macaulay2/m2/matrix1.m2 index 980a2616717..fc01daa3c8a 100644 --- a/M2/Macaulay2/m2/matrix1.m2 +++ b/M2/Macaulay2/m2/matrix1.m2 @@ -674,7 +674,7 @@ isSurjective Matrix := (f) -> cokernel f == 0 -- two-sided ideal expected scan({ZZ,QQ}, S -> ( - lift(Ideal,S) := opts -> (I,S) -> ( + lift(LeftIdeal,S) := opts -> (I,S) -> ( -- this will be pretty slow if ring I === S then I else (ideal lift(generators I,S,opts)) + ideal (presentation ring I ** S)))); diff --git a/M2/Macaulay2/m2/matrix2.m2 b/M2/Macaulay2/m2/matrix2.m2 index 077664457ea..c0a3d40cc4c 100644 --- a/M2/Macaulay2/m2/matrix2.m2 +++ b/M2/Macaulay2/m2/matrix2.m2 @@ -680,7 +680,7 @@ newCoordinateSystem(PolynomialRing, Matrix) := (S,x) -> ( ( map(S,R,vars S * toS n), map(R,S,vars R * n^(-1)) ) ) -lift(Ideal,RingElement) := Ideal => opts -> (I,S) -> ( +lift(LeftIdeal,RingElement) := Ideal => opts -> (I,S) -> ( -- provisional, just for quotient rings T := ring I; if T === S then I diff --git a/M2/Macaulay2/packages/Elimination.m2 b/M2/Macaulay2/packages/Elimination.m2 index 69c09b8c842..dc2de84c8b1 100644 --- a/M2/Macaulay2/packages/Elimination.m2 +++ b/M2/Macaulay2/packages/Elimination.m2 @@ -81,7 +81,7 @@ eliminate1 = (elimindices,I) -> ( ideal mingens ideal toR selectInSubring(1,generators gb J) ) -eliminate (List, Ideal) := (v,I) -> ( +eliminate (List, LeftIdeal) := (v,I) -> ( R := ring I; -- if R is a quotient ring, then give error if not isFlatPolynomialRing R then @@ -92,9 +92,9 @@ eliminate (List, Ideal) := (v,I) -> ( eliminate1(varlist, I) ) -eliminate (Ideal, RingElement) := (I,v) -> eliminate({v},I) -eliminate (Ideal, List) := (I,v) -> eliminate(v,I) -eliminate(RingElement, Ideal) := (v,I) -> eliminate({v},I) +eliminate (LeftIdeal, RingElement) := (I,v) -> eliminate({v},I) +eliminate (LeftIdeal, List) := (I,v) -> eliminate(v,I) +eliminate(RingElement, LeftIdeal) := (v,I) -> eliminate({v},I) ----------------------------------------------- -- Sylvester matrix, resultant, discriminant -- @@ -173,17 +173,14 @@ document { SeeAlso => {"sylvesterMatrix", "discriminant", "eliminate"} } - -undocumented { - (eliminate, Ideal, RingElement), - (eliminate, Ideal, List) - } document { Key => {eliminate, - (eliminate, RingElement, Ideal), - (eliminate, List, Ideal) + (eliminate, RingElement, LeftIdeal), + (eliminate, LeftIdeal, RingElement), + (eliminate, LeftIdeal, List), + (eliminate, List, LeftIdeal) }, - Usage => "eliminate(v,J)", + Usage => "eliminate(v,J)\neliminate(J,v)", Inputs => { "v" => Nothing => {ofClass RingElement, " or ", ofClass List, ", a variable or list of variables of a polynomial ring ", TT "R"}, "J" => Ideal => {"in the ring ", TT "R"}, diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/lift-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/lift-doc.m2 index fdf1168cc71..6709cc5e736 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/lift-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/lift-doc.m2 @@ -18,13 +18,13 @@ lift(MutableMatrix,type of RingElement) document { Key => {lift, - (lift,Ideal,RingElement),[lift,Verify], + (lift,LeftIdeal,RingElement),[lift,Verify], (lift,Matrix,RingElement), (lift, CC, QQ), (lift, CC, RR_*), (lift, CC, ZZ), - (lift, Ideal, QQ), - (lift, Ideal, ZZ), + (lift, LeftIdeal, QQ), + (lift, LeftIdeal, ZZ), (lift,Matrix,CC_*,QQ), (lift,Matrix,CC_*,RR_*), (lift,Matrix,CC_*,ZZ), @@ -54,14 +54,14 @@ document { Usage => "lift(f,R)", Inputs => { "f" => {"a ", TO2(RingElement,"ring element"), ", ", - TO2(Ideal, "ideal"), ", or ", + TO2(LeftIdeal, "ideal"), ", or ", TO2(Matrix, "matrix")}, "R" => Ring, Verify => Boolean => {"whether to give an error message if lifting is not possible, or, alternatively, to return ", TO "null"} }, Outputs => { {"a ", TO2(RingElement,"ring element"), ", ", - TO2(Ideal, "ideal"), ", or ", + TO2(LeftIdeal, "ideal"), ", or ", TO2(Matrix, "matrix"), ", over the ring ", TT "R"} }, PARA { From caa7271226ca83f5b32af28956fc3715bc9a1c88 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Sat, 9 Dec 2023 10:13:03 -0500 Subject: [PATCH 09/14] fixes in Core and ComputationsBook; Module / LeftIdeal special usage for backward compatibility; Matrix % LeftIdeal convenience implementation (no good meaning for the output as a map of one-sided Modules) --- M2/Macaulay2/m2/matrix1.m2 | 14 ++++---- M2/Macaulay2/m2/newring.m2 | 5 ++- .../tests/ComputationsBook/d-modules/test.m2 | 6 ++-- .../d-modules/test.out.expected | 32 +++++++++---------- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/M2/Macaulay2/m2/matrix1.m2 b/M2/Macaulay2/m2/matrix1.m2 index fc01daa3c8a..00359d3c8c7 100644 --- a/M2/Macaulay2/m2/matrix1.m2 +++ b/M2/Macaulay2/m2/matrix1.m2 @@ -493,6 +493,11 @@ LeftIdeal / LeftIdeal := Module => (I,J) -> module I / module J -- two-sided ideal expected Module / Ideal := Module => (M,J) -> M / (J * M) +Module / LeftIdeal := Module => (M,J) -> ( + if isFreeModule M and rank M == 1 + then comodule J + else "not defined for a left ideal (in general)" + ) LeftIdeal#AfterPrint = LeftIdeal#AfterNoPrint = I -> (LeftIdeal," of ",ring I) Ideal#AfterPrint = Ideal#AfterNoPrint = I -> (Ideal," of ",ring I) @@ -509,12 +514,9 @@ RingElement + LeftIdeal := Number + LeftIdeal := ((r,I) -> ideal r + I) @@ tosam LeftIdeal _ ZZ := RingElement => (I,n) -> (generators I)_(0,n) -Matrix % LeftIdeal := Matrix => ((f,I) -> - if numRows f === 1 - then f % gb I - else - error "not implemented (defined for two-sided ideals; see `code (symbol %, Matrix, Ideal)`)" - ) @@ samering +-- Matrix % Ideal is a convenience function... and so is Matrix % LeftIdeal +-- the result of the latter has even less (natural) meaning as a map (on a one-sided module) +Matrix % LeftIdeal := Matrix => ((f,I) -> map(target f, source f, apply(entries f, row -> matrix row % gb I))) @@ samering -- two-sided ideal expected (note: R/I is a problem !!!) Matrix % Ideal := Matrix => ((f,I) -> diff --git a/M2/Macaulay2/m2/newring.m2 b/M2/Macaulay2/m2/newring.m2 index 9194f7f237f..8906e5919da 100644 --- a/M2/Macaulay2/m2/newring.m2 +++ b/M2/Macaulay2/m2/newring.m2 @@ -132,6 +132,7 @@ coerce(Thing,Thing) := (x,Y) -> if instance(x,Y) then x else error("no method fo coerce(Ideal,Ring) := quotient @@ first coerce(Thing,Nothing) := (x,Nothing) -> null -- avoid using this one, to save time earlier coerce(Ring,Ideal) := (R,Ideal) -> ideal R -- avoid using this one, to save time earlier +coerce(Ring,Ideal) := (R,LeftIdeal) -> ideal R -- avoid using this one, to save time earlier preprocessResultTemplate = (narrowers,r) -> ( if instance(r,ZZ) then r = r:null; r = apply(sequence r,x -> if x === null then Thing else x); @@ -192,7 +193,9 @@ triv := R -> ( flattenRing Ring := opts -> R -> ( resultTemplate := preprocessResultTemplate(1:Ring, opts.Result); k := opts.CoefficientRing; - if k === R or k === null and (R.?isBasic or isField R) then flatCoerce(R,resultTemplate,triv R) + if k === R or k === null and (R.?isBasic or isField R) and + not isWeylAlgebra R -- for WeylAlgebra flatCoerce doesn't work as is, since R/I is not defined for a left ideal I + then flatCoerce(R,resultTemplate,triv R) else unable()) flattenRing GaloisField := opts -> (cacheValue (symbol flattenRing => opts)) (F -> ( diff --git a/M2/Macaulay2/tests/ComputationsBook/d-modules/test.m2 b/M2/Macaulay2/tests/ComputationsBook/d-modules/test.m2 index d6f610477ec..4ec88333f02 100644 --- a/M2/Macaulay2/tests/ComputationsBook/d-modules/test.m2 +++ b/M2/Macaulay2/tests/ComputationsBook/d-modules/test.m2 @@ -46,7 +46,7 @@ Jfgh=ideal relations Rfgh.LocModule; JH3=Jfgh+ideal(f^2,g,h); JH3gb=gens gb JH3 testmTorsion = method(); -testmTorsion Ideal := (L) -> ( +testmTorsion LeftIdeal := (L) -> ( LL = ideal generators gb L; n = numgens (ring (LL)) // 2; LLLL = ideal select(first entries gens LL, f->( @@ -71,7 +71,7 @@ Ifgh=ideal relations Rfgh.LocModule; IH3=Ifgh+ideal(f,g,h); IH3gb=gens gb IH3 findSocle = method(); -findSocle(Ideal, RingElement):= (L,P) -> ( +findSocle(LeftIdeal, RingElement):= (L,P) -> ( createDpairs(ring(L)); v=(ring L).dpairVars#0; myflag = true; @@ -86,7 +86,7 @@ findSocle(Ideal, RingElement):= (L,P) -> ( D = ring JH3 findSocle(JH3,1_D) findLength = method(); -findLength Ideal := (I) -> ( +findLength LeftIdeal := (I) -> ( l = 0; while I != ideal 1_(ring I) do ( l = l + 1; diff --git a/M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected b/M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected index abd0a3e4aca..c3b6e79ce06 100644 --- a/M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected +++ b/M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected @@ -11,7 +11,7 @@ i3 : Delta = ideal(Dx,Dy,Dz) o3 = ideal (Dx, Dy, Dz) -o3 : Ideal of D +o3 : LeftIdeal of D i4 : (Dx * x)^2 @@ -67,19 +67,19 @@ i10 : AnnFs(f) o10 = ideal (w*Dz - z*Dw, w*Dy - y*Dw, z*Dy - y*Dz, w*Dx - x*Dw, z*Dx - x*Dz, y*Dx - x*Dy, x*Dx + y*Dy + z*Dz + w*Dw - 2s) -o10 : Ideal of QQ[x..z, w, Dx, Dy, Dz, Dw, s] +o10 : LeftIdeal of QQ[x..z, w, Dx, Dy, Dz, Dw, s] i11 : L=ideal(x,y,Dz,Dw) o11 = ideal (x, y, Dz, Dw) -o11 : Ideal of D +o11 : LeftIdeal of D i12 : AnnIFs(L,f) o12 = ideal (y, x, w*Dz - z*Dw, z*Dz + w*Dw - 2s) -o12 : Ideal of QQ[x..z, w, Dx, Dy, Dz, Dw, s] +o12 : LeftIdeal of QQ[x..z, w, Dx, Dy, Dz, Dw, s] i13 : f @@ -117,7 +117,7 @@ i18 : I1 = ideal((x*Dx)^2+1) 2 2 o18 = ideal(x Dx + x*Dx + 1) -o18 : Ideal of D1 +o18 : LeftIdeal of D1 i19 : f1 = x; @@ -175,7 +175,7 @@ i27 : D = QQ[x,y,z,Dx,Dy,Dz, WeylAlgebra => {x=>Dx, y=>Dy, z=>Dz}]; i28 : Delta = ideal(Dx,Dy,Dz); -o28 : Ideal of D +o28 : LeftIdeal of D i29 : f=x^3+y^3+z^3; @@ -217,7 +217,7 @@ i33 : D= QQ[x,y,z,u,v,w,Dx,Dy,Dz,Du,Dv,Dw, WeylAlgebra => i34 : Delta=ideal(Dx,Dy,Dz,Du,Dv,Dw); -o34 : Ideal of D +o34 : LeftIdeal of D i35 : R=D^1/Delta; @@ -268,11 +268,11 @@ o42 = -2 i43 : Jfgh=ideal relations Rfgh.LocModule; -o43 : Ideal of D +o43 : LeftIdeal of D i44 : JH3=Jfgh+ideal(f^2,g,h); -o44 : Ideal of D +o44 : LeftIdeal of D i45 : JH3gb=gens gb JH3 @@ -283,7 +283,7 @@ o45 : Matrix D <-- D i46 : testmTorsion = method(); -i47 : testmTorsion Ideal := (L) -> ( +i47 : testmTorsion LeftIdeal := (L) -> ( LL = ideal generators gb L; n = numgens (ring (LL)) // 2; LLLL = ideal select(first entries gens LL, f->( @@ -309,7 +309,7 @@ i52 : h=x*w-y*z; i53 : Delta=ideal(Dx,Dy,Dz,Dw); -o53 : Ideal of D +o53 : LeftIdeal of D i54 : R=D^1/Delta; @@ -333,11 +333,11 @@ i57 : Rfgh=DlocalizeAll(Rfg.LocModule,h, Strategy => Oaku); i58 : Ifgh=ideal relations Rfgh.LocModule; -o58 : Ideal of D +o58 : LeftIdeal of D i59 : IH3=Ifgh+ideal(f,g,h); -o59 : Ideal of D +o59 : LeftIdeal of D i60 : IH3gb=gens gb IH3 @@ -348,7 +348,7 @@ o60 : Matrix D <-- D i61 : findSocle = method(); -i62 : findSocle(Ideal, RingElement):= (L,P) -> ( +i62 : findSocle(LeftIdeal, RingElement):= (L,P) -> ( createDpairs(ring(L)); v=(ring L).dpairVars#0; myflag = true; @@ -375,7 +375,7 @@ o64 : D i65 : findLength = method(); -i66 : findLength Ideal := (I) -> ( +i66 : findLength LeftIdeal := (I) -> ( l = 0; while I != ideal 1_(ring I) do ( l = l + 1; @@ -480,7 +480,7 @@ i89 : I = gkz(matrix{{1,2}}, {5}) o89 = ideal (x D + 2x D - 5, D - D ) 1 1 2 2 1 2 -o89 : Ideal of QQ[x ..x , D ..D ] +o89 : LeftIdeal of QQ[x ..x , D ..D ] 1 2 1 2 i90 : PolySols I From 29af24fa3888e2dde05c7e4fd9f7d1c6673de28b Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Sun, 10 Dec 2023 07:45:40 -0500 Subject: [PATCH 10/14] some forgotten files in tests/normal --- M2/Macaulay2/tests/normal/isSkewCommutative.m2 | 4 ---- M2/Macaulay2/tests/normal/monoids.m2 | 4 +++- M2/Macaulay2/tests/normal/polyrings.m2 | 6 ++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/tests/normal/isSkewCommutative.m2 b/M2/Macaulay2/tests/normal/isSkewCommutative.m2 index dbfd0d19eb4..0880c24333f 100644 --- a/M2/Macaulay2/tests/normal/isSkewCommutative.m2 +++ b/M2/Macaulay2/tests/normal/isSkewCommutative.m2 @@ -8,9 +8,5 @@ R = QQ[x,y,z,SkewCommutative => {x,y}] assert( isSkewCommutative R ) R = QQ[x,y,z]/z^2 assert( not isSkewCommutative R ) -R = QQ[x,y,z,WeylAlgebra => {x => y}]/z^2 -assert( not isSkewCommutative R ) R = QQ[x,y,z,SkewCommutative => true]/z^2 assert( isSkewCommutative R ) -R = QQ[x,y,z,SkewCommutative => {x,y}]/z^2 -assert( isSkewCommutative R ) diff --git a/M2/Macaulay2/tests/normal/monoids.m2 b/M2/Macaulay2/tests/normal/monoids.m2 index 103f465e01e..4b6ba981812 100644 --- a/M2/Macaulay2/tests/normal/monoids.m2 +++ b/M2/Macaulay2/tests/normal/monoids.m2 @@ -241,11 +241,13 @@ A = QQ[t, dt, WeylAlgebra => {t => dt}] M = monoid A assert(A.WeylAlgebra == {{0, 1}}) assert(M.Options.WeylAlgebra == {{M_0, M_1}}) -B = first flattenRing(A[t]) +-* +B = first flattenRing(A[t]) -- flattenRing doesn't work for WeylAlgebra at the moment assert(gens B == {t_0, t_1, dt}) N = monoid B assert(B.WeylAlgebra == {{1, 2}}) assert(N.Options.WeylAlgebra == {{N_1, N_2}}) +*- -- test of adjoining variables with local variables needsPackage "BernsteinSato" diff --git a/M2/Macaulay2/tests/normal/polyrings.m2 b/M2/Macaulay2/tests/normal/polyrings.m2 index a5fbb3dcbe0..e6a2e8ebb5c 100644 --- a/M2/Macaulay2/tests/normal/polyrings.m2 +++ b/M2/Macaulay2/tests/normal/polyrings.m2 @@ -14,6 +14,8 @@ A = ZZ[a,b]/(a^3-b^3) B = A[x,y] assert(B_2^3 == B_3^3) +-* +-- Ring/LeftIdeal is not a ring C = ZZ/3[x,dx,k,WeylAlgebra => x => dx]/(k^3-x^3) -- I made this ZZ/3 so x^3 would be in the center [dan] del(dx,x,1) @@ -22,6 +24,7 @@ assert(D_1^3==D_3^3) com(x,t) com(dx,t) del(D_2,D_1,1) +*- E = A[s,ds,WeylAlgebra => s => ds] com(a*1_E,b*1_E) @@ -31,6 +34,8 @@ com(a,ds) com(b,ds) del(ds,s,1) +-* +-- C is not valid (see above) F = C[r,dr,WeylAlgebra => r => dr] del(dx*1_F,x*1_F,1) del(dr,r,1) @@ -38,6 +43,7 @@ com(dx,dr) com(dx,r) com(x,dr) com(x,r) +*- G = ZZ[p,SkewCommutative => true] assert( p^2 == 0 ) From e181bf04003f479900735dead4fa481750ccc006 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Tue, 12 Dec 2023 14:37:03 -0500 Subject: [PATCH 11/14] one line in ComputationsBook --- M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected b/M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected index c3b6e79ce06..4f1a684a449 100644 --- a/M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected +++ b/M2/Macaulay2/tests/ComputationsBook/d-modules/test.out.expected @@ -481,7 +481,7 @@ o89 = ideal (x D + 2x D - 5, D - D ) 1 1 2 2 1 2 o89 : LeftIdeal of QQ[x ..x , D ..D ] - 1 2 1 2 + 1 2 1 2 i90 : PolySols I From 66b93a0deb31b48eb0fbffce19ea72fdc8db5fd3 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Thu, 21 Nov 2024 14:43:01 -0500 Subject: [PATCH 12/14] fixed bug in support --- M2/Macaulay2/m2/matrix2.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/m2/matrix2.m2 b/M2/Macaulay2/m2/matrix2.m2 index e9b01710437..c4b9e4ecd3a 100644 --- a/M2/Macaulay2/m2/matrix2.m2 +++ b/M2/Macaulay2/m2/matrix2.m2 @@ -438,7 +438,7 @@ indices Matrix := (f) -> rawIndices raw f support = method() support RingElement := support Matrix := f -> apply(try rawIndices raw f else {}, i -> (ring f)_i) -support LeftIdeal := I -> rsort toList sum apply(flatten entries generators I, f -> set support f) +support LeftIdeal := I -> support generators I -------------------- -- homogenization -- From 50803b302a2057b085b98edc8e6c74c74d6c007d Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Tue, 26 Nov 2024 12:50:24 -0500 Subject: [PATCH 13/14] PolynomialRing ** PolynomialRing fixed to work in all cases --- M2/Macaulay2/m2/matrix1.m2 | 2 +- M2/Macaulay2/m2/matrix2.m2 | 8 ++------ M2/Macaulay2/m2/newring.m2 | 26 +++++++++++++------------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/M2/Macaulay2/m2/matrix1.m2 b/M2/Macaulay2/m2/matrix1.m2 index 4e733f2a301..45a5c803025 100644 --- a/M2/Macaulay2/m2/matrix1.m2 +++ b/M2/Macaulay2/m2/matrix1.m2 @@ -689,7 +689,7 @@ super Matrix := Matrix => (f) -> ( isInjective Matrix := (f) -> kernel f == 0 isSurjective Matrix := (f) -> cokernel f == 0 --- two-sided ideal expected +-- AL: `**` may cause problems in the noncommutative case scan({ZZ,QQ}, S -> ( lift(LeftIdeal,S) := opts -> (I,S) -> ( -- this will be pretty slow diff --git a/M2/Macaulay2/m2/matrix2.m2 b/M2/Macaulay2/m2/matrix2.m2 index c4b9e4ecd3a..a2e4ae40aba 100644 --- a/M2/Macaulay2/m2/matrix2.m2 +++ b/M2/Macaulay2/m2/matrix2.m2 @@ -141,10 +141,6 @@ complement Matrix := Matrix => (f) -> ( ----------------------------------------------------------------------------- -- the method is declared in gb.m2 mingens LeftIdeal := Matrix => opts -> I -> mingens(module I, opts) -mingens Module := Matrix => opts -> (cacheValue symbol mingens) ((M) -> ( - c := runHooks((mingens, Module), (opts, M)); - if c =!= null then c else error "mingens: no method implemented for this type of module")) - -- TODO: the strategies should be separated mingens Module := Matrix => opts -> M -> if isFreeModule M then generators M else cacheHooks( symbol mingens, M, (mingens, Module), (opts, M), (opts, M) -> ( @@ -174,8 +170,8 @@ trim = method (Options => { Strategy => null -* TODO: add DegreeLimit => {} *-}) trim Ring := Ring => o -> identity trim QuotientRing := Ring => o -> R -> quotient trim(ideal presentation R, o) --- trim Ideal := Ideal => opts -> I -> ideal trim(module I, opts) -trim LeftIdeal := LeftIdeal => opts -> (cacheValue (symbol trim => opts)) ((I) -> ideal trim(module I, opts)) +trim LeftIdeal := LeftIdeal => opts -> I -> ideal trim(module I, opts) +-- old or new version???: trim LeftIdeal := LeftIdeal => opts -> (cacheValue (symbol trim => opts)) ((I) -> ideal trim(module I, opts)) trim Module := Module => opts -> M -> if isFreeModule M then M else cacheHooks( (symbol trim, opts), M, (trim, Module), (opts, M), (opts, M) -> ( if opts.Strategy === null then opts = opts ++ { Strategy => Complement }; diff --git a/M2/Macaulay2/m2/newring.m2 b/M2/Macaulay2/m2/newring.m2 index 6d83be2bfb5..cd8ee7bf7c1 100644 --- a/M2/Macaulay2/m2/newring.m2 +++ b/M2/Macaulay2/m2/newring.m2 @@ -64,13 +64,7 @@ QuotientRing ** PolynomialRing := PolynomialRing ** QuotientRing := QuotientRing ** QuotientRing := (R,S) -> tensor(R,S) -tensor(PolynomialRing, PolynomialRing) := monoidTensorDefaults >> optns -> (R, S) -> ( - k := coefficientRing R; - if k =!= coefficientRing S - then error "expected rings to have the same coefficient ring"; - k tensor(monoid R, monoid S, optns) - ) - +tensor(PolynomialRing, PolynomialRing) := tensor(QuotientRing, PolynomialRing) := tensor(PolynomialRing, QuotientRing) := tensor(QuotientRing, QuotientRing) := monoidTensorDefaults >> optns -> (R, S) -> ( @@ -79,12 +73,18 @@ tensor(QuotientRing, QuotientRing) := monoidTensorDefaults >> optns -> (R, S) then error "expected rings to have the same coefficient ring"; f := presentation R; A := ring f; M := monoid A; m := numgens M; g := presentation S; B := ring g; N := monoid B; n := numgens N; - MN := k tensor(M, N, optns); - fg := substitute(f,(vars MN)_{0 .. m-1}) | substitute(g,(vars MN)_{m .. m+n-1}); - -- forceGB fg; -- if the monomial order chosen doesn't restrict, then this - -- is an error!! MES - AB := MN; - RS := AB/image fg; + AB := k tensor(M, N, optns); + -- need "if" below, since for non-commutative R or S `image fg` is a (zero) LeftIdeal + -- alt: need to prohibit tensoring non-commutative rings??? + -- alt (future???): quotients of non-commutative rings would be allowed and + -- `presentation R` then returns a potentially nontrivial two-sided ideal; + -- e.g., WA with some commuting variables + RS := if class R === PolynomialRing and class S === PolynomialRing then AB else ( + fg := substitute(f,(vars AB)_{0 .. m-1}) | substitute(g,(vars AB)_{m .. m+n-1}); + -- forceGB fg; -- if the monomial order chosen doesn't restrict, then this + -- is an error!! MES + AB/image fg + ); setupPromote map(RS,R,(vars AB)_{0 .. m-1}); setupLift map(R,RS,generators A | toList(n:0)); if S =!= R then ( From f8fa2faa9684689e8021e1cdad3fffd8248f9e54 Mon Sep 17 00:00:00 2001 From: Anton Leykin Date: Mon, 9 Dec 2024 11:12:33 -0500 Subject: [PATCH 14/14] long comment on Module / LeftIdeal --- M2/Macaulay2/m2/matrix1.m2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/M2/Macaulay2/m2/matrix1.m2 b/M2/Macaulay2/m2/matrix1.m2 index 45a5c803025..e9db5323baa 100644 --- a/M2/Macaulay2/m2/matrix1.m2 +++ b/M2/Macaulay2/m2/matrix1.m2 @@ -468,6 +468,7 @@ euler LeftIdeal := I -> euler((ring I)^1/I) -- two-sided ideal expected RingElement * Ideal := Ideal => (r,I) -> ideal (r ** generators I) Ideal * RingElement := Ideal => (I,r) -> ideal ((generators I)**r) +LeftIdeal * RingElement := Ideal => (I,r) -> ideal ((generators I)*r) -- staying away from ** ZZ * Ideal := (r,I) -> ideal (r * generators I) Ideal * ZZ := (I,r) -> ideal (r * generators I) @@ -503,6 +504,11 @@ LeftIdeal / LeftIdeal := Module => (I,J) -> module I / module J -- two-sided ideal expected Module / Ideal := Module => (M,J) -> M / (J * M) + +-- This function exist because there is a lot of user (package?) code +-- where `R^1/I` means R/I as a _left_ R-module and, in non-commutative setting, +-- (however, R^1 is a currently a right module over R^{op}). +-- It is never used for `M/I` where M is not `R^1`. Module / LeftIdeal := Module => (M,J) -> ( if isFreeModule M and rank M == 1 then comodule J