Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added deprecation warning for Matrix \\ Matrix #3222

Merged
merged 5 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion M2/Macaulay2/m2/lists.m2
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ Sequence | Sequence := Sequence => join
List + List := List => (v,w) -> apply(v,w,plus)
- List := List => v -> apply(v,minus)
List - List := List => (v,w) -> apply(v,w,difference)
List * Thing := List => (v,a) -> apply(v,x->x * a)
Thing * List := List => (a,v) -> apply(v,x->a * x)
List ** List := List => (X,Y) -> flatten for x in X list apply(Y, y -> (x, y))

List / Thing := List => (v,b) -> apply(v,x->x / b) -- slight conflict with List / Function!
List / RingElement := List / Number := List => (v,b) -> apply(v,x->x / b)
List // RingElement := List // Number := List => (v,b) -> apply(v,x->x // b)
List % RingElement := List % Number := List => (v,b) -> apply(v,x->x % b)

Expand Down
4 changes: 3 additions & 1 deletion M2/Macaulay2/m2/matrix2.m2
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,10 @@ quotientRemainder(Matrix,Matrix) := Matrix => (f,g) -> (
map(M, L, rem)
))

leftQuotientWarn = true

Matrix // Matrix := Matrix => (f,g) -> quotient(f,g)
Matrix \\ Matrix := (g,f) -> f // g
Matrix \\ Matrix := (g,f) -> (if leftQuotientWarn then (leftQuotientWarn = false; printerr "Warning: 'm \\\\ n' is deprecated; use 'n // m' instead."); f // g)
quotient'(Matrix,Matrix) := Matrix => (f,g) -> (
if not isFreeModule source f or not isFreeModule target f
or not isFreeModule source g or not isFreeModule target g then error "expected maps between free modules";
Expand Down
8 changes: 4 additions & 4 deletions M2/Macaulay2/packages/BettiCharacters.m2
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ action(ChainComplex,List,List,ZZ):=ActionOnComplex=>op->(C,l,l0,i) -> (
error "action: expected ring actor matrix to be a one-row substitution matrix";
);
--convert variable substitutions to matrices
l=apply(l,g->(vars R)\\lift(g,R));
l=apply(l,g->lift(g,R)//(vars R));
) else (
--if ring actors are matrices they must be square
if not all(l,g->numRows(g)==n) then (
Expand Down Expand Up @@ -556,7 +556,7 @@ actors(ActionOnComplex,ZZ) := List => (A,i) -> (
-- given a map of free modules C.dd_i : F <-- F',
-- the inverse group action on the ring (as substitution)
-- and the group action on F, computes the group action on F'
(gInv,g0) -> sub(C.dd_i,gInv)\\(g0*C.dd_i)
(gInv,g0) -> (g0*C.dd_i)//sub(C.dd_i,gInv)
);
-- make cache function from f and run it on A
((cacheValue (symbol actors,i)) f) A
Expand All @@ -568,7 +568,7 @@ actors(ActionOnComplex,ZZ) := List => (A,i) -> (
-- and the group action on F', computes the group action on F
-- it is necessary to transpose because we need a left factorization
-- but M2's command // always produces a right factorization
transpose(transpose(C.dd_(i+1))\\transpose(sub(C.dd_(i+1),gInv)*g0))
transpose(transpose(sub(C.dd_(i+1),gInv)*g0)//transpose(C.dd_(i+1)))
);
-- make cache function from f and run it on A
((cacheValue (symbol actors,i)) f) A
Expand Down Expand Up @@ -656,7 +656,7 @@ action(Module,List,List):=ActionOnGradedModule=>op->(M,l,l0) -> (
error "action: expected ring actor matrix to be a one-row substitution matrix";
);
--convert variable substitutions to matrices
l=apply(l,g->(vars R)\\lift(g,R));
l=apply(l,g->lift(g,R)//(vars R));
) else (
--if ring actors are matrices they must be square
if not all(l,g->numRows(g)==n) then (
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/packages/Macaulay2Doc/doc.m2
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ document {
(symbol*, ChainComplexMap, ChainComplexMap),
(symbol*, RingElement, RingElement),
(symbol*, Thing, List),
(symbol*, List, Thing),
(symbol*, ZZ, ProjectiveHilbertPolynomial),
(symbol*, ProjectiveHilbertPolynomial, ZZ),
(symbol*, RingElement, Vector),
Expand Down
2 changes: 1 addition & 1 deletion M2/Macaulay2/packages/Macaulay2Doc/doc3.m2
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ document {
}

document {
Key => {(symbol /,List,Thing)},
Key => {(symbol /,List,RingElement),(symbol /,List,Number)},
Headline => "vector division",
Usage => "v/c",
Inputs => {"v" => "to be treated as a vector", "c" => "a number or scalar ring element"},
Expand Down
11 changes: 5 additions & 6 deletions M2/Macaulay2/packages/Macaulay2Doc/doc8.m2
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ document {
}

document {
Key => {(symbol //, Matrix, Matrix),(symbol \\, Matrix, Matrix),
Key => {(symbol //, Matrix, Matrix),
(symbol //, RingElement, MonomialIdeal),
(symbol //, RingElement, GroebnerBasis),
(symbol //, RingElement, RingElement),
(symbol //, Matrix, MonomialIdeal),
(symbol //, Matrix, GroebnerBasis),
(symbol //, Matrix, RingElement),(symbol \\, Matrix, RingElement),
(symbol //, RingElement, Matrix),(symbol \\, RingElement, Matrix)
(symbol //, Matrix, RingElement),
(symbol //, RingElement, Matrix)
},
Headline => "factor a map through another",
Usage => "f//g\ng\\\\f",
Usage => "f//g",
Inputs => {
"f" => {"between modules F --> H, or ",
ofClass RingElement},
Expand All @@ -231,8 +231,7 @@ document {
for the image of ", TT "g", ".",
PARA{},
"If the remainder ", TT "f - g*h", " is zero,
then the quotient ", TT "f//g", " satisfies the equation ", TT "f === g * (f//g)", "
and the quotient ", TT "g\\\\f", " satisfies the equation ", TT "f === g * (g\\\\f)", ".",
then the quotient ", TT "f//g", " satisfies the equation ", TT "f === g * (f//g)", ".",
PARA{},
"One common use is the following. If an ideal contains 1, then we may write 1 in terms
of the generators of the ideal. First we make an ideal.",
Expand Down
2 changes: 1 addition & 1 deletion M2/Macaulay2/packages/Quasidegrees.m2
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ needsPackage"Dmodules"
A = matrix{{1,1,1,1},{0,1,5,11}}
R = toGradedRing(A,QQ[a..d])
I = toricIdeal(A,R)
S = quasidegreesLocalCohomology R^1/I
S = quasidegreesLocalCohomology(R^1/I)
T = {}; for i to #S-1 do T=T|{(S_i)_0}
for i to #T-1 do assert(holonomicRank(gkz(A,{0,0}))<holonomicRank(gkz(A,entries(T_i))))
///
Expand Down